nerfstudio-project / nerfstudio

A collaboration friendly studio for NeRFs
https://docs.nerf.studio
Apache License 2.0
9.33k stars 1.26k forks source link

Failed to Install 'gsplat' from source #3284

Open RJ1227 opened 2 months ago

RJ1227 commented 2 months ago

C:\Users\rishu.conda\envs\nerfstudio\lib\site-packages\torch\utils\cpp_extension.py:383: UserWarning: Error checking compiler version for cl: [WinError 2] The system cannot find the file specified warnings.warn(f'Error checking compiler version for {compiler}: {error}') building 'gsplat.csrc_legacy' extension creating build\temp.win-amd64-cpython-38 creating build\temp.win-amd64-cpython-38\Release creating build\temp.win-amd64-cpython-38\Release\gsplat creating build\temp.win-amd64-cpython-38\Release\gsplat\cuda_legacy creating build\temp.win-amd64-cpython-38\Release\gsplat\cuda_legacy\csrc "C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.8\bin\nvcc" -c gsplat\cuda_legacy\csrc\backward.cu -o build\temp.win-amd64-cpython-38\Release\gsplat\cuda_legacy\csrc\backward.obj -Igsplat\cuda\csrc -IC:\Users\rishu.conda\envs\nerfstudio\lib\site-packages\torch\include -IC:\Users\rishu.conda\envs\nerfstudio\lib\site-packages\torch\include\torch\csrc\api\include -IC:\Users\rishu.conda\envs\nerfstudio\lib\site-packages\torch\include\TH -IC:\Users\rishu.conda\envs\nerfstudio\lib\site-packages\torch\include\THC "-IC:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.8\include" -IC:\Users\rishu.conda\envs\nerfstudio\include -IC:\Users\rishu.conda\envs\nerfstudio\Include "-IC:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.40.33807\include" "-IC:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.40.33807\ATLMFC\include" "-IC:\Program Files\Microsoft Visual Studio\2022\Community\VC\Auxiliary\VS\include" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.22621.0\ucrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.22621.0\um" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.22621.0\shared" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.22621.0\winrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.22621.0\cppwinrt" "-IC:\Program Files (x86)\Windows Kits\NETFXSDK\4.8\include\um" -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 /wd4068 -Xcompiler /wd4067 -Xcompiler /wd4624 -Xcompiler /wd4190 -Xcompiler /wd4018 -Xcompiler /wd4275 -Xcompiler /wd4267 -Xcompiler /wd4244 -Xcompiler /wd4251 -Xcompiler /wd4819 -Xcompiler /MD -DCUDA_NO_HALF_OPERATORS -DCUDA_NO_HALF_CONVERSIONS -DCUDA_NO_BFLOAT16_CONVERSIONS -DCUDA_NO_HALF2_OPERATORS --expt-relaxed-constexpr -O3 --use_fast_math --expt-relaxed-constexpr -DWIN32_LEAN_AND_MEAN -DTORCH_API_INCLUDE_EXTENSION_H -DTORCH_EXTENSION_NAME=csrc_legacy -D_GLIBCXX_USE_CXX11_ABI=0 -gencode=arch=compute_89,code=compute_89 -gencode=arch=compute_89,code=sm_89 -std=c++17 --use-local-env C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.8\include\crt/host_config.h(153): fatal error C1189: #error: -- unsupported Microsoft Visual Studio version! Only the versions between 2017 and 2022 (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. backward.cu error: command 'C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.8\bin\nvcc.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 gsplat Running setup.py clean for gsplat Failed to build gsplat ERROR: ERROR: Failed to build installable wheels for some pyproject.toml based projects (gsplat)

jkulhanek commented 2 months ago

Have you followed the Win install guide: https://github.com/nerfstudio-project/gsplat/blob/main/docs/INSTALL_WIN.md ?

RJ1227 commented 2 months ago

Have you followed the Win install guide: https://github.com/nerfstudio-project/gsplat/blob/main/docs/INSTALL_WIN.md ? This I have already tried but that did not resolve the issue. The torch bindings for tiny-cuda-nn are not installing, and an error occurs during the installation process. I've installed VS Community 2022, but the problem still persists. I don't understand what the issue is.

RJ1227 commented 2 months ago
image
DuVogel87 commented 1 month ago

How did you solve it?

RJ1227 commented 1 month ago

I solved the issue for Windows. First, download Visual Studio 2022 with the following configuration. image Please, make sure that you have already installed colmap and ffmpeg and added them to your environment variable path.

You also need to install the Cuda toolkit; I used Cuda 12.1 for mine. Additionally, add C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.29.30133\bin\HostX64\x64 to your path in the environment variable.

Next, go to notepad, run it as an administrator, and open the file "yourcudatoolkitdir\CUDA\v12.1\include\crt\host_config.h". Then, replace the code:

if _MSC_VER < 1910 || _MSC_VER >= 1910

error -- unsupported Microsoft Visual Studio version! Only the versions between 2017 and 2022 (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.

elif _MSC_VER >= 1910 && _MSC_VER < 1910

with:

if _MSC_VER < 1910 || _MSC_VER >= 2940

error -- unsupported Microsoft Visual Studio version! Only the versions between 2017 and 2022 (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.

elif _MSC_VER >= 1910 && _MSC_VER < 1910

Save the file.

Now Install Nerfstudio, but remember to install all the PyTorch, which is compatible with Cuda 12.1 .

williefalloon commented 1 month ago

Hey, facing this same issue but having some trouble replicating your fix. Did/do you also have Build Tools 2022 installed? Any specific requirements for the installation there?

RJ1227 commented 1 month ago

I solved the issue for Windows. First, download Visual Studio 2022 with the following configuration. image Please, make sure that you have already installed colmap and ffmpeg and added them to your environment variable path.

You also need to install the Cuda toolkit; I used Cuda 12.1 for mine. Additionally, add C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.29.30133\bin\HostX64\x64 to your path in the environment variable.

Next, go to notepad, run it as an administrator, and open the file "yourcudatoolkitdir\CUDA\v12.1\include\crt\host_config.h". Then, replace the code:

if _MSC_VER < 1910 || _MSC_VER >= 1910

error -- unsupported Microsoft Visual Studio version! Only the versions between 2017 and 2022 (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.

elif _MSC_VER >= 1910 && _MSC_VER < 1910

with:

if _MSC_VER < 1910 || _MSC_VER >= 2940

error -- unsupported Microsoft Visual Studio version! Only the versions between 2017 and 2022 (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.

elif _MSC_VER >= 1910 && _MSC_VER < 1910

Save the file.

Now Install Nerfstudio, but remember to install all the PyTorch, which is compatible with Cuda 12.1 .

Yes, I have installed the 2022 and 2019 build tools, as shown in the picture. Use this for PyTorch. https://pytorch.org/get-started/previous-versions/ Also, download the 12.1 toolkit in the Conda environment as well.