kaolin: [Windows] cl fails with exit code 2

Hi! I have been trying to compile on windows with the following system information:

nvcc version

PS C:\users\{OMITTED}\Downloads\kaolin-0.1\kaolin-0.1> nvcc --version
nvcc: NVIDIA (R) Cuda compiler driver
Copyright (c) 2005-2020 NVIDIA Corporation
Built on Tue_Sep_15_19:12:04_Pacific_Daylight_Time_2020
Cuda compilation tools, release 11.1, V11.1.74
Build cuda_11.1.relgpu_drvr455TC455_06.29069683_0
PS C:\users\{OMITTED}\Downloads\kaolin-0.1\kaolin-0.1>

python version:

PS C:\users\{OMITTED}\Downloads\kaolin-0.1\kaolin-0.1> python --version
Python 3.6.7

and cude version:

>>> import torch
>>> torch.version.cuda
'11.1'
>>>

the error logs when I run python setup.py develop is failing with exit code 2 on cl binary cl is set on my env variable as: C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.33.31629\bin\Hostx64\x64\cl.exe

The error logs are as follows:

PS C:\users\keert\Downloads\kaolin-0.1\kaolin-0.1> python setup.py develop
C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.1 cuda home
WARNING - Kaolin is tested with PyTorch >=1.2.0, <1.5.0 Found version 1.9.1+cu111 instead.
WARNING - Kaolin is tested with torchvision >=0.4.0, <0.6.0 Found version 0.10.1+cu111 instead.
Building nv-usd...
'.' is not recognized as an internal or external command,
operable program or batch file.
running develop
Checking .pth file support in C:\Users\keert\AppData\Local\Programs\Python\Python36\Lib\site-packages\
C:\Users\keert\AppData\Local\Programs\Python\Python36\pythonw.exe -E -c pass
TEST PASSED: C:\Users\keert\AppData\Local\Programs\Python\Python36\Lib\site-packages\ appears to support .pth files
running egg_info
writing kaolin.egg-info\PKG-INFO
writing dependency_links to kaolin.egg-info\dependency_links.txt
writing requirements to kaolin.egg-info\requires.txt
writing top-level names to kaolin.egg-info\top_level.txt
reading manifest file 'kaolin.egg-info\SOURCES.txt'
writing manifest file 'kaolin.egg-info\SOURCES.txt'
running build_ext
C:\Users\keert\AppData\Local\Programs\Python\Python36\lib\site-packages\torch\utils\cpp_extension.py:306: UserWarning: Error checking compiler version for cl: Command 'cl' returned non-zero exit status 2.
  warnings.warn(f'Error checking compiler version for {compiler}: {error}')
building 'kaolin.cuda.load_textures' extension
C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.33.31629\bin\HostX86\x64\cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MT -IC:\Users\keert\AppData\Local\Programs\Python\Python36\lib\site-packages\torch\include -IC:\Users\keert\AppData\Local\Programs\Python\Python36\lib\site-packages\torch\include\torch\csrc\api\include -IC:\Users\keert\AppData\Local\Programs\Python\Python36\lib\site-packages\torch\include\TH -IC:\Users\keert\AppData\Local\Programs\Python\Python36\lib\site-packages\torch\include\THC "-IC:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.1\include" -IC:\Users\keert\AppData\Local\Programs\Python\Python36\lib\site-packages\numpy\core\include -IC:\Users\keert\AppData\Local\Programs\Python\Python36\include -IC:\Users\keert\AppData\Local\Programs\Python\Python36\include -IC:\Users\keert\AppData\Local\Programs\Python\Python36\include -IC:\Users\keert\AppData\Local\Programs\Python\Python36\include "-IC:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.33.31629\include" "-IC:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.33.31629\ATLMFC\include" "-IC:\Program Files\Microsoft Visual Studio\2022\Community\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" /EHsc /Tpkaolin/cuda/load_textures_cuda.cpp /Fobuild\temp.win-amd64-3.6\Release\kaolin/cuda/load_textures_cuda.obj /MD /wd4819 /wd4251 /wd4244 /wd4267 /wd4275 /wd4018 /wd4190 /EHsc -DTORCH_API_INCLUDE_EXTENSION_H -DTORCH_EXTENSION_NAME=load_textures -D_GLIBCXX_USE_CXX11_ABI=0
cl : Command line warning D9025 : overriding '/MT' with '/MD'
cl : Command line warning D9024 : unrecognized source file type 'C:\Program', object file assumed
cl : Command line warning D9027 : source file 'C:\Program' ignored
cl : Command line warning D9024 : unrecognized source file type 'Files\Microsoft', object file assumed
cl : Command line warning D9027 : source file 'Files\Microsoft' ignored
cl : Command line warning D9024 : unrecognized source file type 'Visual', object file assumed
cl : Command line warning D9027 : source file 'Visual' ignored
cl : Command line warning D9024 : unrecognized source file type 'Studio\2022\Community\VC\Tools\MSVC\14.33.31629\bin\Hostx64\x64\cl.exe', object file assumed
cl : Command line warning D9027 : source file 'Studio\2022\Community\VC\Tools\MSVC\14.33.31629\bin\Hostx64\x64\cl.exe' ignored
load_textures_cuda.cpp
C:\Users\keert\AppData\Local\Programs\Python\Python36\lib\site-packages\torch\include\c10/util/Optional.h(183): warning C4624: 'c10::constexpr_storage_t<T>': destructor was implicitly defined as deleted
        with
        [
            T=at::Tensor
        ]
C:\Users\keert\AppData\Local\Programs\Python\Python36\lib\site-packages\torch\include\c10/util/Optional.h(367): note: see reference to class template instantiation 'c10::constexpr_storage_t<T>' being compiled
        with
        [
            T=at::Tensor
        ]
C:\Users\keert\AppData\Local\Programs\Python\Python36\lib\site-packages\torch\include\c10/util/Optional.h(427): note: see reference to class template instantiation 'c10::trivially_copyable_optimization_optional_base<T>' being compiled
        with
        [
            T=at::Tensor
        ]
C:\Users\keert\AppData\Local\Programs\Python\Python36\lib\site-packages\torch\include\c10/util/Optional.h(427): note: see reference to alias template instantiation 'c10::OptionalBase<T>' being compiled
        with
        [
            T=at::Tensor
        ]
C:\Users\keert\AppData\Local\Programs\Python\Python36\lib\site-packages\torch\include\ATen/core/TensorBody.h(734): note: see reference to class template instantiation 'c10::optional<at::Tensor>' being compiled
C:\Users\keert\AppData\Local\Programs\Python\Python36\lib\site-packages\torch\include\c10/util/Optional.h(395): warning C4624: 'c10::trivially_copyable_optimization_optional_base<T>': destructor was implicitly defined as deleted
        with
        [
            T=at::Tensor
        ]
C:\Users\keert\AppData\Local\Programs\Python\Python36\lib\site-packages\torch\include\c10/util/Optional.h(183): warning C4624: 'c10::constexpr_storage_t<T>': destructor was implicitly defined as deleted
        with
        [
            T=at::Generator
        ]
C:\Users\keert\AppData\Local\Programs\Python\Python36\lib\site-packages\torch\include\c10/util/Optional.h(367): note: see reference to class template instantiation 'c10::constexpr_storage_t<T>' being compiled
        with
        [
            T=at::Generator
        ]
C:\Users\keert\AppData\Local\Programs\Python\Python36\lib\site-packages\torch\include\c10/util/Optional.h(427): note: see reference to class template instantiation 'c10::trivially_copyable_optimization_optional_base<T>' being compiled
        with
        [
            T=at::Generator
        ]
C:\Users\keert\AppData\Local\Programs\Python\Python36\lib\site-packages\torch\include\c10/util/Optional.h(427): note: see reference to alias template instantiation 'c10::OptionalBase<T>' being compiled
        with
        [
            T=at::Generator
        ]
...
...
...
...
...        with
        [
            T=std::vector<at::Tensor,std::allocator<at::Tensor>>
        ]
C:\Users\keert\AppData\Local\Programs\Python\Python36\lib\site-packages\torch\include\pybind11\detail/common.h(108): warning C4005: 'HAVE_SNPRINTF': macro redefinition
C:\Users\keert\AppData\Local\Programs\Python\Python36\include\pyerrors.h(489): note: see previous definition of 'HAVE_SNPRINTF'
kaolin/cuda/load_textures_cuda.cpp(46): warning C4996: 'at::Tensor::type': Tensor.type() is deprecated. Instead use Tensor.options(), which in many cases (e.g. in a constructor) is a drop-in replacement. If you were using data from type(), that is now available from Tensor itself, so instead of tensor.type().scalar_type(), use tensor.scalar_type() instead and instead of tensor.type().backend() use tensor.device().
kaolin/cuda/load_textures_cuda.cpp(47): warning C4996: 'at::Tensor::type': Tensor.type() is deprecated. Instead use Tensor.options(), which in many cases (e.g. in a constructor) is a drop-in replacement. If you were using data from type(), that is now available from Tensor itself, so instead of tensor.type().scalar_type(), use tensor.scalar_type() instead and instead of tensor.type().backend() use tensor.device().
kaolin/cuda/load_textures_cuda.cpp(48): warning C4996: 'at::Tensor::type': Tensor.type() is deprecated. Instead use Tensor.options(), which in many cases (e.g. in a constructor) is a drop-in replacement. If you were using data from type(), that is now available from Tensor itself, so instead of tensor.type().scalar_type(), use tensor.scalar_type() instead and instead of tensor.type().backend() use tensor.device().
kaolin/cuda/load_textures_cuda.cpp(49): warning C4996: 'at::Tensor::type': Tensor.type() is deprecated. Instead use Tensor.options(), which in many cases (e.g. in a constructor) is a drop-in replacement. If you were using data from type(), that is now available from Tensor itself, so instead of tensor.type().scalar_type(), use tensor.scalar_type() instead and instead of tensor.type().backend() use tensor.device().
C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.1\bin\nvcc.exe -c kaolin/cuda/load_textures_cuda_kernel.cu -o build\temp.win-amd64-3.6\Release\kaolin/cuda/load_textures_cuda_kernel.obj -IC:\Users\keert\AppData\Local\Programs\Python\Python36\lib\site-packages\torch\include -IC:\Users\keert\AppData\Local\Programs\Python\Python36\lib\site-packages\torch\include\torch\csrc\api\include -IC:\Users\keert\AppData\Local\Programs\Python\Python36\lib\site-packages\torch\include\TH -IC:\Users\keert\AppData\Local\Programs\Python\Python36\lib\site-packages\torch\include\THC "-IC:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.1\include" -IC:\Users\keert\AppData\Local\Programs\Python\Python36\lib\site-packages\numpy\core\include -IC:\Users\keert\AppData\Local\Programs\Python\Python36\include -IC:\Users\keert\AppData\Local\Programs\Python\Python36\include -IC:\Users\keert\AppData\Local\Programs\Python\Python36\include -IC:\Users\keert\AppData\Local\Programs\Python\Python36\include "-IC:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.33.31629\include" "-IC:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.33.31629\ATLMFC\include" "-IC:\Program Files\Microsoft Visual Studio\2022\Community\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" -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 -DTORCH_API_INCLUDE_EXTENSION_H -DTORCH_EXTENSION_NAME=load_textures -D_GLIBCXX_USE_CXX11_ABI=0 -gencode=arch=compute_86,code=compute_86 -gencode=arch=compute_86,code=sm_86 --use-local-env
error: command 'C:\\Program Files\\NVIDIA GPU Computing Toolkit\\CUDA\\v11.1\\bin\\nvcc.exe' failed with exit status 2

Would really appreciate some help on this! Thanks

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Comments: 26

Most upvoted comments

Neat! The docker file provided me with the exact libraries which I needed. I finally got it working 🥳 , one more bug I had in my setup was that I naively set the cl env variable to the cl location, but on windows … setting the cl env variable passes the value as flags to cl (wtf??). Once I resolved that, it installed and worked. Thank you so much for your help on this @Caenorst

Hi @theskcd , we just merged our Windows CI configs, you can see the dockerfile here: https://github.com/NVIDIAGameWorks/kaolin/blob/master/tools/windows/Dockerfile Hopefully that can help you getting a cleaner starting point

Where have you done this flag modification? I think we need general help on windows + pytorch, I don’t think this is because Kaolin’s setup at that point

I just realized that you are trying to install kaolin v0.1. This version is not maintained now, especially for windows it’s gonna be complicated, I suggest maybe trying to downgrad MSVC?

You might want to try some of solutions suggested by googling "checking compiler version for cl" msvc 2022. Why do you want to use Kaolin v0.1? latest Kaolin versions have way better support across pytorch / python / cuda versions

Hi @theskcd , This seems to be pytorch specific, after looking a bit online, try after pip install ninja.