NVIDIAGameWorks/kaolin

Winerror2 Occur, when I run "python setup.py develop"

DopeorNope-Lee opened this issue · 9 comments

For install kaolin, I got this warning message from my window cmd terminal.
Anyone knows how to solve this problem?

I run this command in cmd "python setup.py develop"
And I got this message.

I also did cd kaolin for move working directory.
please help me for research..!

Traceback (most recent call last):
File "C:\Users\user\kaolin\setup.py", line 300, in
ext_modules=get_extensions(),
File "C:\Users\user\kaolin\setup.py", line 218, in get_extensions
include_dirs = get_include_dirs()
File "C:\Users\user\kaolin\setup.py", line 270, in get_include_dirs
_, bare_metal_major, _ = get_cuda_bare_metal_version(CUDA_HOME)
File "C:\Users\user\kaolin\setup.py", line 105, in get_cuda_bare_metal_version
raw_output = subprocess.check_output([cuda_dir + "/bin/nvcc", "-V"], universal_newlines=True)
File "C:\Users\user\anaconda3\envs\nefr\lib\subprocess.py", line 424, in check_output
return run(*popenargs, stdout=PIPE, timeout=timeout, check=True,
File "C:\Users\user\anaconda3\envs\nefr\lib\subprocess.py", line 505, in run
with Popen(*popenargs, **kwargs) as process:
File "C:\Users\user\anaconda3\envs\nefr\lib\subprocess.py", line 951, in init
self._execute_child(args, executable, preexec_fn, close_fds,
File "C:\Users\user\anaconda3\envs\nefr\lib\subprocess.py", line 1420, in _execute_child
hp, ht, pid, tid = _winapi.CreateProcess(executable, args,
FileNotFoundError: [WinError 2] system cannot find the file specified

Hi @dopeornope-Lee look like windows have an issue with finding the cuda dir, can you give me more information about your system? GPU / drivers / cuda / pytorch / python.

Also can you print the output of the following script:

from torch.utils.cpp_extension import CUDA_HOME
print(CUDA_HOME)

Hi @Caenorst ! Thank you for your response.
C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.3

This is my CUDA_HOME dir..!

Moreover print out result of statement, you suggeted was also same result.

I'll wait your response. Thank you..!

Can you verify that the file C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.3/bin/nvcc exists?

@Caenorst Yes I'm sorry for late reply.
I checked that file in C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.3/bin/nvcc

How can I sove it?

I think you have a permission issue, you may not have execution rights to nvcc

Just to be sure can you try replacing the line 105 of setup.py by:

    raw_output = subprocess.check_output([os.path.join(cuda_dir, "bin", "nvcc"), "-V"], universal_newlines=True)

@Caenorst Thank you..! I solved this problem, but another issue occurs, when I run setup.py

"C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.3\bin\nvcc" -c kaolin/csrc\metrics\sided_distance_cuda.cu -o build\temp.win-amd64-cpython-39\Release\kaolin/csrc\metrics\sided_distance_cuda.obj -IC:\Users\user\anaconda3\envs\nefr\lib\site-packages\torch\include -IC:\Users\user\anaconda3\envs\nefr\lib\site-packages\torch\include\torch\csrc\api\include -IC:\Users\user\anaconda3\envs\nefr\lib\site-packages\torch\include\TH -IC:\Users\user\anaconda3\envs\nefr\lib\site-packages\torch\include\THC "-IC:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.3\include" -IC:\Users\user\anaconda3\envs\nefr\include -IC:\Users\user\anaconda3\envs\nefr\Include "-IC:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Tools\MSVC\14.34.31933\include" "-IC:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Auxiliary\VS\include" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.22000.0\ucrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.22000.0\um" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.22000.0\shared" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.22000.0\winrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.22000.0\cppwinrt" -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 -DWITH_CUDA -DTHRUST_IGNORE_CUB_VERSION_CHECK -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
sided_distance_cuda.cu
C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.3\include\crt/host_config.h(160): fatal error C1189: #error: -- unsupported Microsoft Visual Studio version! Only the versions between 2017 and 2019 (inclusive) are supported! The nvcc flag '-allow-unsupported-compiler' can be used to override this version check; however, using an unsupported host compiler may cause compilation failure or incorrect run time execution. Use at your own risk.
error: command 'C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.3\bin\nvcc.exe' failed with exit code 2

This is my error message from cmd...!

How can I solve it?

my problem is (error: command 'C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.6\bin\nvcc.exe' failed with exit code 2). I solve it by "git checkout master". it seems that my branch is wrong

@Caenorst Thank you..! I solved this problem, but another issue occurs, when I run setup.py

"C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.3\bin\nvcc" -c kaolin/csrc\metrics\sided_distance_cuda.cu -o build\temp.win-amd64-cpython-39\Release\kaolin/csrc\metrics\sided_distance_cuda.obj -IC:\Users\user\anaconda3\envs\nefr\lib\site-packages\torch\include -IC:\Users\user\anaconda3\envs\nefr\lib\site-packages\torch\include\torch\csrc\api\include -IC:\Users\user\anaconda3\envs\nefr\lib\site-packages\torch\include\TH -IC:\Users\user\anaconda3\envs\nefr\lib\site-packages\torch\include\THC "-IC:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.3\include" -IC:\Users\user\anaconda3\envs\nefr\include -IC:\Users\user\anaconda3\envs\nefr\Include "-IC:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Tools\MSVC\14.34.31933\include" "-IC:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Auxiliary\VS\include" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.22000.0\ucrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.22000.0\um" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.22000.0\shared" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.22000.0\winrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.22000.0\cppwinrt" -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 -DWITH_CUDA -DTHRUST_IGNORE_CUB_VERSION_CHECK -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 sided_distance_cuda.cu C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.3\include\crt/host_config.h(160): fatal error C1189: #error: -- unsupported Microsoft Visual Studio version! Only the versions between 2017 and 2019 (inclusive) are supported! The nvcc flag '-allow-unsupported-compiler' can be used to override this version check; however, using an unsupported host compiler may cause compilation failure or incorrect run time execution. Use at your own risk. error: command 'C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.3\bin\nvcc.exe' failed with exit code 2

This is my error message from cmd...!

How can I solve it?

you can try it

Hi @dopeornope-Lee as stated in the error message, it looks like your Microsoft Visual Studio is not supported, please install 2017 or 2019