graphdeco-inria / gaussian-splatting

Original reference implementation of "3D Gaussian Splatting for Real-Time Radiance Field Rendering"
https://repo-sam.inria.fr/fungraph/3d-gaussian-splatting/
Other
13.63k stars 1.76k forks source link

Failed to build diff_gaussian_rasterization #912

Open guevara12345 opened 1 month ago

guevara12345 commented 1 month ago
  1. I have already install pytorch and cuda 11.6 as environment.yml says, but I used the vs studio 2022.
  2. I have use the miniconda to activate the env, and here comes the error as below.
  3. I trying to find where this error happens, and I find this happen when conda tries to build c++ extention for pytorch.
  4. so I try to build the diff-gaussian-rasterization by myself. cd to /gaussian-splatting/submodules/diff-gaussian-rasterization, then run pip install .
  5. same error happen as below, and I think this error message says that backward.obj is not been build. and I don't know why cl build this the backward.cu fail, and there is not futher more info,will change to vs studio 2019 helps?

Processing e:\my_proj\gaussian-splatting\submodules\diff-gaussian-rasterization Preparing metadata (setup.py) ... done Building wheels for collected packages: diff_gaussian_rasterization Building wheel for diff_gaussian_rasterization (setup.py) ... error error: subprocess-exited-with-error

× python setup.py bdist_wheel did not run successfully. │ exit code: 1 ╰─> [19 lines of output] running bdist_wheel running build running build_py creating build creating build\lib.win-amd64-cpython-37 creating build\lib.win-amd64-cpython-37\diff_gaussian_rasterization copying diff_gaussian_rasterization__init__.py -> build\lib.win-amd64-cpython-37\diff_gaussian_rasterization running build_ext building 'diff_gaussian_rasterization._C' extension creating E:\my_proj\gaussian-splatting\submodules\diff-gaussian-rasterization\build\temp.win-amd64-cpython-37 creating E:\my_proj\gaussian-splatting\submodules\diff-gaussian-rasterization\build\temp.win-amd64-cpython-37\Release creating E:\my_proj\gaussian-splatting\submodules\diff-gaussian-rasterization\build\temp.win-amd64-cpython-37\Release\cuda_rasterizer Emitting ninja build file E:\my_proj\gaussian-splatting\submodules\diff-gaussian-rasterization\build\temp.win-amd64-cpython-37\Release\build.ninja... Compiling objects... Allowing ninja to set a default number of workers... (overridable by setting the environment variable MAX_JOBS=N) 1.11.1.git.kitware.jobserver-1 "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Tools\MSVC\14.40.33807\bin\HostX86\x64\link.exe" /nologo /INCREMENTAL:NO /LTCG /DLL /MANIFEST:EMBED,ID=2 /MANIFESTUAC:NO /LIBPATH:G:\ProgramData\miniconda3\envs\gaussian_splatting\lib\site-packages\torch\lib "/LIBPATH:C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.6\lib/x64" /LIBPATH:G:\ProgramData\miniconda3\envs\gaussian_splatting\libs /LIBPATH:G:\ProgramData\miniconda3\envs\gaussian_splatting /LIBPATH:G:\ProgramData\miniconda3\envs\gaussian_splatting\PCbuild\amd64 "/LIBPATH:C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Tools\MSVC\14.40.33807\ATLMFC\lib\x64" "/LIBPATH:C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Tools\MSVC\14.40.33807\lib\x64" "/LIBPATH:C:\Program Files (x86)\Windows Kits\NETFXSDK\4.8\lib\um\x64" "/LIBPATH:C:\Program Files (x86)\Windows Kits\10\lib\10.0.22621.0\ucrt\x64" "/LIBPATH:C:\Program Files (x86)\Windows Kits\10\lib\10.0.22621.0\um\x64" c10.lib torch.lib torch_cpu.lib torch_python.lib cudart.lib c10_cuda.lib torch_cuda_cu.lib torch_cuda_cpp.lib /EXPORT:PyInit__C E:\my_proj\gaussian-splatting\submodules\diff-gaussian-rasterization\build\temp.win-amd64-cpython-37\Release\cuda_rasterizer/backward.obj E:\my_proj\gaussian-splatting\submodules\diff-gaussian-rasterization\build\temp.win-amd64-cpython-37\Release\cuda_rasterizer/forward.obj E:\my_proj\gaussian-splatting\submodules\diff-gaussian-rasterization\build\temp.win-amd64-cpython-37\Release\cuda_rasterizer/rasterizer_impl.obj E:\my_proj\gaussian-splatting\submodules\diff-gaussian-rasterization\build\temp.win-amd64-cpython-37\Release\ext.obj E:\my_proj\gaussian-splatting\submodules\diff-gaussian-rasterization\build\temp.win-amd64-cpython-37\Release\rasterize_points.obj /OUT:build\lib.win-amd64-cpython-37\diff_gaussian_rasterization_C.cp37-win_amd64.pyd /IMPLIB:E:\my_proj\gaussian-splatting\submodules\diff-gaussian-rasterization\build\temp.win-amd64-cpython-37\Release\cuda_rasterizer_C.cp37-win_amd64.lib LINK : fatal error LNK1181: 无法打开输入文件“E:\my_proj\gaussian-splatting\submodules\diff-gaussian-rasterization\build\temp.win-amd64-cpython-37\Release\cuda_rasterizer\backward.obj” error: command 'C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Tools\MSVC\14.40.33807\bin\HostX86\x64\link.exe' failed with exit code 1181 [end of output]

note: This error originates from a subprocess, and is likely not a problem with pip. ERROR: Failed building wheel for diff_gaussian_rasterization Running setup.py clean for diff_gaussian_rasterization Failed to build diff_gaussian_rasterization ERROR: Could not build wheels for diff_gaussian_rasterization, which is required to install pyproject.toml-based projects

fuzesmarcell commented 1 month ago

I doubt this would be fixed by using vs studio 2019

The linker error is https://learn.microsoft.com/en-us/cpp/error-messages/tool-errors/linker-tools-error-lnk1181?view=msvc-170 which means cannot open input file 'filename'.

Do you see that backward.obj is created in the following path?

"E:\my_proj\gaussian-splatting\submodules\diff-gaussian-rasterization\build\temp.win-amd64-cpython-37\Release\cuda_rasterizer\backward.obj"

Also it seems a bit strange that it has some uni-code characters before the path in the link:

LINK : fatal error LNK1181: 无法打开输入文件“E:\my_proj\gaussian-splatting\submodules\diff-gaussian-rasterization\build\temp.win-amd64-cpython-37\Release\cuda_rasterizer\backward.obj”
guevara12345 commented 1 month ago

thanks,I solve this problem by install cuda before vs 2022. but I got some new troble to build diff_gaussian_rasterization: https://forums.developer.nvidia.com/t/problems-with-latest-vs2022-update/294150 still trying to find out the solution