复现论文报错解决
文章目录
- 一、 The detected CUDA version (12.9) mismatches the version that was used to compile PyTorch (11.8)
- 二、error -- unsupported GNU version! gcc versions later than 11 are not supported!
- 三、Unknown encoder 'libx264'
- 四、下载速度太慢、无法递归下载项目
一、 The detected CUDA version (12.9) mismatches the version that was used to compile PyTorch (11.8)
在运行pip install -e gaussian-splatting/submodules/diff-gaussian-rasterization/
的时候报错
报错内容(部分):
RuntimeError:
The detected CUDA version (12.9) mismatches the version that was used to compile PyTorch (11.8).
Please make sure to use the same CUDA versions.
报错内容(全部):
pip install -e gaussian-splatting/submodules/diff-gaussian-rasterization/
Obtaining file:///mnt/disk2/zijie.zheng/projects/github/PhysGaussian/gaussian-splatting/submodules/diff-gaussian-rasterizationPreparing metadata (setup.py) ... done
Installing collected packages: diff-gaussian-rasterizationDEPRECATION: Legacy editable install of diff-gaussian-rasterization==0.0.0 from file:///mnt/disk2/zijie.zheng/projects/github/PhysGaussian/gaussian-splatting/submodules/diff-gaussian-rasterization (setup.py develop) is deprecated. pip 25.3 will enforce this behaviour change. A possible replacement is to add a pyproject.toml or enable --use-pep517, and use setuptools >= 64. If the resulting installation is not behaving as expected, try using --config-settings editable_mode=compat. Please consult the setuptools documentation for more information. Discussion can be found at https://github.com/pypa/pip/issues/11457Running setup.py develop for diff-gaussian-rasterizationerror: subprocess-exited-with-error× python setup.py develop did not run successfully.│ exit code: 1╰─> [76 lines of output]running develop/mnt/disk2/zijie.zheng/anaconda3/envs/PhysGaussian/lib/python3.9/site-packages/setuptools/command/develop.py:40: EasyInstallDeprecationWarning: easy_install command is deprecated.!!********************************************************************************Please avoid running ``setup.py`` and ``easy_install``.Instead, use pypa/build, pypa/installer or otherstandards-based tools.See https://github.com/pypa/setuptools/issues/917 for details.********************************************************************************!!easy_install.initialize_options(self)/mnt/disk2/zijie.zheng/anaconda3/envs/PhysGaussian/lib/python3.9/site-packages/setuptools/_distutils/cmd.py:66: SetuptoolsDeprecationWarning: setup.py install is deprecated.!!********************************************************************************Please avoid running ``setup.py`` directly.Instead, use pypa/build, pypa/installer or otherstandards-based tools.See https://blog.ganssle.io/articles/2021/10/setup-py-deprecated.html for details.********************************************************************************!!self.initialize_options()running egg_infowriting diff_gaussian_rasterization.egg-info/PKG-INFOwriting dependency_links to diff_gaussian_rasterization.egg-info/dependency_links.txtwriting top-level names to diff_gaussian_rasterization.egg-info/top_level.txt/mnt/disk2/zijie.zheng/anaconda3/envs/PhysGaussian/lib/python3.9/site-packages/torch/utils/cpp_extension.py:476: 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.'))reading manifest file 'diff_gaussian_rasterization.egg-info/SOURCES.txt'adding license file 'LICENSE.md'writing manifest file 'diff_gaussian_rasterization.egg-info/SOURCES.txt'running build_extTraceback (most recent call last):File "<string>", line 2, in <module>File "<pip-setuptools-caller>", line 35, in <module>File "/mnt/disk2/zijie.zheng/projects/github/PhysGaussian/gaussian-splatting/submodules/diff-gaussian-rasterization/setup.py", line 17, in <module>setup(File "/mnt/disk2/zijie.zheng/anaconda3/envs/PhysGaussian/lib/python3.9/site-packages/setuptools/__init__.py", line 107, in setupreturn distutils.core.setup(**attrs)File "/mnt/disk2/zijie.zheng/anaconda3/envs/PhysGaussian/lib/python3.9/site-packages/setuptools/_distutils/core.py", line 185, in setupreturn run_commands(dist)File "/mnt/disk2/zijie.zheng/anaconda3/envs/PhysGaussian/lib/python3.9/site-packages/setuptools/_distutils/core.py", line 201, in run_commandsdist.run_commands()File "/mnt/disk2/zijie.zheng/anaconda3/envs/PhysGaussian/lib/python3.9/site-packages/setuptools/_distutils/dist.py", line 969, in run_commandsself.run_command(cmd)File "/mnt/disk2/zijie.zheng/anaconda3/envs/PhysGaussian/lib/python3.9/site-packages/setuptools/dist.py", line 1234, in run_commandsuper().run_command(command)File "/mnt/disk2/zijie.zheng/anaconda3/envs/PhysGaussian/lib/python3.9/site-packages/setuptools/_distutils/dist.py", line 988, in run_commandcmd_obj.run()File "/mnt/disk2/zijie.zheng/anaconda3/envs/PhysGaussian/lib/python3.9/site-packages/setuptools/command/develop.py", line 34, in runself.install_for_development()File "/mnt/disk2/zijie.zheng/anaconda3/envs/PhysGaussian/lib/python3.9/site-packages/setuptools/command/develop.py", line 111, in install_for_developmentself.run_command('build_ext')File "/mnt/disk2/zijie.zheng/anaconda3/envs/PhysGaussian/lib/python3.9/site-packages/setuptools/_distutils/cmd.py", line 318, in run_commandself.distribution.run_command(command)File "/mnt/disk2/zijie.zheng/anaconda3/envs/PhysGaussian/lib/python3.9/site-packages/setuptools/dist.py", line 1234, in run_commandsuper().run_command(command)File "/mnt/disk2/zijie.zheng/anaconda3/envs/PhysGaussian/lib/python3.9/site-packages/setuptools/_distutils/dist.py", line 988, in run_commandcmd_obj.run()File "/mnt/disk2/zijie.zheng/anaconda3/envs/PhysGaussian/lib/python3.9/site-packages/setuptools/command/build_ext.py", line 84, in run_build_ext.run(self)File "/mnt/disk2/zijie.zheng/anaconda3/envs/PhysGaussian/lib/python3.9/site-packages/setuptools/_distutils/command/build_ext.py", line 345, in runself.build_extensions()File "/mnt/disk2/zijie.zheng/anaconda3/envs/PhysGaussian/lib/python3.9/site-packages/torch/utils/cpp_extension.py", line 499, in build_extensions_check_cuda_version(compiler_name, compiler_version)File "/mnt/disk2/zijie.zheng/anaconda3/envs/PhysGaussian/lib/python3.9/site-packages/torch/utils/cpp_extension.py", line 387, in _check_cuda_versionraise RuntimeError(CUDA_MISMATCH_MESSAGE.format(cuda_str_version, torch.version.cuda))RuntimeError:The detected CUDA version (12.9) mismatches the version that was used to compilePyTorch (11.8). Please make sure to use the same CUDA versions.[end of output]note: This error originates from a subprocess, and is likely not a problem with pip.
error: subprocess-exited-with-error× python setup.py develop did not run successfully.
│ exit code: 1
╰─> [76 lines of output]running develop/mnt/disk2/zijie.zheng/anaconda3/envs/PhysGaussian/lib/python3.9/site-packages/setuptools/command/develop.py:40: EasyInstallDeprecationWarning: easy_install command is deprecated.!!********************************************************************************Please avoid running ``setup.py`` and ``easy_install``.Instead, use pypa/build, pypa/installer or otherstandards-based tools.See https://github.com/pypa/setuptools/issues/917 for details.********************************************************************************!!easy_install.initialize_options(self)/mnt/disk2/zijie.zheng/anaconda3/envs/PhysGaussian/lib/python3.9/site-packages/setuptools/_distutils/cmd.py:66: SetuptoolsDeprecationWarning: setup.py install is deprecated.!!********************************************************************************Please avoid running ``setup.py`` directly.Instead, use pypa/build, pypa/installer or otherstandards-based tools.See https://blog.ganssle.io/articles/2021/10/setup-py-deprecated.html for details.********************************************************************************!!self.initialize_options()running egg_infowriting diff_gaussian_rasterization.egg-info/PKG-INFOwriting dependency_links to diff_gaussian_rasterization.egg-info/dependency_links.txtwriting top-level names to diff_gaussian_rasterization.egg-info/top_level.txt/mnt/disk2/zijie.zheng/anaconda3/envs/PhysGaussian/lib/python3.9/site-packages/torch/utils/cpp_extension.py:476: 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.'))reading manifest file 'diff_gaussian_rasterization.egg-info/SOURCES.txt'adding license file 'LICENSE.md'writing manifest file 'diff_gaussian_rasterization.egg-info/SOURCES.txt'running build_extTraceback (most recent call last):File "<string>", line 2, in <module>File "<pip-setuptools-caller>", line 35, in <module>File "/mnt/disk2/zijie.zheng/projects/github/PhysGaussian/gaussian-splatting/submodules/diff-gaussian-rasterization/setup.py", line 17, in <module>setup(File "/mnt/disk2/zijie.zheng/anaconda3/envs/PhysGaussian/lib/python3.9/site-packages/setuptools/__init__.py", line 107, in setupreturn distutils.core.setup(**attrs)File "/mnt/disk2/zijie.zheng/anaconda3/envs/PhysGaussian/lib/python3.9/site-packages/setuptools/_distutils/core.py", line 185, in setupreturn run_commands(dist)File "/mnt/disk2/zijie.zheng/anaconda3/envs/PhysGaussian/lib/python3.9/site-packages/setuptools/_distutils/core.py", line 201, in run_commandsdist.run_commands()File "/mnt/disk2/zijie.zheng/anaconda3/envs/PhysGaussian/lib/python3.9/site-packages/setuptools/_distutils/dist.py", line 969, in run_commandsself.run_command(cmd)File "/mnt/disk2/zijie.zheng/anaconda3/envs/PhysGaussian/lib/python3.9/site-packages/setuptools/dist.py", line 1234, in run_commandsuper().run_command(command)File "/mnt/disk2/zijie.zheng/anaconda3/envs/PhysGaussian/lib/python3.9/site-packages/setuptools/_distutils/dist.py", line 988, in run_commandcmd_obj.run()File "/mnt/disk2/zijie.zheng/anaconda3/envs/PhysGaussian/lib/python3.9/site-packages/setuptools/command/develop.py", line 34, in runself.install_for_development()File "/mnt/disk2/zijie.zheng/anaconda3/envs/PhysGaussian/lib/python3.9/site-packages/setuptools/command/develop.py", line 111, in install_for_developmentself.run_command('build_ext')File "/mnt/disk2/zijie.zheng/anaconda3/envs/PhysGaussian/lib/python3.9/site-packages/setuptools/_distutils/cmd.py", line 318, in run_commandself.distribution.run_command(command)File "/mnt/disk2/zijie.zheng/anaconda3/envs/PhysGaussian/lib/python3.9/site-packages/setuptools/dist.py", line 1234, in run_commandsuper().run_command(command)File "/mnt/disk2/zijie.zheng/anaconda3/envs/PhysGaussian/lib/python3.9/site-packages/setuptools/_distutils/dist.py", line 988, in run_commandcmd_obj.run()File "/mnt/disk2/zijie.zheng/anaconda3/envs/PhysGaussian/lib/python3.9/site-packages/setuptools/command/build_ext.py", line 84, in run_build_ext.run(self)File "/mnt/disk2/zijie.zheng/anaconda3/envs/PhysGaussian/lib/python3.9/site-packages/setuptools/_distutils/command/build_ext.py", line 345, in runself.build_extensions()File "/mnt/disk2/zijie.zheng/anaconda3/envs/PhysGaussian/lib/python3.9/site-packages/torch/utils/cpp_extension.py", line 499, in build_extensions_check_cuda_version(compiler_name, compiler_version)File "/mnt/disk2/zijie.zheng/anaconda3/envs/PhysGaussian/lib/python3.9/site-packages/torch/utils/cpp_extension.py", line 387, in _check_cuda_versionraise RuntimeError(CUDA_MISMATCH_MESSAGE.format(cuda_str_version, torch.version.cuda))RuntimeError:The detected CUDA version (12.9) mismatches the version that was used to compilePyTorch (11.8). Please make sure to use the same CUDA versions.[end of output]
排查错因:
(1)想通过输入which nvcc
的方式来查询当前cuda的路径,结果没有输出任何内容。
(2)想通过输入nvcc -V
的方式查看cuda版本,结果输出是:
nvcc -V
Command 'nvcc' not found, but can be installed with:
apt install nvidia-cuda-toolkit
Please ask your administrator.
(3)输入ls /usr/local | grep cuda
,想要查看系统中是否有 CUDA 相关文件,输出结果为:
cuda
cuda-12
cuda-12.9
并没有预期的cuda 11.8。GPT说若输出类似cuda或cuda-11.8,说明 CUDA 已安装但未配置环境变量。若没有输出,说明 CUDA 未安装。
需要安装CUDA。
解决方案
去官网找CUDA 11.8 安装包:https://developer.nvidia.com/cuda-toolkit-archive
运行命令:
wget https://developer.download.nvidia.com/compute/cuda/11.8.0/local_installers/cuda_11.8.0_520.61.05_linux.run
随后为安装程序添加执行权限。但因为我没有管理员权限,所以选择使用 --silent 静默安装,并指定 --toolkit 只安装工具链。
# 为安装程序添加执行权限
chmod +x cuda_11.8.0_520.61.05_linux.run# 使用 --silent 静默安装,并指定 --toolkit 只安装工具链
./cuda_11.8.0_520.61.05_linux.run \--silent \--toolkit \--toolkitpath=$HOME/cuda-11.8 \--override
然后配置环境变量,这里有两种配置方式,一种是暂时的,一种是永久的。推荐使用永久的。
永久的:
echo 'export PATH=$HOME/cuda-11.8/bin:$PATH' >> ~/.bashrc
echo 'export LD_LIBRARY_PATH=$HOME/cuda-11.8/lib64:$LD_LIBRARY_PATH' >> ~/.bashrc
source ~/.bashrc
暂时的(只在当前终端有效):
export PATH=$HOME/cuda-11.8/bin:$PATH
export LD_LIBRARY_PATH=$HOME/cuda-11.8/lib64:$LD_LIBRARY_PATH
配置完成后再输入nvcc -V
,就能看到版本信息了(cuda 11.8)。因此推测一开始检测到的CUDA version (12.9)是系统的cuda版本,不是当前环境中的,因此造成了冲突。此时,运行pip install -e gaussian-splatting/submodules/diff-gaussian-rasterization/
也不会再报同样的错误。
二、error – unsupported GNU version! gcc versions later than 11 are not supported!
运行pip install -e gaussian-splatting/submodules/diff-gaussian-rasterization/
的时候出现以下报错:
pip install -e gaussian-splatting/submodules/diff-gaussian-rasterization/
Obtaining file:///mnt/disk2/zijie.zheng/projects/github/PhysGaussian/gaussian-splatting/submodules/diff-gaussian-rasterizationPreparing metadata (setup.py) ... done
Installing collected packages: diff-gaussian-rasterizationDEPRECATION: Legacy editable install of diff-gaussian-rasterization==0.0.0 from file:///mnt/disk2/zijie.zheng/projects/github/PhysGaussian/gaussian-splatting/submodules/diff-gaussian-rasterization (setup.py develop) is deprecated. pip 25.3 will enforce this behaviour change. A possible replacement is to add a pyproject.toml or enable --use-pep517, and use setuptools >= 64. If the resulting installation is not behaving as expected, try using --config-settings editable_mode=compat. Please consult the setuptools documentation for more information. Discussion can be found at https://github.com/pypa/pip/issues/11457Running setup.py develop for diff-gaussian-rasterizationerror: subprocess-exited-with-error× python setup.py develop did not run successfully.│ exit code: 1╰─> [47 lines of output]running develop/mnt/disk2/zijie.zheng/anaconda3/envs/PhysGaussian/lib/python3.9/site-packages/setuptools/command/develop.py:40: EasyInstallDeprecationWarning: easy_install command is deprecated.!!********************************************************************************Please avoid running ``setup.py`` and ``easy_install``.Instead, use pypa/build, pypa/installer or otherstandards-based tools.See https://github.com/pypa/setuptools/issues/917 for details.********************************************************************************!!easy_install.initialize_options(self)/mnt/disk2/zijie.zheng/anaconda3/envs/PhysGaussian/lib/python3.9/site-packages/setuptools/_distutils/cmd.py:66: SetuptoolsDeprecationWarning: setup.py install is deprecated.!!********************************************************************************Please avoid running ``setup.py`` directly.Instead, use pypa/build, pypa/installer or otherstandards-based tools.See https://blog.ganssle.io/articles/2021/10/setup-py-deprecated.html for details.********************************************************************************!!self.initialize_options()running egg_infowriting diff_gaussian_rasterization.egg-info/PKG-INFOwriting dependency_links to diff_gaussian_rasterization.egg-info/dependency_links.txtwriting top-level names to diff_gaussian_rasterization.egg-info/top_level.txt/mnt/disk2/zijie.zheng/anaconda3/envs/PhysGaussian/lib/python3.9/site-packages/torch/utils/cpp_extension.py:476: 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.'))reading manifest file 'diff_gaussian_rasterization.egg-info/SOURCES.txt'adding license file 'LICENSE.md'writing manifest file 'diff_gaussian_rasterization.egg-info/SOURCES.txt'running build_ext/mnt/disk2/zijie.zheng/anaconda3/envs/PhysGaussian/lib/python3.9/site-packages/torch/utils/cpp_extension.py:398: UserWarning: There are no g++ version bounds defined for CUDA version 11.8warnings.warn(f'There are no {compiler_name} version bounds defined for CUDA version {cuda_str_version}')building 'diff_gaussian_rasterization._C' extension/mnt/disk2/zijie.zheng/cuda-11.8/bin/nvcc -I/mnt/disk2/zijie.zheng/anaconda3/envs/PhysGaussian/lib/python3.9/site-packages/torch/include -I/mnt/disk2/zijie.zheng/anaconda3/envs/PhysGaussian/lib/python3.9/site-packages/torch/include/torch/csrc/api/include -I/mnt/disk2/zijie.zheng/anaconda3/envs/PhysGaussian/lib/python3.9/site-packages/torch/include/TH -I/mnt/disk2/zijie.zheng/anaconda3/envs/PhysGaussian/lib/python3.9/site-packages/torch/include/THC -I/mnt/disk2/zijie.zheng/cuda-11.8/include -I/mnt/disk2/zijie.zheng/anaconda3/envs/PhysGaussian/include/python3.9 -c cuda_rasterizer/backward.cu -o build/temp.linux-x86_64-cpython-39/cuda_rasterizer/backward.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/mnt/disk2/zijie.zheng/projects/github/PhysGaussian/gaussian-splatting/submodules/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=sm_86 -gencode=arch=compute_89,code=compute_89 -gencode=arch=compute_89,code=sm_89 -std=c++17In file included from /mnt/disk2/zijie.zheng/cuda-11.8/include/cuda_runtime.h:83,from <command-line>:/mnt/disk2/zijie.zheng/cuda-11.8/include/crt/host_config.h:132:2: error: #error -- unsupported GNU version! gcc versions later than 11 are not 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.132 | #error -- unsupported GNU version! gcc versions later than 11 are not 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.| ^~~~~error: command '/mnt/disk2/zijie.zheng/cuda-11.8/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: subprocess-exited-with-error× python setup.py develop did not run successfully.
│ exit code: 1
╰─> [47 lines of output]running develop/mnt/disk2/zijie.zheng/anaconda3/envs/PhysGaussian/lib/python3.9/site-packages/setuptools/command/develop.py:40: EasyInstallDeprecationWarning: easy_install command is deprecated.!!********************************************************************************Please avoid running ``setup.py`` and ``easy_install``.Instead, use pypa/build, pypa/installer or otherstandards-based tools.See https://github.com/pypa/setuptools/issues/917 for details.********************************************************************************!!easy_install.initialize_options(self)/mnt/disk2/zijie.zheng/anaconda3/envs/PhysGaussian/lib/python3.9/site-packages/setuptools/_distutils/cmd.py:66: SetuptoolsDeprecationWarning: setup.py install is deprecated.!!********************************************************************************Please avoid running ``setup.py`` directly.Instead, use pypa/build, pypa/installer or otherstandards-based tools.See https://blog.ganssle.io/articles/2021/10/setup-py-deprecated.html for details.********************************************************************************!!self.initialize_options()running egg_infowriting diff_gaussian_rasterization.egg-info/PKG-INFOwriting dependency_links to diff_gaussian_rasterization.egg-info/dependency_links.txtwriting top-level names to diff_gaussian_rasterization.egg-info/top_level.txt/mnt/disk2/zijie.zheng/anaconda3/envs/PhysGaussian/lib/python3.9/site-packages/torch/utils/cpp_extension.py:476: 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.'))reading manifest file 'diff_gaussian_rasterization.egg-info/SOURCES.txt'adding license file 'LICENSE.md'writing manifest file 'diff_gaussian_rasterization.egg-info/SOURCES.txt'running build_ext/mnt/disk2/zijie.zheng/anaconda3/envs/PhysGaussian/lib/python3.9/site-packages/torch/utils/cpp_extension.py:398: UserWarning: There are no g++ version bounds defined for CUDA version 11.8warnings.warn(f'There are no {compiler_name} version bounds defined for CUDA version {cuda_str_version}')building 'diff_gaussian_rasterization._C' extension/mnt/disk2/zijie.zheng/cuda-11.8/bin/nvcc -I/mnt/disk2/zijie.zheng/anaconda3/envs/PhysGaussian/lib/python3.9/site-packages/torch/include -I/mnt/disk2/zijie.zheng/anaconda3/envs/PhysGaussian/lib/python3.9/site-packages/torch/include/torch/csrc/api/include -I/mnt/disk2/zijie.zheng/anaconda3/envs/PhysGaussian/lib/python3.9/site-packages/torch/include/TH -I/mnt/disk2/zijie.zheng/anaconda3/envs/PhysGaussian/lib/python3.9/site-packages/torch/include/THC -I/mnt/disk2/zijie.zheng/cuda-11.8/include -I/mnt/disk2/zijie.zheng/anaconda3/envs/PhysGaussian/include/python3.9 -c cuda_rasterizer/backward.cu -o build/temp.linux-x86_64-cpython-39/cuda_rasterizer/backward.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/mnt/disk2/zijie.zheng/projects/github/PhysGaussian/gaussian-splatting/submodules/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=sm_86 -gencode=arch=compute_89,code=compute_89 -gencode=arch=compute_89,code=sm_89 -std=c++17In file included from /mnt/disk2/zijie.zheng/cuda-11.8/include/cuda_runtime.h:83,from <command-line>:/mnt/disk2/zijie.zheng/cuda-11.8/include/crt/host_config.h:132:2: error: #error -- unsupported GNU version! gcc versions later than 11 are not 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.132 | #error -- unsupported GNU version! gcc versions later than 11 are not 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.| ^~~~~error: command '/mnt/disk2/zijie.zheng/cuda-11.8/bin/nvcc' failed with exit code 1
报错原因:
这个报错是GCC版本和CUDA的兼容性问题有关。CUDA 11.8 使用的是基于 GCC 9.x 或 GCC 10.x 的兼容性最好的编译器版本。如果你系统默认的 GCC 是 11 或更高(特别是 12+),就会引发这种兼容性错误。
我们的系统GCC版是13.3.0,因此发生报错。
解决方法:
主要思路是在没有管理员权限的情况下降低GCC版本,试了好几种方法,下面这种方法成功了。
(1)激活当前的 Conda 环境:conda activate PhysGaussian
(2)安装 GCC 9:conda install -c conda-forge gcc_linux-64=9 gxx_linux-64=9
(3)设置环境变量让 Python/CUDA 使用这个 GCC:
export CC=$CONDA_PREFIX/bin/x86_64-conda-linux-gnu-gcc
export CXX=$CONDA_PREFIX/bin/x86_64-conda-linux-gnu-g++
(4)验证 GCC 版本:$CC --version
验证结果如下,表示安装成功:
x86_64-conda-linux-gnu-cc (conda-forge gcc 9.5.0-19) 9.5.0
Copyright (C) 2019 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.
(5)重新运行命令:pip install -e gaussian-splatting/submodules/diff-gaussian-rasterization/
三、Unknown encoder ‘libx264’
运行命令python gs_simulation.py --model_path ./model/ficus_whitebg-trained/ --output_path output --config ./config/ficus_config.json --render_img --compile_video --white_bg
的时候出现报错。
报错内容:主要是最后一行Unknown encoder ‘libx264’
configuration: --prefix=/mnt/disk2/zijie.zheng/anaconda3/envs/PhysGaussian --cc=/opt/conda/conda-bld/ffmpeg_1597178665428/_build_env/bin/x86_64-conda_cos6-linux-gnu-cc --disable-doc --disable-openssl --enable-avresample --enable-gnutls --enable-hardcoded-tables --enable-libfreetype --enable-libopenh264 --enable-pic --enable-pthreads --enable-shared --disable-static --enable-version3 --enable-zlib --enable-libmp3lamelibavutil 56. 51.100 / 56. 51.100libavcodec 58. 91.100 / 58. 91.100libavformat 58. 45.100 / 58. 45.100libavdevice 58. 10.100 / 58. 10.100libavfilter 7. 85.100 / 7. 85.100libavresample 4. 0. 0 / 4. 0. 0libswscale 5. 7.100 / 5. 7.100libswresample 3. 7.100 / 3. 7.100
Input #0, image2, from 'output/%04d.png':Duration: 00:00:05.00, start: 0.000000, bitrate: N/AStream #0:0: Video: png, rgb24(pc), 800x800, 25 fps, 25 tbr, 25 tbn, 25 tbc
Unknown encoder 'libx264'
报错原因:这意味着 ffmpeg 没有编译 libx264 支持,因此无法使用 libx264 编码器导出 .mp4 等常见格式视频。
解决方法:
用conda list查看了一下当前ffmpeg的版本为 4.3,升级到指定版本4.3.1就行。
conda install -c conda-forge ffmpeg=4.3.1
安装后可用ffmpeg -encoders | grep libx264
检查libx264是否可用。
PS:不要用conda install -c conda-forge ffmpeg
,没有指定版本,一下子把ffmpeg的版本号升级到7.几,环境里的包出现了各种不兼容情况,一下子乱成一锅粥TvT。
四、下载速度太慢、无法递归下载项目
使用readme文件中给的方法下载速度太慢了。
git clone --recurse-submodules git@github.com:XPandora/PhysGaussian.git
使用了代理后下载速度还是很慢,发现是因为没有使用http协议,于是换成了http协议,下载速度明显变快。
但“–recurse-submodules”并没有起作用,项目中引用的一些其他项目并不能被下载下来。所以只能手动下载并添加到对应路径中去了。