Open lzw-lzw opened 1 year ago
I have the same problem. Have you solved it?
@flyingtief47 @lzw-lzw check your gcc version, cuda version and python version. The problem seems that ninja is not able to build the cpp extension of a pytorch function, largely due to version mismatches of the stuff mentioned above. check these first.
@lzw-lzw @flyingtief47 Centos conda defaults to GCC version 4.8.5, and pytorch3d is used in the DECA project, which requires a GCC version greater than 4.9. So you need to compile a GCC manually. Here you need to install gcc-dependent libraries, including GMP, mpfr, MPC, and so on, and configure these libraries into environment variables. Here are some blogs you can check out: https://cloud.tencent.com/developer/article/1424725 https://blog.csdn.net/PascalBUAA/article/details/123408759
creating the FLAME Decoder trained model found. load /home/yws/文档/DECA/data/deca_model.tar Traceback (most recent call last): File "/home/yws/miniconda3/envs/deca/lib/python3.7/site-packages/torch/utils/cpp_extension.py", line 1746, in _run_ninja_build env=env) File "/home/yws/miniconda3/envs/deca/lib/python3.7/subprocess.py", line 512, in run output=stdout, stderr=stderr) 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 "demos/demo_reconstruct.py", line 131, in
creating the FLAME Decoder trained model found. load /home/yws/文档/DECA/data/deca_model.tar Traceback (most recent call last): File "/home/yws/miniconda3/envs/deca/lib/python3.7/site-packages/torch/utils/cpp_extension.py", line 1746, in _run_ninja_build env=env) File "/home/yws/miniconda3/envs/deca/lib/python3.7/subprocess.py", line 512, in run output=stdout, stderr=stderr) 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 "demos/demo_reconstruct.py", line 131, in main(parser.parse_args()) File "demos/demo_reconstruct.py", line 46, in main deca = DECA(config = deca_cfg, device=device) File "/home/yws/文档/DECA/decalib/deca.py", line 50, in init self._setup_renderer(self.cfg.model) File "/home/yws/文档/DECA/decalib/deca.py", line 53, in _setup_renderer set_rasterizer(self.cfg.rasterizer_type) File "/home/yws/文档/DECA/decalib/utils/renderer.py", line 41, in set_rasterizer extra_cuda_cflags = ['-std=c++14', '-ccbin=$$(which gcc-7)']) # cuda10.2 is not compatible with gcc9. Specify gcc 7 File "/home/yws/miniconda3/envs/deca/lib/python3.7/site-packages/torch/utils/cpp_extension.py", line 1156, in load keep_intermediates=keep_intermediates) File "/home/yws/miniconda3/envs/deca/lib/python3.7/site-packages/torch/utils/cpp_extension.py", line 1367, in _jit_compile is_standalone=is_standalone) File "/home/yws/miniconda3/envs/deca/lib/python3.7/site-packages/torch/utils/cpp_extension.py", line 1472, in _write_ninja_file_and_build_library error_prefix=f"Error building extension '{name}'") File "/home/yws/miniconda3/envs/deca/lib/python3.7/site-packages/torch/utils/cpp_extension.py", line 1756, in _run_ninja_build raise RuntimeError(message) from e RuntimeError: Error building extension 'standard_rasterize_cuda': [1/2] /home/yws/miniconda3/envs/deca/bin/nvcc -DTORCH_EXTENSION_NAME=standard_rasterize_cuda -DTORCH_API_INCLUDE_EXTENSION_H -DPYBIND11_COMPILER_TYPE="_gcc" -DPYBIND11_STDLIB="_libstdcpp" -DPYBIND11_BUILD_ABI="_cxxabi1011" -isystem /home/yws/miniconda3/envs/deca/lib/python3.7/site-packages/torch/include -isystem /home/yws/miniconda3/envs/deca/lib/python3.7/site-packages/torch/include/torch/csrc/api/include -isystem /home/yws/miniconda3/envs/deca/lib/python3.7/site-packages/torch/include/TH -isystem /home/yws/miniconda3/envs/deca/lib/python3.7/site-packages/torch/include/THC -isystem /home/yws/miniconda3/envs/deca/include -isystem /home/yws/miniconda3/envs/deca/include/python3.7m -D_GLIBCXX_USE_CXX11_ABI=0 -DCUDA_NO_HALF_OPERATORS -DCUDA_NO_HALF_CONVERSIONS -DCUDA_NO_BFLOAT16_CONVERSIONS -DCUDA_NO_HALF2_OPERATORS --expt-relaxed-constexpr -gencode=arch=compute_86,code=compute_86 -gencode=arch=compute_86,code=sm_86 --compiler-options '-fPIC' -std=c++14 -ccbin=$(which gcc-7) -c '/home/yws/文档/DECA/decalib/utils/rasterizer/standard_rasterize_cuda_kernel.cu' -o standard_rasterize_cuda_kernel.cuda.o FAILED: standard_rasterize_cuda_kernel.cuda.o /home/yws/miniconda3/envs/deca/bin/nvcc -DTORCH_EXTENSION_NAME=standard_rasterize_cuda -DTORCH_API_INCLUDE_EXTENSION_H -DPYBIND11_COMPILER_TYPE="_gcc" -DPYBIND11_STDLIB="_libstdcpp" -DPYBIND11_BUILD_ABI="_cxxabi1011" -isystem /home/yws/miniconda3/envs/deca/lib/python3.7/site-packages/torch/include -isystem /home/yws/miniconda3/envs/deca/lib/python3.7/site-packages/torch/include/torch/csrc/api/include -isystem /home/yws/miniconda3/envs/deca/lib/python3.7/site-packages/torch/include/TH -isystem /home/yws/miniconda3/envs/deca/lib/python3.7/site-packages/torch/include/THC -isystem /home/yws/miniconda3/envs/deca/include -isystem /home/yws/miniconda3/envs/deca/include/python3.7m -D_GLIBCXX_USE_CXX11_ABI=0 -DCUDA_NO_HALF_OPERATORS -DCUDA_NO_HALF_CONVERSIONS -DCUDA_NO_BFLOAT16_CONVERSIONS -DCUDA_NO_HALF2_OPERATORS --expt-relaxed-constexpr -gencode=arch=compute_86,code=compute_86 -gencode=arch=compute_86,code=sm_86 --compiler-options '-fPIC' -std=c++14 -ccbin=$(which gcc-7) -c '/home/yws/文档/DECA/decalib/utils/rasterizer/standard_rasterize_cuda_kernel.cu' -o standard_rasterize_cuda_kernel.cuda.o -c: No such file or directory nvcc fatal : Failed to preprocess host compiler properties. ninja: build stopped: subcommand failed.
have you solved this problem?
@jijiwaiw You need to install pytorch3D for rendering, and this error will occur if you use the default renderer.
Add this argument and it should work: --rasterizer_type=pytorch3d
There are two methods. The first is to call c++ compilation, which is difficult to solve. You can try another method, calling pytorch3d. Command line addition: --rasterizer_type pytorch3d. This can help you solve the problem
which command line do i add --rasterizer_type pytorch3d to? is it this one: python demos/demo_reconstruct.py -i TestSamples/examples --saveDepth True --saveObj True ?
Same problem, I found my gcc version is 9, and I install gcc-7 and g++-7, it worked
which command line do i add --rasterizer_type pytorch3d to? is it this one: python demos/demo_reconstruct.py -i TestSamples/examples --saveDepth True --saveObj True ?我应该将 --rasterizer_type pytorch3d 添加到哪个命令行?是这个吗: python demos/demo_reconstruct.py -i TestSamples/examples --saveDepth True --saveObj True ?
yes
RuntimeError: Error building extension 'standard_rasterize_cuda': [1/2] C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.5\bin\nvcc --generate-dependencies-with-compile --dependency-output standard_rasterize_cuda_kernel.cuda.o.d -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 /wd4190 -Xcompiler /wd4018 -Xcompiler /wd4275 -Xcompiler /wd4267
-Xcompiler /wd4244 -Xcompiler /wd4251 -Xcompiler /wd4819 -Xcompiler /MD -DTORCH_EXTENSION_NAME=standard_rasterize_cuda -DTORCH_API_INCLUDE_EXTENSION_H -ID:\Anaconda\envs\pytorch\lib\site-packages\torch\include -ID:\Anaconda\envs\pytorch\lib\site-packages\torch\include\torch\csrc\api\include -ID:\Anaconda\envs\pytorch\lib\site-packages\torch\include\TH
-ID:\Anaconda\envs\pytorch\lib\site-packages\torch\include\THC "-IC:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.5\include" -ID:\Anaconda\envs\pytorch\Include -D_GLIBCXX_USE_CXX11_ABI=0 -DCUDA_NO_HALF_OPERATORS -DCUDA_NO_HALF_CONVERSIONS -DCUDA_NO_BFLOAT16_CONVERSIONS -DCUDA_NO_HALF2_OPERATORS --expt-relaxed-constexpr -gencode=arch=compute_86,code=compute_86 -gencode=arch=compute_86,code=sm_86 -std=c++14 "-ccbin=$(which gcc-7)" -c C:\Users\LZW\Desktop\DECA-master\decalib\utils\rasterizer\standard_rasterize_cuda_kernel.cu -o standard_rasterize_cuda_kernel.cuda.o FAILED: standard_rasterize_cuda_kernel.cuda.o C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.5\bin\nvcc --generate-dependencies-with-compile --dependency-output standard_rasterize_cuda_kernel.cuda.o.d -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 /wd4190 -Xcompiler /wd4018 -Xcompiler /wd4275 -Xcompiler /wd4267 -Xcompiler /wd4244 -Xcompiler /wd4251 -Xcompiler /wd4819
-Xcompiler /MD -DTORCH_EXTENSION_NAME=standard_rasterize_cuda -DTORCH_API_INCLUDE_EXTENSION_H -ID:\Anaconda\envs\pytorch\lib\site-packages\torch\include -ID:\Anaconda\envs\pytorch\lib\site-packages\torch\include\torch\csrc\api\include -ID:\Anaconda\envs\pytorch\lib\site-packages\torch\include\TH -ID:\Anaconda\envs\pytorch\lib\site-packages\torch\include\THC "-IC:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.5\include" -ID:\Anaconda\envs\pytorch\Include -D_GLIBCXX_USE_CXX11_ABI=0 -DCUDA_NO_HALF_OPERATORS -DCUDA_NO_HALF_CONVERSIONS -DCUDA_NO_BFLOAT16_CONVERSIONS -DCUDA_NO_HALF2_OPERATORS --expt-relaxed-constexpr -gencode=arch=compute_86,code=compute_86 -gencode=arch=compute_86,code=sm_86 -std=c++14 "-ccbin=$(which gcc-7)" -c
C:\Users\LZW\Desktop\DECA-master\decalib\utils\rasterizer\standard_rasterize_cuda_kernel.cu -o standard_rasterize_cuda_kernel.cuda.o ninja: build stopped: subcommand failed.
anyone knows what's the problem?Thanks!