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

Error while compiling cuda extension under on Win1lib\csrc #72

Closed
pj746 opened this issue Jul 30, 2020 · 5 comments
Closed

Error while compiling cuda extension under on Win1lib\csrc #72

pj746 opened this issue Jul 30, 2020 · 5 comments

Comments

@pj746
Copy link

pj746 commented Jul 30, 2020

Environment configure:
pytorch 1.6.0
Python 3.6.10
Anaconda 1.9.7
Windows 10

When I tried to run python setup.py build_ext --inplace under lib\csrc\dcn_v2, an error occured:

running build_ext
D:\L_Anaconda3\envs\deepSnake\lib\site-packages\torch\utils\cpp_extension.py:270: UserWarning: Error checking compiler version for cl: 'utf-8' codec can't decode byte 0xd3 in position 0: invalid continuation byte
warnings.warn('Error checking compiler version for {}: {}'.format(compiler, error))
building 'ext' extension
Emitting ninja build file C:\Users\wupeixuan\Documents\DeepSnake\snake\lib\csrc\dcn_v2\build\temp.win-amd64-3.6\Release\build.ninja...
Compiling objects...
Allowing ninja to set a default number of workers... (overridable by setting the environment variable MAX_JOBS=N)
[1/1] C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v10.1\bin\nvcc -Xcompiler /MD -Xcompiler /wd4819 -Xcompiler /wd4251 -Xcompiler /wd4244 -Xcompiler /wd4267 -Xcompiler /wd4275 -Xcompiler /wd4018 -Xcompiler /wd4190 -Xcompiler /EHsc -Xcudafe --diag_suppress=base_class_has_different_dll_interface -Xcudafe --diag_suppress=field_without_dll_interface -Xcudafe --diag_suppress=dll_interface_conflict_none_assumed -Xcudafe --diag_suppress=dll_interface_conflict_dllexport_assumed -DWITH_CUDA -IC:\Users\wupeixuan\Documents\DeepSnake\snake\lib\csrc\dcn_v2\src -ID:\L_Anaconda3\envs\deepSnake\lib\site-packages\torch\include -ID:\L_Anaconda3\envs\deepSnake\lib\site-packages\torch\include\torch\csrc\api\include -ID:\L_Anaconda3\envs\deepSnake\lib\site-packages\torch\include\TH -ID:\L_Anaconda3\envs\deepSnake\lib\site-packages\torch\include\THC "-IC:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v10.1\include" -ID:\L_Anaconda3\envs\deepSnake\include -ID:\L_Anaconda3\envs\deepSnake\include "-IC:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.23.28105\ATLMFC\include" "-IC:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.23.28105\include" "-IC:\Program Files (x86)\Windows Kits\NETFXSDK\4.8\include\um" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\ucrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\shared" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\um" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\winrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\cppwinrt" "-IC:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.23.28105\include" "-IC:\Users\wupeixuan\Documents\DeepSnake\snake\lib\csrc\dcn_v2\ C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\ucrt" -c C:\Users\wupeixuan\Documents\DeepSnake\snake\lib\csrc\dcn_v2\src\cuda\dcn_v2_cuda.cu -o C:\Users\wupeixuan\Documents\DeepSnake\snake\lib\csrc\dcn_v2\build\temp.win-amd64-3.6\Release\Users\wupeixuan\Documents\DeepSnake\snake\lib\csrc\dcn_v2\src\cuda\dcn_v2_cuda.obj -D__CUDA_NO_HALF_OPERATORS
_ -D__CUDA_NO_HALF_CONVERSIONS__ -D__CUDA_NO_HALF2_OPERATORS__ --expt-relaxed-constexpr -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=ext -D_GLIBCXX_USE_CXX11_ABI=0 -gencode=arch=compute_75,code=sm_75
FAILED: C:/Users/wupeixuan/Documents/DeepSnake/snake/lib/csrc/dcn_v2/build/temp.win-amd64-3.6/Release/Users/wupeixuan/Documents/DeepSnake/snake/lib/csrc/dcn_v2/src/cuda/dcn_v2_cuda.obj
C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v10.1\bin\nvcc -Xcompiler /MD -Xcompiler /wd4819 -Xcompiler /wd4251 -Xcompiler /wd4244 -Xcompiler /wd4267 -Xcompiler /wd4275 -Xcompiler /wd4018 -Xcompiler /wd4190 -Xcompiler /EHsc -Xcudafe --diag_suppress=base_class_has_different_dll_interface -Xcudafe --diag_suppress=field_without_dll_interface -Xcudafe --diag_suppress=dll_interface_conflict_none_assumed -Xcudafe --diag_suppress=dll_interface_conflict_dllexport_assumed -DWITH_CUDA -IC:\Users\wupeixuan\Documents\DeepSnake\snake\lib\csrc\dcn_v2\src -ID:\L_Anaconda3\envs\deepSnake\lib\site-packages\torch\include -ID:\L_Anaconda3\envs\deepSnake\lib\site-packages\torch\include\torch\csrc\api\include -ID:\L_Anaconda3\envs\deepSnake\lib\site-packages\torch\include\TH -ID:\L_Anaconda3\envs\deepSnake\lib\site-packages\torch\include\THC "-IC:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v10.1\include" -ID:\L_Anaconda3\envs\deepSnake\include -ID:\L_Anaconda3\envs\deepSnake\include "-IC:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.23.28105\ATLMFC\include" "-IC:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.23.28105\include" "-IC:\Program Files (x86)\Windows Kits\NETFXSDK\4.8\include\um" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\ucrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\shared" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\um" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\winrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\cppwinrt" "-IC:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.23.28105\include" "-IC:\Users\wupeixuan\Documents\DeepSnake\snake\lib\csrc\dcn_v2\ C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\ucrt" -c C:\Users\wupeixuan\Documents\DeepSnake\snake\lib\csrc\dcn_v2\src\cuda\dcn_v2_cuda.cu -o C:\Users\wupeixuan\Documents\DeepSnake\snake\lib\csrc\dcn_v2\build\temp.win-amd64-3.6\Release\Users\wupeixuan\Documents\DeepSnake\snake\lib\csrc\dcn_v2\src\cuda\dcn_v2_cuda.obj -D__CUDA_NO_HALF_OPERATORS
_ -D__CUDA_NO_HALF_CONVERSIONS__ -D__CUDA_NO_HALF2_OPERATORS__ --expt-relaxed-constexpr -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=_ext -D_GLIBCXX_USE_CXX11_ABI=0 -gencode=arch=compute_75,code=sm_75
D:/L_Anaconda3/envs/deepSnake/lib/site-packages/torch/include\c10/util/ThreadLocalDebugInfo.h(12): warning: modifier is ignored on an enum specifier

C:/Users/wupeixuan/Documents/DeepSnake/snake/lib/csrc/dcn_v2/src/cuda/dcn_v2_cuda.cu(108): error: identifier "THCState_getCurrentStream" is undefined

C:/Users/wupeixuan/Documents/DeepSnake/snake/lib/csrc/dcn_v2/src/cuda/dcn_v2_cuda.cu(280): error: identifier "THCState_getCurrentStream" is undefined

C:/Users/wupeixuan/Documents/DeepSnake/snake/lib/csrc/dcn_v2/src/cuda/dcn_v2_cuda.cu(325): error: identifier "THCudaBlas_Sgemv" is undefined

3 errors detected in the compilation of "C:/Users/Admin/AppData/Local/Temp/tmpxft_0000c430_00000000-10_dcn_v2_cuda.cpp1.ii".
dcn_v2_cuda.cu
ninja: build stopped: subcommand failed.
Traceback (most recent call last):
File "D:\L_Anaconda3\envs\deepSnake\lib\site-packages\torch\utils\cpp_extension.py", line 1515, in _run_ninja_build
env=env)
File "D:\L_Anaconda3\envs\deepSnake\lib\subprocess.py", line 438, in run
output=stdout, stderr=stderr)
subprocess.CalledProcessError: Command '['ninja', '-v']' returned non-zero exit status 1.

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "setup.py", line 65, in
cmdclass={"build_ext": torch.utils.cpp_extension.BuildExtension},
File "D:\L_Anaconda3\envs\deepSnake\lib\site-packages\setuptools_init_.py", line 165, in setup
return distutils.core.setup(**attrs)
File "D:\L_Anaconda3\envs\deepSnake\lib\distutils\core.py", line 148, in setup
dist.run_commands()
File "D:\L_Anaconda3\envs\deepSnake\lib\distutils\dist.py", line 955, in run_commands
self.run_command(cmd)
File "D:\L_Anaconda3\envs\deepSnake\lib\distutils\dist.py", line 974, in run_command
cmd_obj.run()
File "D:\L_Anaconda3\envs\deepSnake\lib\site-packages\setuptools\command\build_ext.py", line 87, in run
_build_ext.run(self)
File "D:\L_Anaconda3\envs\deepSnake\lib\site-packages\Cython\Distutils\old_build_ext.py", line 186, in run
_build_ext.build_ext.run(self)
File "D:\L_Anaconda3\envs\deepSnake\lib\distutils\command\build_ext.py", line 339, in run
self.build_extensions()
File "D:\L_Anaconda3\envs\deepSnake\lib\site-packages\torch\utils\cpp_extension.py", line 649, in build_extensions
build_ext.build_extensions(self)
File "D:\L_Anaconda3\envs\deepSnake\lib\site-packages\Cython\Distutils\old_build_ext.py", line 194, in build_extensions
self.build_extension(ext)
File "D:\L_Anaconda3\envs\deepSnake\lib\site-packages\setuptools\command\build_ext.py", line 208, in build_extension
_build_ext.build_extension(self, ext)
File "D:\L_Anaconda3\envs\deepSnake\lib\distutils\command\build_ext.py", line 533, in build_extension
depends=ext.depends)
File "D:\L_Anaconda3\envs\deepSnake\lib\site-packages\torch\utils\cpp_extension.py", line 631, in win_wrap_ninja_compile
with_cuda=with_cuda)
File "D:\L_Anaconda3\envs\deepSnake\lib\site-packages\torch\utils\cpp_extension.py", line 1233, in _write_ninja_file_and_compile_objects
error_prefix='Error compiling objects for extension')
File "D:\L_Anaconda3\envs\deepSnake\lib\site-packages\torch\utils\cpp_extension.py", line 1529, in _run_ninja_build
raise RuntimeError(message)
RuntimeError: Error compiling objects for extension

@pj746 pj746 changed the title Error while compiling cuda extension under on Win1lib\csrc0 Error while compiling cuda extension under on Win1lib\csrc Jul 30, 2020
@Zhang-O
Copy link

Zhang-O commented Jul 30, 2020

please run it on linux platform .
Then close the issue.

@pengsida
Copy link
Member

You could try pytorch 1.1 with cuda 9.0.

@pengsida pengsida closed this as completed Aug 3, 2020
@pj746
Copy link
Author

pj746 commented Aug 7, 2020

I changed to Linux but there're still tons of errors while compiling cuda extension under the CUDA 10.1 environment. It works well when I tried Pytorch 1.1, CUDA 9.0 and GCC 5.5. Thanks a lot.

@JunnYu
Copy link

JunnYu commented Aug 8, 2020

Refer to this code,(Fixes for Pytorch 1.6 and CUDA 11 CharlesShang/DCNv2#71)
I built successfully. My environment : Win10 Cuda 10.1 Pytorch 1.6.

@wangshuo2020
Copy link

I changed to Linux but there're still tons of errors while compiling cuda extension under the CUDA 10.1 environment. It works well when I tried Pytorch 1.1, CUDA 9.0 and GCC 5.5. Thanks a lot.
error: command 'gcc' failed with exit status 1? Have you faced this problem?

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

5 participants