facebookresearch / detectron2

Detectron2 is a platform for object detection, segmentation and other visual recognition tasks.
https://detectron2.readthedocs.io/en/latest/
Apache License 2.0
30.1k stars 7.42k forks source link

CUDA type error building on Windows 10 #848

Closed YoongiKim closed 4 years ago

YoongiKim commented 4 years ago

Hello. I'm trying to install detectron2 on my windows 10. I followed some guides. But it seems this error is brand new.

Instructions To Reproduce the Issue:

  1. Installing by pip install -e . successes. But when running demo.py, it fails with Not compiled with GPU support I think pip install cannot detect my CUDA (even I set PATH settings). So I tried to install with setup.py

  2. Tried to install with setup.py because it detects CUDA OK.

    
    (conda env) python setup.py install
    ~~~ long warnings ~~~

D:/Projects/detectron2/detectron2/layers/csrc/ROIAlign/ROIAlign_cuda.cu(337): error: no instance of function template "at::cuda::ATenCeilDiv" matches the argument list argument types are: (long long, long)

D:/Projects/detectron2/detectron2/layers/csrc/ROIAlign/ROIAlign_cuda.cu(337): error: no instance of overloaded function "std::min" matches the argument list argument types are: (, long)

D:/Projects/detectron2/detectron2/layers/csrc/ROIAlign/ROIAlign_cuda.cu(394): error: no instance of function template "at::cuda::ATenCeilDiv" matches the argument list argument types are: (int64_t, long)

D:/Projects/detectron2/detectron2/layers/csrc/ROIAlign/ROIAlign_cuda.cu(394): error: no instance of overloaded function "std::min" matches the argument list argument types are: (, long)

4 errors detected in the compilation of "C:/Users/YOONGI~1/AppData/Local/Temp/tmpxft_00001a10_00000000-10_ROIAlign_cuda.cpp1.ii". error: command 'C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v10.1\bin\nvcc.exe' failed with exit status 1

But fails with above error.

## Environment:
pytorch 1.4.0 on Anaconda installation
CUDA 10.1 with CuDNN 7.6.5
Visual Studio 2019
Windows 10

sys.platform win32 Python 3.7.6 (default, Jan 8 2020, 20:23:39) [MSC v.1916 64 bit (AMD64)] numpy 1.18.1 detectron2 0.1 @D:\Projects\detectron2\detectron2 detectron2 compiler MSVC 191627030 detectron2 CUDA compiler not available detectron2 arch flags D:\Projects\detectron2\detectron2_C.cp37-win_amd64.pyd; cannot find cuobjdump DETECTRON2_ENV_MODULE PyTorch 1.4.0 @C:\conda\envs\ml\lib\site-packages\torch PyTorch debug build False CUDA available True GPU 0 GeForce GTX 1070 CUDA_HOME C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v10.1 NVCC Not Available Pillow 7.0.0 torchvision 0.5.0 @C:\conda\envs\ml\lib\site-packages\torchvision torchvision arch flags C:\conda\envs\ml\lib\site-packages\torchvision_C.pyd; cannot find cuobjdump cv2 4.1.2


PyTorch built with:

YoongiKim commented 4 years ago

I posted pull request. https://github.com/facebookresearch/detectron2/pull/849#issue-373815570