Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compiling failing on Windows 10 Python 3.10 Cu118 and Visual Studio 2022 - Any pre compiled wheels for Windows? #5168

Closed
FurkanGozukara opened this issue Dec 5, 2023 · 3 comments

Comments

@FurkanGozukara
Copy link

FurkanGozukara commented Dec 5, 2023

installed torch and cuda

pip install torch==2.0.1 torchvision --index-url https://download.pytorch.org/whl/cu118

installed Cuda on system : C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.8

installed visual studio c++ compiler C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Tools\MSVC\14.33.31629\bin\Hostx64\x86

installed python 3.10.11

this is how i install on a venv

python -m pip install -e .

    "C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.8\bin\nvcc" -c G:\magic_animate\compose_densepose\detectron2\detectron2\layers\csrc\nms_rotated\nms_rotated_cuda.cu -o build\temp.win-amd64-cpython-310\Release\magic_animate\compose_densepose\detectron2\detectron2\layers\csrc\nms_rotated\nms_rotated_cuda.obj -IG:\magic_animate\compose_densepose\detectron2\detectron2\layers\csrc -IG:\magic_animate\compose_densepose\detectron2\venv\lib\site-packages\torch\include -IG:\magic_animate\compose_densepose\detectron2\venv\lib\site-packages\torch\include\torch\csrc\api\include -IG:\magic_animate\compose_densepose\detectron2\venv\lib\site-packages\torch\include\TH -IG:\magic_animate\compose_densepose\detectron2\venv\lib\site-packages\torch\include\THC "-IC:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.8\include" -IG:\magic_animate\compose_densepose\detectron2\venv\include -IC:\Python3108\include -IC:\Python3108\Include "-IC:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Tools\MSVC\14.33.31629\include" "-IC:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Tools\MSVC\14.33.31629\ATLMFC\include" "-IC:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Auxiliary\VS\include" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\ucrt" "-IC:\Program Files (x86)\Windows Kits\10\\include\10.0.19041.0\\um" "-IC:\Program Files (x86)\Windows Kits\10\\include\10.0.19041.0\\shared" "-IC:\Program Files (x86)\Windows Kits\10\\include\10.0.19041.0\\winrt" "-IC:\Program Files (x86)\Windows Kits\10\\include\10.0.19041.0\\cppwinrt" "-IC:\Program Files (x86)\Windows Kits\NETFXSDK\4.8\include\um" -Xcudafe --diag_suppress=dll_interface_conflict_dllexport_assumed -Xcudafe --diag_suppress=dll_interface_conflict_none_assumed -Xcudafe --diag_suppress=field_without_dll_interface -Xcudafe --diag_suppress=base_class_has_different_dll_interface -Xcompiler /EHsc -Xcompiler /wd4190 -Xcompiler /wd4018 -Xcompiler /wd4275 -Xcompiler /wd4267 -Xcompiler /wd4244 -Xcompiler /wd4251 -Xcompiler /wd4819 -Xcompiler /MD -D__CUDA_NO_HALF_OPERATORS__ -D__CUDA_NO_HALF_CONVERSIONS__ -D__CUDA_NO_BFLOAT16_CONVERSIONS__ -D__CUDA_NO_HALF2_OPERATORS__ --expt-relaxed-constexpr -O3 -DCUDA_HAS_FP16=1 -D__CUDA_NO_HALF_OPERATORS__ -D__CUDA_NO_HALF_CONVERSIONS__ -D__CUDA_NO_HALF2_OPERATORS__ -DTORCH_API_INCLUDE_EXTENSION_H -DTORCH_EXTENSION_NAME=_C -D_GLIBCXX_USE_CXX11_ABI=0 -gencode=arch=compute_86,code=compute_86 -gencode=arch=compute_86,code=sm_86 --use-local-env
    G:/magic_animate/compose_densepose/detectron2/venv/lib/site-packages/torch/include\c10/macros/Macros.h(138): warning C4067: unexpected tokens following preprocessor directive - expected a newline
    G:\magic_animate\compose_densepose\detectron2\detectron2\layers\csrc\nms_rotated\nms_rotated_cuda.cu(14): error: name must be a namespace name

    G:/magic_animate/compose_densepose/detectron2/venv/lib/site-packages/torch/include\c10/util/irange.h(54): warning #186-D: pointless comparison of unsigned integer with zero
              detected during:
                instantiation of "__nv_bool c10::detail::integer_iterator<I, one_sided, <unnamed>>::operator==(const c10::detail::integer_iterator<I, one_sided, <unnamed>> &) const [with I=size_t, one_sided=false, <unnamed>=0]"
    (61): here
                instantiation of "__nv_bool c10::detail::integer_iterator<I, one_sided, <unnamed>>::operator!=(const c10::detail::integer_iterator<I, one_sided, <unnamed>> &) const [with I=size_t, one_sided=false, <unnamed>=0]"
    G:/magic_animate/compose_densepose/detectron2/venv/lib/site-packages/torch/include\c10/core/TensorImpl.h(77): here

    G:/magic_animate/compose_densepose/detectron2/venv/lib/site-packages/torch/include\c10/util/irange.h(54): warning #186-D: pointless comparison of unsigned integer with zero
              detected during:
                instantiation of "__nv_bool c10::detail::integer_iterator<I, one_sided, <unnamed>>::operator==(const c10::detail::integer_iterator<I, one_sided, <unnamed>> &) const [with I=size_t, one_sided=true, <unnamed>=0]"
    (61): here
                instantiation of "__nv_bool c10::detail::integer_iterator<I, one_sided, <unnamed>>::operator!=(const c10::detail::integer_iterator<I, one_sided, <unnamed>> &) const [with I=size_t, one_sided=true, <unnamed>=0]"
    G:/magic_animate/compose_densepose/detectron2/venv/lib/site-packages/torch/include\ATen/core/qualified_name.h(73): here

    G:\magic_animate\compose_densepose\detectron2\detectron2\layers\csrc\nms_rotated\nms_rotated_cuda.cu(68): error: identifier "single_box_iou_rotated" is undefined
              detected during instantiation of "void nms_rotated_cuda_kernel(int, double, const T *, unsigned long long *) [with T=double]"
    (105): here

    G:\magic_animate\compose_densepose\detectron2\detectron2\layers\csrc\nms_rotated\nms_rotated_cuda.cu(68): error: type name is not allowed
              detected during instantiation of "void nms_rotated_cuda_kernel(int, double, const T *, unsigned long long *) [with T=double]"
    (105): here

    G:\magic_animate\compose_densepose\detectron2\detectron2\layers\csrc\nms_rotated\nms_rotated_cuda.cu(68): warning #174-D: expression has no effect
              detected during instantiation of "void nms_rotated_cuda_kernel(int, double, const T *, unsigned long long *) [with T=double]"
    (105): here

    G:\magic_animate\compose_densepose\detectron2\detectron2\layers\csrc\nms_rotated\nms_rotated_cuda.cu(58): warning #550-D: variable "cur_box" was set but never used
              detected during instantiation of "void nms_rotated_cuda_kernel(int, double, const T *, unsigned long long *) [with T=double]"
    (105): here

    G:\magic_animate\compose_densepose\detectron2\detectron2\layers\csrc\nms_rotated\nms_rotated_cuda.cu(68): error: identifier "single_box_iou_rotated" is undefined
              detected during instantiation of "void nms_rotated_cuda_kernel(int, double, const T *, unsigned long long *) [with T=float]"
    (105): here

    G:\magic_animate\compose_densepose\detectron2\detectron2\layers\csrc\nms_rotated\nms_rotated_cuda.cu(68): error: type name is not allowed
              detected during instantiation of "void nms_rotated_cuda_kernel(int, double, const T *, unsigned long long *) [with T=float]"
    (105): here

    G:\magic_animate\compose_densepose\detectron2\detectron2\layers\csrc\nms_rotated\nms_rotated_cuda.cu(68): warning #174-D: expression has no effect
              detected during instantiation of "void nms_rotated_cuda_kernel(int, double, const T *, unsigned long long *) [with T=float]"
    (105): here

    G:\magic_animate\compose_densepose\detectron2\detectron2\layers\csrc\nms_rotated\nms_rotated_cuda.cu(58): warning #550-D: variable "cur_box" was set but never used
              detected during instantiation of "void nms_rotated_cuda_kernel(int, double, const T *, unsigned long long *) [with T=float]"
    (105): here

    5 errors detected in the compilation of "G:/magic_animate/compose_densepose/detectron2/detectron2/layers/csrc/nms_rotated/nms_rotated_cuda.cu".
    nms_rotated_cuda.cu
    error: command 'C:\\Program Files\\NVIDIA GPU Computing Toolkit\\CUDA\\v11.8\\bin\\nvcc.exe' failed with exit code 1
    [end of output]

note: This error originates from a subprocess, and is likely not a problem with pip.
@1kuzus
Copy link

1kuzus commented Jan 10, 2024

Hello! I got the same problem. how did you solve that?

@FurkanGozukara
Copy link
Author

Hello! I got the same problem. how did you solve that?

it is hard to solve

you need to have matching and accurate c++ compilers and torch libraries and cuda

i have now auto installer that installs pre compiled one :

MagicAnimate: Temporally Consistent Human Image Animation using Diffusion Model - Full Tutorial

image

@blurmemo
Copy link

First you should enable your Visual Studio's version <= 2022 17.10.
Then you need find nms_rotated_cuda.cu file in the path of 'detectron2\detectron2\layers\csrc\nms_rotated' and modify it as following.

/**
fix problem about undefine
#ifdef WITH_CUDA
#include "../box_iou_rotated/box_iou_rotated_utils.h"
#endif
// TODO avoid this when pytorch supports "same directory" hipification
#ifdef WITH_HIP
#include "box_iou_rotated/box_iou_rotated_utils.h"
#endif
*/
// added code line
#include "box_iou_rotated/box_iou_rotated_utils.h"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants