graphdeco-inria / diff-gaussian-rasterization

Other
903 stars 282 forks source link

Building wheels for collected packages: diff-gaussian-rasterization #57

Open JiaminHuuu opened 3 months ago

JiaminHuuu commented 3 months ago

Issue Description

I am attempting to build the diff-gaussian-rasterization package on my Linux system, but I am encountering several errors related to CUDA version mismatches and C++ standard library issues. Below are the details of my setup and the errors I am experiencing.

The environment I used was wsl2 ubuntu.

I tried to install this by using pip install .

Error Details

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 ╰─> [102 lines of output] running bdist_wheel running build running build_py running build_ext /home/hanami/.local/lib/python3.10/site-packages/torch/utils/cpp_extension.py:388: UserWarning: The detected CUDA version (11.5) has a minor version mismatch with the version that was used to compile PyTorch (11.7). Most likely this shouldn't be a problem. warnings.warn(CUDA_MISMATCH_WARN.format(cuda_str_version, torch.version.cuda)) building 'diff_gaussian_rasterization._C' extension Emitting ninja build file /mnt/e/hujiamin1998/diff-gaussian-rasterization/build/temp.linux-x86_64-3.10/build.ninja... Compiling objects... Allowing ninja to set a default number of workers... (overridable by setting the environment variable MAX_JOBS=N) [1/2] /usr/bin/nvcc -I/home/hanami/.local/lib/python3.10/site-packages/torch/include -I/home/hanami/.local/lib/python3.10/site-packages/torch/include/torch/csrc/api/include -I/home/hanami/.local/lib/python3.10/site-packages/torch/include/TH -I/home/hanami/.local/lib/python3.10/site-packages/torch/include/THC -I/usr/include/python3.10 -c -c /mnt/e/hujiamin1998/diff-gaussian-rasterization/cuda_rasterizer/rasterizer_impl.cu -o /mnt/e/hujiamin1998/diff-gaussian-rasterization/build/temp.linux-x86_64-3.10/cuda_rasterizer/rasterizer_impl.o -DCUDA_NO_HALF_OPERATORS -DCUDA_NO_HALF_CONVERSIONS -DCUDA_NO_BFLOAT16_CONVERSIONS -DCUDA_NO_HALF2_OPERATORS --expt-relaxed-constexpr --compiler-options ''"'"'-fPIC'"'"'' -I/mnt/e/hujiamin1998/diff-gaussian-rasterization/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++17 FAILED: /mnt/e/hujiamin1998/diff-gaussian-rasterization/build/temp.linux-x86_64-3.10/cuda_rasterizer/rasterizer_impl.o /usr/bin/nvcc -I/home/hanami/.local/lib/python3.10/site-packages/torch/include -I/home/hanami/.local/lib/python3.10/site-packages/torch/include/torch/csrc/api/include -I/home/hanami/.local/lib/python3.10/site-packages/torch/include/TH -I/home/hanami/.local/lib/python3.10/site-packages/torch/include/THC -I/usr/include/python3.10 -c -c /mnt/e/hujiamin1998/diff-gaussian-rasterization/cuda_rasterizer/rasterizer_impl.cu -o /mnt/e/hujiamin1998/diff-gaussian-rasterization/build/temp.linux-x86_64-3.10/cuda_rasterizer/rasterizer_impl.o -DCUDA_NO_HALF_OPERATORS -DCUDA_NO_HALF_CONVERSIONS -DCUDA_NO_BFLOAT16_CONVERSIONS -DCUDA_NO_HALF2_OPERATORS --expt-relaxed-constexpr --compiler-options ''"'"'-fPIC'"'"'' -I/mnt/e/hujiamin1998/diff-gaussian-rasterization/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++17 /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’ [2/2] /usr/bin/nvcc -I/home/hanami/.local/lib/python3.10/site-packages/torch/include -I/home/hanami/.local/lib/python3.10/site-packages/torch/include/torch/csrc/api/include -I/home/hanami/.local/lib/python3.10/site-packages/torch/include/TH -I/home/hanami/.local/lib/python3.10/site-packages/torch/include/THC -I/usr/include/python3.10 -c -c /mnt/e/hujiamin1998/diff-gaussian-rasterization/rasterize_points.cu -o /mnt/e/hujiamin1998/diff-gaussian-rasterization/build/temp.linux-x86_64-3.10/rasterize_points.o -DCUDA_NO_HALF_OPERATORS -DCUDA_NO_HALF_CONVERSIONS -DCUDA_NO_BFLOAT16_CONVERSIONS -DCUDA_NO_HALF2_OPERATORS --expt-relaxed-constexpr --compiler-options ''"'"'-fPIC'"'"'' -I/mnt/e/hujiamin1998/diff-gaussian-rasterization/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++17 FAILED: /mnt/e/hujiamin1998/diff-gaussian-rasterization/build/temp.linux-x86_64-3.10/rasterize_points.o /usr/bin/nvcc -I/home/hanami/.local/lib/python3.10/site-packages/torch/include -I/home/hanami/.local/lib/python3.10/site-packages/torch/include/torch/csrc/api/include -I/home/hanami/.local/lib/python3.10/site-packages/torch/include/TH -I/home/hanami/.local/lib/python3.10/site-packages/torch/include/THC -I/usr/include/python3.10 -c -c /mnt/e/hujiamin1998/diff-gaussian-rasterization/rasterize_points.cu -o /mnt/e/hujiamin1998/diff-gaussian-rasterization/build/temp.linux-x86_64-3.10/rasterize_points.o -DCUDA_NO_HALF_OPERATORS -DCUDA_NO_HALF_CONVERSIONS -DCUDA_NO_BFLOAT16_CONVERSIONS -DCUDA_NO_HALF2_OPERATORS --expt-relaxed-constexpr --compiler-options ''"'"'-fPIC'"'"'' -I/mnt/e/hujiamin1998/diff-gaussian-rasterization/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++17 /home/hanami/.local/lib/python3.10/site-packages/torch/include/c10/util/irange.h(54): warning #186-D: pointless comparison of unsigned integer with zero detected during: instantiation of "__nv_bool c10::detail::integer_iterator<I, one_sided, >::operator==(const c10::detail::integer_iterator<I, one_sided, > &) const [with I=size_t, one_sided=false, =0]" (61): here instantiation of "__nv_bool c10::detail::integer_iterator<I, one_sided, >::operator!=(const c10::detail::integer_iterator<I, one_sided, > &) const [with I=size_t, one_sided=false, =0]" /home/hanami/.local/lib/python3.10/site-packages/torch/include/c10/core/TensorImpl.h(77): here

  /home/hanami/.local/lib/python3.10/site-packages/torch/include/c10/util/irange.h(54): warning #186-D: pointless comparison of unsigned integer with zero
            detected during:
              instantiation of "__nv_bool c10::detail::integer_iterator<I, one_sided, <unnamed>>::operator==(const c10::detail::integer_iterator<I, one_sided, <unnamed>> &) const [with I=std::size_t, one_sided=true, <unnamed>=0]"
  (61): here
              instantiation of "__nv_bool c10::detail::integer_iterator<I, one_sided, <unnamed>>::operator!=(const c10::detail::integer_iterator<I, one_sided, <unnamed>> &) const [with I=std::size_t, one_sided=true, <unnamed>=0]"
  /home/hanami/.local/lib/python3.10/site-packages/torch/include/ATen/core/qualified_name.h(73): here

  /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’
  ninja: build stopped: subcommand failed.
  Traceback (most recent call last):
    File "/home/hanami/.local/lib/python3.10/site-packages/torch/utils/cpp_extension.py", line 1893, in _run_ninja_build
      subprocess.run(
    File "/usr/lib/python3.10/subprocess.py", line 526, in run
      raise CalledProcessError(retcode, process.args,
  subprocess.CalledProcessError: Command '['ninja', '-v']' returned non-zero exit status 1.

  The above exception was the direct cause of the following exception:

  Traceback (most recent call last):
    File "<string>", line 2, in <module>
    File "<pip-setuptools-caller>", line 34, in <module>
    File "/mnt/e/hujiamin1998/diff-gaussian-rasterization/setup.py", line 17, in <module>
      setup(
    File "/usr/lib/python3/dist-packages/setuptools/__init__.py", line 153, in setup
      return distutils.core.setup(**attrs)
    File "/usr/lib/python3.10/distutils/core.py", line 148, in setup
      dist.run_commands()
    File "/usr/lib/python3.10/distutils/dist.py", line 966, in run_commands
      self.run_command(cmd)
    File "/usr/lib/python3.10/distutils/dist.py", line 985, in run_command
      cmd_obj.run()
    File "/usr/lib/python3/dist-packages/wheel/bdist_wheel.py", line 299, in run
      self.run_command('build')
    File "/usr/lib/python3.10/distutils/cmd.py", line 313, in run_command
      self.distribution.run_command(command)
    File "/usr/lib/python3.10/distutils/dist.py", line 985, in run_command
      cmd_obj.run()
    File "/usr/lib/python3.10/distutils/command/build.py", line 135, in run
      self.run_command(cmd_name)
    File "/usr/lib/python3.10/distutils/cmd.py", line 313, in run_command
      self.distribution.run_command(command)
    File "/usr/lib/python3.10/distutils/dist.py", line 985, in run_command
      cmd_obj.run()
    File "/usr/lib/python3/dist-packages/setuptools/command/build_ext.py", line 79, in run
      _build_ext.run(self)
    File "/usr/lib/python3.10/distutils/command/build_ext.py", line 340, in run
      self.build_extensions()
    File "/home/hanami/.local/lib/python3.10/site-packages/torch/utils/cpp_extension.py", line 843, in build_extensions
      build_ext.build_extensions(self)
    File "/usr/lib/python3.10/distutils/command/build_ext.py", line 449, in build_extensions
      self._build_extensions_serial()
    File "/usr/lib/python3.10/distutils/command/build_ext.py", line 474, in _build_extensions_serial
      self.build_extension(ext)
    File "/usr/lib/python3/dist-packages/setuptools/command/build_ext.py", line 202, in build_extension
      _build_ext.build_extension(self, ext)
    File "/usr/lib/python3.10/distutils/command/build_ext.py", line 529, in build_extension
      objects = self.compiler.compile(sources,
    File "/home/hanami/.local/lib/python3.10/site-packages/torch/utils/cpp_extension.py", line 658, in unix_wrap_ninja_compile
      _write_ninja_file_and_compile_objects(
    File "/home/hanami/.local/lib/python3.10/site-packages/torch/utils/cpp_extension.py", line 1574, in _write_ninja_file_and_compile_objects
      _run_ninja_build(
    File "/home/hanami/.local/lib/python3.10/site-packages/torch/utils/cpp_extension.py", line 1909, in _run_ninja_build
      raise RuntimeError(message) from e
  RuntimeError: Error compiling objects for extension
  [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

wang-zm18 commented 1 month ago

I found it is the problem about glmpackage. I tried to install glm manually, and it worked.

xianrui-luo commented 2 weeks ago

I found it is the problem about glmpackage. I tried to install glm manually, and it worked.

Hi @wang-zm18 is there any command available to install glm?

ramajoballester commented 2 days ago

Hi, @xianrui-luo. For Ubuntu, you can try:

sudo apt install libglm-dev