Hello everybody,
i would appreciate very much your help on the following problem with installing detectron2 on windows 10.
I am getting a nvcc error after trying to build detectron2 with torch 1.5.0 and torchvision 0.6.0, built on cuda 10.2. I am running the command python -m pip install git+https://github.com/facebookresearch/detectron2.git and getting this error message:
__5 errors detected in the compilation of "C:/Users/lotha/AppData/Local/Temp/tmpxft_000016c8_00000000-10_nms_rotated_cuda.cpp1.ii".
nms_rotated_cuda.cu
error: command 'C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v10.2\bin\nvcc.exe' failed with exit status 1
Error in atexit.run_exitfuncs:
Traceback (most recent call last):
File "C:\Users\lotha\Anaconda3\lib\site-packages\colorama\ansitowin32.py", line 59, in closed
return stream.closed
ValueError: underlying buffer has been detached
ERROR: Failed building wheel for detectron2_
I already tried another cuda-version (9.2), i tried VS 17 build tools, did a conda install for pytorch/ torchvision, tried to build from source code and even set back my computer to ensure that the system variables are at default. On the install.md-troubleshooting of detectron2 there is mentioned that nvcc-errors might be due to a gcc-incompatibility - but i already tried with gcc 9.2.0 and 7.4.0.
Beyond, I think its important to mention that detectron2 already worked on my computer - i just uninstalled it. Below is some part of the log... Thank you very much!
_C:/Users/lotha/Anaconda3/lib/site-packages/torch/include\ATen/Context.h(131): warning: field of class type without a DLL interface used in a class with a DLL interface
C:/Users/lotha/Anaconda3/lib/site-packages/torch/include\ATen/Context.h(132): warning: field of class type without a DLL interface used in a class with a DLL interface
C:/Users/lotha/Anaconda3/lib/site-packages/torch/include\ATen/Context.h(133): warning: field of class type without a DLL interface used in a class with a DLL interface
C:/Users/lotha/Anaconda3/lib/site-packages/torch/include\ATen/TensorGeometry.h(56): warning: field of class type without a DLL interface used in a class with a DLL interface
C:/Users/lotha/Anaconda3/lib/site-packages/torch/include\ATen/TensorGeometry.h(57): warning: field of class type without a DLL interface used in a class with a DLL interface
C:/Users/lotha/Anaconda3/lib/site-packages/torch/include\c10/cuda/CUDAStream.h(171): warning: field of class type without a DLL interface used in a class with a DLL interface
C:/Users/lotha/Anaconda3/lib/site-packages/torch/include\TH/THAllocator.h(60): warning: field of class type without a DLL interface used in a class with a DLL interface
C:/Users/lotha/Anaconda3/lib/site-packages/torch/include\TH/THAllocator.h(66): warning: field of class type without a DLL interface used in a class with a DLL interface
C:/Users/lotha/Anaconda3/lib/site-packages/torch/include\THC/THCAllocator.h(14): warning: field of class type without a DLL interface used in a class with a DLL interface
C:/Users/lotha/AppData/Local/Temp/pip-req-build-fb0oenry/detectron2/layers/csrc/nms_rotated/nms_rotated_cuda.cu(14): error: name must be a namespace name
C:/Users/lotha/AppData/Local/Temp/pip-req-build-fb0oenry/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, float, const T *, unsigned long long *) [with T=double]"
(105): here
C:/Users/lotha/AppData/Local/Temp/pip-req-build-fb0oenry/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, float, const T *, unsigned long long *) [with T=double]"
(105): here
C:/Users/lotha/AppData/Local/Temp/pip-req-build-fb0oenry/detectron2/layers/csrc/nms_rotated/nms_rotated_cuda.cu(68): warning: expression has no effect
detected during instantiation of "void nms_rotated_cuda_kernel(int, float, const T *, unsigned long long *) [with T=double]"
(105): here
C:/Users/lotha/AppData/Local/Temp/pip-req-build-fb0oenry/detectron2/layers/csrc/nms_rotated/nms_rotated_cuda.cu(58): warning: variable "cur_box" was set but never used
detected during instantiation of "void nms_rotated_cuda_kernel(int, float, const T *, unsigned long long *) [with T=double]"
(105): here
C:/Users/lotha/AppData/Local/Temp/pip-req-build-fb0oenry/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, float, const T *, unsigned long long *) [with T=float]"
(105): here
C:/Users/lotha/AppData/Local/Temp/pip-req-build-fb0oenry/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, float, const T *, unsigned long long *) [with T=float]"
(105): here
C:/Users/lotha/AppData/Local/Temp/pip-req-build-fb0oenry/detectron2/layers/csrc/nms_rotated/nms_rotated_cuda.cu(68): warning: expression has no effect
detected during instantiation of "void nms_rotated_cuda_kernel(int, float, const T *, unsigned long long *) [with T=float]"
(105): here
C:/Users/lotha/AppData/Local/Temp/pip-req-build-fb0oenry/detectron2/layers/csrc/nms_rotated/nms_rotated_cuda.cu(58): warning: variable "cur_box" was set but never used
detected during instantiation of "void nms_rotated_cuda_kernel(int, float, const T *, unsigned long long *) [with T=float]"
(105): here
Unfortunately we do not provide support for windows.
I ran into the same issue, in my case the "box_iou_rotated_utils.h" wasn't being imported properly in the detectron2\layers\csrc\nms_rotated\nms_rotated_cuda.cu file.
// Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved
#include <ATen/ATen.h>
#include <ATen/cuda/CUDAContext.h>
#include <c10/cuda/CUDAGuard.h>
#include <ATen/cuda/CUDAApplyUtils.cuh>
//NOTE: replace relative import
/*#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*/
#include "box_iou_rotated/box_iou_rotated_utils.h"
I guess the relative import wasn't working on windows. So I commented out the WITH_CUDA and WITH_HIP checks and instead just used #include "box_iou_rotated/box_iou_rotated_utils.h"
I ran into the same issue, in my case the
"box_iou_rotated_utils.h"wasn't being imported properly in thedetectron2\layers\csrc\nms_rotated\nms_rotated_cuda.cufile.// Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved #include <ATen/ATen.h> #include <ATen/cuda/CUDAContext.h> #include <c10/cuda/CUDAGuard.h> #include <ATen/cuda/CUDAApplyUtils.cuh> //NOTE: replace relative import /*#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*/ #include "box_iou_rotated/box_iou_rotated_utils.h"I guess the relative import wasn't working on windows. So I commented out the
WITH_CUDAandWITH_HIPchecks and instead just used#include "box_iou_rotated/box_iou_rotated_utils.h"
thank u ,it works for me !
Most helpful comment
I ran into the same issue, in my case the
"box_iou_rotated_utils.h"wasn't being imported properly in thedetectron2\layers\csrc\nms_rotated\nms_rotated_cuda.cufile.I guess the relative import wasn't working on windows. So I commented out the
WITH_CUDAandWITH_HIPchecks and instead just used#include "box_iou_rotated/box_iou_rotated_utils.h"