NVlabs / tiny-cuda-nn

Lightning fast C++/CUDA neural network framework
Other
3.65k stars 449 forks source link

Can't install tiny-cuda-nn #440

Open s1eeveW opened 3 months ago

s1eeveW commented 3 months ago

The error is that:

(nerfstudio) E:>pip install ninja 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\24252\appdata\local\temp\pip-req-build-tcaxpakb Running command git clone --filter=blob:none --quiet https://github.com/NVlabs/tiny-cuda-nn/ 'C:\Users\24252\AppData\Local\Temp\pip-req-build-tcaxpakb' Resolved https://github.com/NVlabs/tiny-cuda-nn/ to commit 4892659e015b12bd2fce446b8a8e33e646b21746 Running command git submodule update --init --recursive -q Preparing metadata (setup.py) ... done Collecting ninja Using cached ninja-1.11.1.1-py2.py3-none-win_amd64.whl.metadata (5.4 kB) Using cached ninja-1.11.1.1-py2.py3-none-win_amd64.whl (312 kB) 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 ╰─> [43 lines of output] C:\Users\24252\AppData\Local\Temp\pip-req-build-tcaxpakb\bindings/torch\setup.py:5: DeprecationWarning: pkg_resources is deprecated as an API. See https://setuptools.pypa.io/en/latest/pkg_resources.html from pkg_resources import parse_version Building PyTorch extension for tiny-cuda-nn version 1.7 Obtained compute capability 86 from PyTorch nvcc: NVIDIA (R) Cuda compiler driver Copyright (c) 2005-2022 NVIDIA Corporation Built on Wed_Sep_21_10:41:10_Pacific_Daylight_Time_2022 Cuda compilation tools, release 11.8, V11.8.89 Build cuda_11.8.r11.8/compiler.31833905_0 Detected CUDA version 11.8 Targeting C++ standard 17 running bdist_wheel E:\Programming\Anaconda\envs\nerfstudio\lib\site-packages\torch\utils\cpp_extension.py:502: 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-38 creating build\lib.win-amd64-cpython-38\tinycudann copying tinycudann\modules.py -> build\lib.win-amd64-cpython-38\tinycudann copying tinycudann__init__.py -> build\lib.win-amd64-cpython-38\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-38\tinycudann running build_ext 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-38 creating build\temp.win-amd64-cpython-38\Release creating build\temp.win-amd64-cpython-38\Release\tinycudann E:\VS_BuildTool\IDE\VC\Tools\MSVC\14.40.33807\bin\Hostx64\x64\cl.exe /c /nologo /O2 /W3 /GL /DNDEBUG /MD -IC:\Users\24252\AppData\Local\Temp\pip-req-build-tcaxpakb/include -IC:\Users\24252\AppData\Local\Temp\pip-req-build-tcaxpakb/dependencies -IC:\Users\24252\AppData\Local\Temp\pip-req-build-tcaxpakb/dependencies/cutlass/include -IC:\Users\24252\AppData\Local\Temp\pip-req-build-tcaxpakb/dependencies/cutlass/tools/util/include -IC:\Users\24252\AppData\Local\Temp\pip-req-build-tcaxpakb/dependencies/fmt/include -IE:\Programming\Anaconda\envs\nerfstudio\lib\site-packages\torch\include -IE:\Programming\Anaconda\envs\nerfstudio\lib\site-packages\torch\include\torch\csrc\api\include -IE:\Programming\Anaconda\envs\nerfstudio\lib\site-packages\torch\include\TH -IE:\Programming\Anaconda\envs\nerfstudio\lib\site-packages\torch\include\THC "-IC:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.8\include" -IE:\Programming\Anaconda\envs\nerfstudio\include -IE:\Programming\Anaconda\envs\nerfstudio\Include /EHsc /Tp../../dependencies/fmt/src/format.cc /Fobuild\temp.win-amd64-cpython-38\Release../../dependencies/fmt/src/format.obj /MD /wd4819 /wd4251 /wd4244 /wd4267 /wd4275 /wd4018 /wd4190 /wd4624 /wd4067 /wd4068 /EHsc /std:c++17 -DTCNN_PARAMS_UNALIGNED -DTCNN_MIN_GPU_ARCH=86 -DTORCH_API_INCLUDE_EXTENSION_H -DTORCH_EXTENSION_NAME=_86_C -D_GLIBCXX_USE_CXX11_ABI=0 format.cc C:\Users\24252\AppData\Local\Temp\pip-req-build-tcaxpakb/dependencies/fmt/include\fmt/format-inl.h(11): fatal error C1083: Cannot open include file: 'algorithm': No such file or directory error: command 'E:\VS_BuildTool\IDE\VC\Tools\MSVC\14.40.33807\bin\Hostx64\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 ERROR: Could not build wheels for tinycudann, which is required to install pyproject.toml-based projects

My setting is:

(nerfstudio) E:>g++ --version

g++ (MinGW.org GCC-6.3.0-1) 6.3.0 Copyright (C) 2016 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

(nerfstudio) E:>cl Microsoft (R) C/C++ Optimizing Compiler Version 19.40.33808 for x64 Copyright (C) Microsoft Corporation. All rights reserved.

usage: cl [ option... ] filename... [ /link linkoption... ]

(nerfstudio) E:>nvcc -V nvcc: NVIDIA (R) Cuda compiler driver Copyright (c) 2005-2022 NVIDIA Corporation Built on Wed_Sep_21_10:41:10_Pacific_Daylight_Time_2022 Cuda compilation tools, release 11.8, V11.8.89 Build cuda_11.8.r11.8/compiler.31833905_0

Someone can help me? thx~

cogwheel commented 3 months ago

error: command 'E:\VS_BuildTool\IDE\VC\Tools\MSVC\14.40.33807\bin\Hostx64\x64\cl.exe' failed with exit code 2

I think you're on a pretty old visual studio version. NVCC uses MSVC by default. You should upgrade to VS2022 I think.