There is a problem when using cpp_extension.py

mdan226: <h1><a name="i-face-this-error-when-using-cpp_extensionpy-can-anyone-give-me-some-ideas-to-solve-this-thank-you-so-much-1" class="anchor" href="#i-face-this-error-when-using-cpp_extensionpy-can-anyone-give-me-some-ideas-to-solve-this-thank-you-so-much-1"></a>I face this error when using cpp_extension.py, can anyone give me some ideas to solve this?<br>
Thank you so much</h1>
<p>Traceback (most recent call last):<br>
File “C:\Users\mdan2\anaconda3\envs\deca\lib\site-packages\torch\utils\cpp_extension.py”, line 1522, in _run_ninja_build<br>
env=env)<br>
File “C:\Users\mdan2\anaconda3\envs\deca\lib\subprocess.py”, line 512, in run<br>
output=stdout, stderr=stderr)<br>
subprocess.CalledProcessError: Command ‘[‘ninja’, ‘-v’]’ returned non-zero exit status 1.</p>
<p>The above exception was the direct cause of the following exception:</p>
<p>Traceback (most recent call last):<br>
File “demos/demo_transfer.py”, line 133, in <br>
main(parser.parse_args())<br>
File “demos/demo_transfer.py”, line 42, in main<br>
deca = DECA(config=deca_cfg, device=device)<br>
File “D:\NTUST\Thesis\Multi-camera Tracking\DECA\decalib\deca.py”, line 50, in <strong>init</strong><br>
self.<em>setup_renderer(self.cfg.model)<br>
File “D:\NTUST\Thesis\Multi-camera Tracking\DECA\decalib\deca.py”, line 53, in <em>setup_renderer<br>
set_rasterizer(self.cfg.rasterizer_type)<br>
File “D:\NTUST\Thesis\Multi-camera Tracking\DECA\decalib\utils\renderer.py”, line 41, in set_rasterizer<br>
extra_cuda_cflags = [‘-std=c++14’, ‘-ccbin=$$(which gcc-7)’]) # cuda10.2 is not compatible with gcc9. Specify gcc 7<br>
File “C:\Users\mdan2\anaconda3\envs\deca\lib\site-packages\torch\utils\cpp_extension.py”, line 980, in load<br>
keep_intermediates=keep_intermediates)<br>
File “C:\Users\mdan2\anaconda3\envs\deca\lib\site-packages\torch\utils\cpp_extension.py”, line 1185, in <em>jit_compile<br>
with_cuda=with_cuda)<br>
File “C:\Users\mdan2\anaconda3\envs\deca\lib\site-packages\torch\utils\cpp_extension.py”, line 1283, in <em>write_ninja_file_and_build_library<br>
error_prefix=“Error building extension ‘{}’”.format(name))<br>
File “C:\Users\mdan2\anaconda3\envs\deca\lib\site-packages\torch\utils\cpp_extension.py”, line 1538, in <em>run_ninja_build<br>
raise RuntimeError(message) from e<br>
RuntimeError: Error building extension ‘standard_rasterize_cuda’: [1/2] C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.8\bin\nvcc -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 -IC:\Users\mdan2\anaconda3\envs\deca\lib\site-packages\torch\include -IC:\Users\mdan2\anaconda3\envs\deca\lib\site-packages\torch\include\torch\csrc\api\include -IC:\Users\mdan2\anaconda3\envs\deca\lib\site-packages\torch\include\TH -IC:\Users\mdan2\anaconda3\envs\deca\lib\site-packages\torch\include\THC “-IC:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.8\include” -IC:\Users\mdan2\anaconda3\envs\deca\Include -D_GLIBCXX_USE_CXX11_ABI=0 -D__CUDA_NO_HALF_OPERATORS</em></em> -D__CUDA_NO_HALF_CONVERSIONS</em></em> -D__CUDA_NO_HALF2_OPERATORS</em>_ --expt-relaxed-constexpr -gencode=arch=compute_86,code=sm_86 -std=c++14 “-ccbin=$(which gcc-7)” -c “D:\NTUST\Thesis\Multi-camera Tracking\DECA\decalib\utils\rasterizer\standard_rasterize_cuda_kernel.cu” -o standard_rasterize_cuda_kernel.cuda.o<br>
FAILED: standard_rasterize_cuda_kernel.cuda.o<br>
C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.8\bin\nvcc -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 -IC:\Users\mdan2\anaconda3\envs\deca\lib\site-packages\torch\include -IC:\Users\mdan2\anaconda3\envs\deca\lib\site-packages\torch\include\torch\csrc\api\include -IC:\Users\mdan2\anaconda3\envs\deca\lib\site-packages\torch\include\TH -IC:\Users\mdan2\anaconda3\envs\deca\lib\site-packages\torch\include\THC “-IC:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.8\include” -IC:\Users\mdan2\anaconda3\envs\deca\Include -D_GLIBCXX_USE_CXX11_ABI=0 -D__CUDA_NO_HALF_OPERATORS__ -D__CUDA_NO_HALF_CONVERSIONS__ -D__CUDA_NO_HALF2_OPERATORS__ --expt-relaxed-constexpr -gencode=arch=compute_86,code=sm_86 -std=c++14 “-ccbin=$(which gcc-7)” -c “D:\NTUST\Thesis\Multi-camera Tracking\DECA\decalib\utils\rasterizer\standard_rasterize_cuda_kernel.cu” -o standard_rasterize_cuda_kernel.cuda.o<br>
ninja: build stopped: subcommand failed.</p>