nerfstudio icon indicating copy to clipboard operation
nerfstudio copied to clipboard

math.h not found while executing "pip install git+https://github.com/NVlabs/tiny-cuda-nn/#subdirectory=bindings/torch"

Open SvenFlock opened this issue 1 year ago • 1 comments

Describe the bug As title says "pip install git+https://github.com/NVlabs/tiny-cuda-nn/#subdirectory=bindings/torch" errors with not finding math.h (see below).

Is there an easy solution to fix that? Just write what you need for logs and other files and I am happy to provide them.

Thanks!

Steps to reproduce the behavior:

  1. Install Visual Studio 2022 Community Edition
  2. Install CUDA 11.7
  3. Follow the installation tutorial for nerfstudio
  4. error occurs during pip install git+https://github.com/NVlabs/tiny-cuda-nn/#subdirectory=bindings/torch

Expected behavior pip should finish without any errors

Output from console

`(nerfstudio) C:\Users\svenf>pip install git+https://github.com/NVlabs/tiny-cuda-nn/#subdirectory=bindings/torch Collecting git+https://github.com/NVlabs/tiny-cuda-nn/#subdirectory=bindings/torch Cloning https://github.com/NVlabs/tiny-cuda-nn/ to c:\users\svenf\appdata\local\temp\pip-req-build-nnrc7hfw Running command git clone --filter=blob:none --quiet https://github.com/NVlabs/tiny-cuda-nn/ 'C:\Users\svenf\AppData\Local\Temp\pip-req-build-nnrc7hfw' Resolved https://github.com/NVlabs/tiny-cuda-nn/ to commit 14053e9a87ebf449d32bda335c0363dd4f5667a4 Running command git submodule update --init --recursive -q Preparing metadata (setup.py) ... done Building wheels for collected packages: tinycudann Building wheel for tinycudann (setup.py) ... error error: subprocess-exited-with-error

× python setup.py bdist_wheel did not run successfully. │ exit code: 1 ╰─> [36 lines of output] Building PyTorch extension for tiny-cuda-nn version 1.7 Obtained compute capability 86 from PyTorch running bdist_wheel C:\Users\svenf\anaconda3\envs\nerfstudio\lib\site-packages\torch\utils\cpp_extension.py:411: UserWarning: Attempted to use ninja as the BuildExtension backend but we could not find ninja.. Falling back to using the slow distutils backend. warnings.warn(msg.format('we could not find ninja.')) running build running build_py creating build creating build\lib.win-amd64-cpython-310 creating build\lib.win-amd64-cpython-310\tinycudann copying tinycudann\modules.py -> build\lib.win-amd64-cpython-310\tinycudann copying tinycudann_init_.py -> build\lib.win-amd64-cpython-310\tinycudann running egg_info creating tinycudann.egg-info writing tinycudann.egg-info\PKG-INFO writing dependency_links to tinycudann.egg-info\dependency_links.txt writing top-level names to tinycudann.egg-info\top_level.txt writing manifest file 'tinycudann.egg-info\SOURCES.txt' reading manifest file 'tinycudann.egg-info\SOURCES.txt' writing manifest file 'tinycudann.egg-info\SOURCES.txt' copying tinycudann\bindings.cpp -> build\lib.win-amd64-cpython-310\tinycudann running build_ext C:\Users\svenf\anaconda3\envs\nerfstudio\lib\site-packages\torch\utils\cpp_extension.py:813: UserWarning: The detected CUDA version (11.7) has a minor version mismatch with the version that was used to compile PyTorch (11.3). Most likely this shouldn't be a problem. warnings.warn(CUDA_MISMATCH_WARN.format(cuda_str_version, torch.version.cuda)) building 'tinycudann_bindings_86._C' extension creating build\dependencies creating build\dependencies\fmt creating build\dependencies\fmt\src creating build\src creating build\temp.win-amd64-cpython-310 creating build\temp.win-amd64-cpython-310\Release creating build\temp.win-amd64-cpython-310\Release\tinycudann "C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.34.31933\bin\HostX86\x64\cl.exe" /c /nologo /O2 /W3 /GL /DNDEBUG /MD -IC:\Users\svenf\AppData\Local\Temp\pip-req-build-nnrc7hfw/include -IC:\Users\svenf\AppData\Local\Temp\pip-req-build-nnrc7hfw/dependencies -IC:\Users\svenf\AppData\Local\Temp\pip-req-build-nnrc7hfw/dependencies/cutlass/include -IC:\Users\svenf\AppData\Local\Temp\pip-req-build-nnrc7hfw/dependencies/cutlass/tools/util/include -IC:\Users\svenf\AppData\Local\Temp\pip-req-build-nnrc7hfw/dependencies/fmt/include -IC:\Users\svenf\anaconda3\envs\nerfstudio\lib\site-packages\torch\include -IC:\Users\svenf\anaconda3\envs\nerfstudio\lib\site-packages\torch\include\torch\csrc\api\include -IC:\Users\svenf\anaconda3\envs\nerfstudio\lib\site-packages\torch\include\TH -IC:\Users\svenf\anaconda3\envs\nerfstudio\lib\site-packages\torch\include\THC "-IC:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.7\include" -IC:\Users\svenf\anaconda3\envs\nerfstudio\include -IC:\Users\svenf\anaconda3\envs\nerfstudio\Include "-IC:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.34.31933\include" "-IC:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.34.31933\ATLMFC\include" "-IC:\Program Files\Microsoft Visual Studio\2022\Community\VC\Auxiliary\VS\include" "-IC:\Program Files (x86)\Windows Kits\NETFXSDK\4.8\include\um" /EHsc /Tp../../dependencies/fmt/src/format.cc /Fobuild\temp.win-amd64-cpython-310\Release../../dependencies/fmt/src/format.obj /MD /wd4819 /wd4251 /wd4244 /wd4267 /wd4275 /wd4018 /wd4190 /EHsc /std:c++14 -DTCNN_MIN_GPU_ARCH=86 -DTORCH_API_INCLUDE_EXTENSION_H -DTORCH_EXTENSION_NAME=_C -D_GLIBCXX_USE_CXX11_ABI=0 format.cc C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.34.31933\include\cstdlib(12): fatal error C1083: Cannot open include file: 'math.h': No such file or directory error: command 'C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.34.31933\bin\HostX86\x64\cl.exe' failed with exit code 2 [end of output]

note: This error originates from a subprocess, and is likely not a problem with pip. ERROR: Failed building wheel for tinycudann Running setup.py clean for tinycudann Failed to build tinycudann Installing collected packages: tinycudann Running setup.py install for tinycudann ... error error: subprocess-exited-with-error

× Running setup.py install for tinycudann did not run successfully. │ exit code: 1 ╰─> [23 lines of output] Building PyTorch extension for tiny-cuda-nn version 1.7 Obtained compute capability 86 from PyTorch running install C:\Users\svenf\anaconda3\envs\nerfstudio\lib\site-packages\setuptools\command\install.py:34: SetuptoolsDeprecationWarning: setup.py install is deprecated. Use build and pip and other standards-based tools. warnings.warn( running build running build_py running egg_info writing tinycudann.egg-info\PKG-INFO writing dependency_links to tinycudann.egg-info\dependency_links.txt writing top-level names to tinycudann.egg-info\top_level.txt C:\Users\svenf\anaconda3\envs\nerfstudio\lib\site-packages\torch\utils\cpp_extension.py:411: UserWarning: Attempted to use ninja as the BuildExtension backend but we could not find ninja.. Falling back to using the slow distutils backend. warnings.warn(msg.format('we could not find ninja.')) reading manifest file 'tinycudann.egg-info\SOURCES.txt' writing manifest file 'tinycudann.egg-info\SOURCES.txt' running build_ext C:\Users\svenf\anaconda3\envs\nerfstudio\lib\site-packages\torch\utils\cpp_extension.py:813: UserWarning: The detected CUDA version (11.7) has a minor version mismatch with the version that was used to compile PyTorch (11.3). Most likely this shouldn't be a problem. warnings.warn(CUDA_MISMATCH_WARN.format(cuda_str_version, torch.version.cuda)) building 'tinycudann_bindings_86._C' extension "C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.34.31933\bin\HostX86\x64\cl.exe" /c /nologo /O2 /W3 /GL /DNDEBUG /MD -IC:\Users\svenf\AppData\Local\Temp\pip-req-build-nnrc7hfw/include -IC:\Users\svenf\AppData\Local\Temp\pip-req-build-nnrc7hfw/dependencies -IC:\Users\svenf\AppData\Local\Temp\pip-req-build-nnrc7hfw/dependencies/cutlass/include -IC:\Users\svenf\AppData\Local\Temp\pip-req-build-nnrc7hfw/dependencies/cutlass/tools/util/include -IC:\Users\svenf\AppData\Local\Temp\pip-req-build-nnrc7hfw/dependencies/fmt/include -IC:\Users\svenf\anaconda3\envs\nerfstudio\lib\site-packages\torch\include -IC:\Users\svenf\anaconda3\envs\nerfstudio\lib\site-packages\torch\include\torch\csrc\api\include -IC:\Users\svenf\anaconda3\envs\nerfstudio\lib\site-packages\torch\include\TH -IC:\Users\svenf\anaconda3\envs\nerfstudio\lib\site-packages\torch\include\THC "-IC:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.7\include" -IC:\Users\svenf\anaconda3\envs\nerfstudio\include -IC:\Users\svenf\anaconda3\envs\nerfstudio\Include "-IC:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.34.31933\include" "-IC:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.34.31933\ATLMFC\include" "-IC:\Program Files\Microsoft Visual Studio\2022\Community\VC\Auxiliary\VS\include" "-IC:\Program Files (x86)\Windows Kits\NETFXSDK\4.8\include\um" /EHsc /Tp../../dependencies/fmt/src/format.cc /Fobuild\temp.win-amd64-cpython-310\Release../../dependencies/fmt/src/format.obj /MD /wd4819 /wd4251 /wd4244 /wd4267 /wd4275 /wd4018 /wd4190 /EHsc /std:c++14 -DTCNN_MIN_GPU_ARCH=86 -DTORCH_API_INCLUDE_EXTENSION_H -DTORCH_EXTENSION_NAME=_C -D_GLIBCXX_USE_CXX11_ABI=0 format.cc C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.34.31933\include\cstdlib(12): fatal error C1083: Cannot open include file: 'math.h': No such file or directory error: command 'C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.34.31933\bin\HostX86\x64\cl.exe' failed with exit code 2 [end of output]

note: This error originates from a subprocess, and is likely not a problem with pip. error: legacy-install-failure

× Encountered error while trying to install package. ╰─> tinycudann

note: This is an issue with the package mentioned above, not pip. hint: See above for output from the failure.

(nerfstudio) C:\Users\svenf>`

SvenFlock avatar Jan 06 '23 17:01 SvenFlock

Some users have reported issues using TCNN with visual studio 2022. People have had better luck with the 2019 version.

tancik avatar Jan 07 '23 03:01 tancik

Closing. Feel free to reopen if needed.

tancik avatar Feb 22 '23 18:02 tancik