spla-tam/SplaTAM

Error installing rasterizer [warning: GCC]

gmberton opened this issue · 1 comments

Hi @Nik-V9 great work! I'm getting this issue while installing the requirements.txt with pip install -r requirements.txt, do you know how to fix it?

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                                                                                                                                                                                                                                                                                                             
  ╰─> [33 lines of output]                                                                                                                                                                                                                                                                                                   
      running bdist_wheel                                                                                                                                                                                                                                                                                                    
      /home/gberton/anaconda3/envs/splatam/lib/python3.10/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.linux-x86_64-cpython-310                                                                                                                                                                  
      creating build/lib.linux-x86_64-cpython-310/diff_gaussian_rasterization                                                                                                                                      
      copying diff_gaussian_rasterization/__init__.py -> build/lib.linux-x86_64-cpython-310/diff_gaussian_rasterization                                                                                                                                                         
      running build_ext                                                                                                                                                                                            
      /home/gberton/anaconda3/envs/splatam/lib/python3.10/site-packages/torch/utils/cpp_extension.py:820: UserWarning: There are no g++ version bounds defined for CUDA version 11.6                                                                                            
        warnings.warn(f'There are no {compiler_name} version bounds defined for CUDA version {cuda_str_version}')                                                                                                                                                               
      building 'diff_gaussian_rasterization._C' extension                                                                                                                                                          
      creating build/temp.linux-x86_64-cpython-310                                                                                                                                                                 
      creating build/temp.linux-x86_64-cpython-310/cuda_rasterizer                                                                                                                                                 
      /home/gberton/anaconda3/envs/splatam/bin/nvcc -I/home/gberton/anaconda3/envs/splatam/lib/python3.10/site-packages/torch/include -I/home/gberton/anaconda3/envs/splatam/lib/python3.10/site-packages/torch/include/torch/csrc/api/include -I/home/gberton/anaconda3/envs/splatam/lib/python3.10/site-packages/torch/incl
ude/TH -I/home/gberton/anaconda3/envs/splatam/lib/python3.10/site-packages/torch/include/THC -I/home/gberton/anaconda3/envs/splatam/include -I/home/gberton/anaconda3/envs/splatam/include/python3.10 -c cuda_rasterizer/backward.cu -o build/temp.linux-x86_64-cpython-310/cuda_rasterizer/backward.o -D__CUDA_NO_HALF_OPERA
TORS__ -D__CUDA_NO_HALF_CONVERSIONS__ -D__CUDA_NO_BFLOAT16_CONVERSIONS__ -D__CUDA_NO_HALF2_OPERATORS__ --expt-relaxed-constexpr --compiler-options '-fPIC' -I/tmp/pip-req-build-fzmhzv59/third_party/glm/ -DTORCH_API_INCLUDE_EXTENSION_H -DPYBIND11_COMPILER_TYPE=\"_gcc\" -DPYBIND11_STDLIB=\"_libstdcpp\" -DPYBIND11_BUILD
_ABI=\"_cxxabi1011\" -DTORCH_EXTENSION_NAME=_C -D_GLIBCXX_USE_CXX11_ABI=0 -gencode=arch=compute_86,code=compute_86 -gencode=arch=compute_86,code=sm_86 -std=c++14                                                                                                                
      cuda_rasterizer/auxiliary.h(151): warning #177-D: variable "p_proj" was declared but never referenced                                                                                                        
                                                                                                                                                                                                                   
      /home/gberton/anaconda3/envs/splatam/bin/nvcc -I/home/gberton/anaconda3/envs/splatam/lib/python3.10/site-packages/torch/include -I/home/gberton/anaconda3/envs/splatam/lib/python3.10/site-packages/torch/include/torch/csrc/api/include -I/home/gberton/anaconda3/envs/splatam/lib/python3.10/site-packages/torch/incl
ude/TH -I/home/gberton/anaconda3/envs/splatam/lib/python3.10/site-packages/torch/include/THC -I/home/gberton/anaconda3/envs/splatam/include -I/home/gberton/anaconda3/envs/splatam/include/python3.10 -c cuda_rasterizer/forward.cu -o build/temp.linux-x86_64-cpython-310/cuda_rasterizer/forward.o -D__CUDA_NO_HALF_OPERATO
RS__ -D__CUDA_NO_HALF_CONVERSIONS__ -D__CUDA_NO_BFLOAT16_CONVERSIONS__ -D__CUDA_NO_HALF2_OPERATORS__ --expt-relaxed-constexpr --compiler-options '-fPIC' -I/tmp/pip-req-build-fzmhzv59/third_party/glm/ -DTORCH_API_INCLUDE_EXTENSION_H -DPYBIND11_COMPILER_TYPE=\"_gcc\" -DPYBIND11_STDLIB=\"_libstdcpp\" -DPYBIND11_BUILD_A
BI=\"_cxxabi1011\" -DTORCH_EXTENSION_NAME=_C -D_GLIBCXX_USE_CXX11_ABI=0 -gencode=arch=compute_86,code=compute_86 -gencode=arch=compute_86,code=sm_86 -std=c++14                                                                                                                  
      cuda_rasterizer/auxiliary.h(151): warning #177-D: variable "p_proj" was declared but never referenced                                                                                                                                                                     
                                                                                                                                                                                                                   
      /home/gberton/anaconda3/envs/splatam/bin/nvcc -I/home/gberton/anaconda3/envs/splatam/lib/python3.10/site-packages/torch/include -I/home/gberton/anaconda3/envs/splatam/lib/python3.10/site-packages/torch/include/torch/csrc/api/include -I/home/gberton/anaconda3/envs/splatam/lib/python3.10/site-packages/torch/incl
ude/TH -I/home/gberton/anaconda3/envs/splatam/lib/python3.10/site-packages/torch/include/THC -I/home/gberton/anaconda3/envs/splatam/include -I/home/gberton/anaconda3/envs/splatam/include/python3.10 -c cuda_rasterizer/rasterizer_impl.cu -o build/temp.linux-x86_64-cpython-310/cuda_rasterizer/rasterizer_impl.o -D__CUDA
_NO_HALF_OPERATORS__ -D__CUDA_NO_HALF_CONVERSIONS__ -D__CUDA_NO_BFLOAT16_CONVERSIONS__ -D__CUDA_NO_HALF2_OPERATORS__ --expt-relaxed-constexpr --compiler-options '-fPIC' -I/tmp/pip-req-build-fzmhzv59/third_party/glm/ -DTORCH_API_INCLUDE_EXTENSION_H -DPYBIND11_COMPILER_TYPE=\"_gcc\" -DPYBIND11_STDLIB=\"_libstdcpp\" -D
PYBIND11_BUILD_ABI=\"_cxxabi1011\" -DTORCH_EXTENSION_NAME=_C -D_GLIBCXX_USE_CXX11_ABI=0 -gencode=arch=compute_86,code=compute_86 -gencode=arch=compute_86,code=sm_86 -std=c++14                                                                                                  
      cuda_rasterizer/auxiliary.h(151): warning #177-D: variable "p_proj" was declared but never referenced                                                                                                                                                                     
                                                                                                                                                                                                                                                                                
      /usr/include/c++/11/bits/std_function.h:435:145: error: parameter packs not expanded with ‘...’:                                                                                                             
        435 |         function(_Functor&& __f)                                                                                                                                                                     
            |                                                                                                                                                 ^                                                                                                                                                              
      /usr/include/c++/11/bits/std_function.h:435:145: note:         ‘_ArgTypes’                                                                                                                                   
      /usr/include/c++/11/bits/std_function.h:530:146: error: parameter packs not expanded with ‘...’:                                                                                                             
        530 |         operator=(_Functor&& __f)                                                                                                                                                                                                                                 
            |                                                                                                                                                  ^                                                                                                                                                             
      /usr/include/c++/11/bits/std_function.h:530:146: note:         ‘_ArgTypes’                                                                                                                                   
      error: command '/home/gberton/anaconda3/envs/splatam/bin/nvcc' failed with exit code 1                                                                                                                       
      [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      

The solution based on this issue in the original 3DGS repo: graphdeco-inria/gaussian-splatting#662 (comment)

Extra steps to install the submodules diff-gaussian-rasterization and simple-knn:

  • install the updated cudatoolkit: conda install -c conda-forge cudatoolkit-dev==11.6
  • install the g++-10: sudo apt install gcc-10 g++-10
  • update environment variables to use g++-10: export CC=/usr/bin/gcc-10, export CXX=/usr/bin/g++-10
  • cd to submodules directory and install: pip install .