Fictionarry / ER-NeRF

[ICCV'23] Efficient Region-Aware Neural Radiance Fields for High-Fidelity Talking Portrait Synthesis
https://fictionarry.github.io/ER-NeRF/
MIT License
894 stars 124 forks source link

fatal error C1189: #error: You need C++17 to compile PyTorch #63

Open KylinZhou1 opened 8 months ago

KylinZhou1 commented 8 months ago

There is an error when I test Obama video clip with windows11 and pytorch 2.1.0+cu121, the error as below:

(ernerf) C:\Users\zhou\ai\ER-NeRF>python main.py data/obama/ --workspace trial_obama/ -O --test --ckpt trial_obama/checkpoints/ngp.pth Traceback (most recent call last): File "C:\Users\zhou\ai\ER-NeRF\raymarching\raymarching.py", line 10, in import _raymarching_face as _backend ModuleNotFoundError: No module named '_raymarching_face'

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "C:\Users\zhou\miniconda3\envs\ernerf\lib\site-packages\torch\utils\cpp_extension.py", line 2100, in _run_ninja_build subprocess.run( File "C:\Users\zhou\miniconda3\envs\ernerf\lib\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 "C:\Users\zhou\ai\ER-NeRF\main.py", line 6, in from nerf_triplane.network import NeRFNetwork File "C:\Users\zhou\ai\ER-NeRF\nerf_triplane\network.py", line 6, in from .renderer import NeRFRenderer File "C:\Users\zhou\ai\ER-NeRF\nerf_triplane\renderer.py", line 10, in import raymarching File "C:\Users\zhou\ai\ER-NeRF\raymarching__init.py", line 1, in from .raymarching import * File "C:\Users\zhou\ai\ER-NeRF\raymarching\raymarching.py", line 12, in from .backend import _backend File "C:\Users\zhou\ai\ER-NeRF\raymarching\backend.py", line 32, in _backend = load(name='_raymarching_face', File "C:\Users\zhou\miniconda3\envs\ernerf\lib\site-packages\torch\utils\cpp_extension.py", line 1308, in load return _jit_compile( File "C:\Users\zhou\miniconda3\envs\ernerf\lib\site-packages\torch\utils\cpp_extension.py", line 1710, in _jit_compile _write_ninja_file_and_build_library( File "C:\Users\zhou\miniconda3\envs\ernerf\lib\site-packages\torch\utils\cpp_extension.py", line 1823, in _write_ninja_file_and_build_library _run_ninja_build( File "C:\Users\zhou\miniconda3\envs\ernerf\lib\site-packages\torch\utils\cpp_extension.py", line 2116, in _run_ninja_build raise RuntimeError(message) from e RuntimeError: Error building extension '_raymarching_face': [1/2] C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.0\bin\nvcc --generate-dependencies-with-compile --dependency-output raymarching.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 /wd4068 -Xcompiler /wd4067 -Xcompiler /wd4624 -Xcompiler /wd4190 -Xcompiler /wd4018 -Xcompiler /wd4275 -Xcompiler /wd4267 -Xcompiler /wd4244 -Xcompiler /wd4251 -Xcompiler /wd4819 -Xcompiler /MD -DTORCH_EXTENSION_NAME=_raymarching_face -DTORCH_API_INCLUDE_EXTENSION_H -IC:\Users\zhou\miniconda3\envs\ernerf\lib\site-packages\torch\include -IC:\Users\zhou\miniconda3\envs\ernerf\lib\site-packages\torch\include\torch\csrc\api\include -IC:\Users\zhou\miniconda3\envs\ernerf\lib\site-packages\torch\include\TH -IC:\Users\zhou\miniconda3\envs\ernerf\lib\site-packages\torch\include\THC "-IC:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.0\include" -IC:\Users\zhou\miniconda3\envs\ernerf\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_89,code=compute_89 -gencode=arch=compute_89,code=sm_89 -std=c++17 -O3 -std=c++14 -UCUDA_NO_HALF_OPERATORS -UCUDA_NO_HALF_CONVERSIONS -UCUDA_NO_HALF2_OPERATORS -c C:\Users\zhou\ai\ER-NeRF\raymarching\src\raymarching.cu -o raymarching.cuda.o FAILED: raymarching.cuda.o C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.0\bin\nvcc --generate-dependencies-with-compile --dependency-output raymarching.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 /wd4068 -Xcompiler /wd4067 -Xcompiler /wd4624 -Xcompiler /wd4190 -Xcompiler /wd4018 -Xcompiler /wd4275 -Xcompiler /wd4267 -Xcompiler /wd4244 -Xcompiler /wd4251 -Xcompiler /wd4819 -Xcompiler /MD -DTORCH_EXTENSION_NAME=_raymarching_face -DTORCH_API_INCLUDE_EXTENSION_H -IC:\Users\zhou\miniconda3\envs\ernerf\lib\site-packages\torch\include -IC:\Users\zhou\miniconda3\envs\ernerf\lib\site-packages\torch\include\torch\csrc\api\include -IC:\Users\zhou\miniconda3\envs\ernerf\lib\site-packages\torch\include\TH -IC:\Users\zhou\miniconda3\envs\ernerf\lib\site-packages\torch\include\THC "-IC:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.0\include" -IC:\Users\zhou\miniconda3\envs\ernerf\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_89,code=compute_89 -gencode=arch=compute_89,code=sm_89 -std=c++17 -O3 -std=c++14 -UCUDA_NO_HALF_OPERATORS -UCUDA_NO_HALF_CONVERSIONS -UCUDA_NO_HALF2_OPERATORS -c C:\Users\zhou\ai\ER-NeRF\raymarching\src\raymarching.cu -o raymarching.cuda.o cl: 命令行 warning D9025 :正在重写“/DCUDA_NO_HALF_OPERATORS”(用“/UCUDA_NO_HALF_OPERATORS”) cl: 命令行 warning D9025 :正在重写“/DCUDA_NO_HALF_CONVERSIONS”(用“/UCUDA_NO_HALF_CONVERSIONS”) cl: 命令行 warning D9025 :正在重写“/DCUDA_NO_HALF2_OPERATORS”(用“/UCUDA_NO_HALF2_OPERATORS__”) raymarching.cu C:/Users/zhou/miniconda3/envs/ernerf/lib/site-packages/torch/include\c10/util/C++17.h(27): fatal error C1189: #error: You need C++17 to compile PyTorch nvcc warning : incompatible redefinition for option 'std', the last value of this option was used raymarching.cu ninja: build stopped: subcommand failed.

I had installed the component of c++ 17: image

xbwcpp commented 8 months ago

我在ubuntu 18.04上遇到了同样的错误,我升级gcc8就好了,也不知道是不是这个问题。

BigZSmallY commented 7 months ago

我将cuda降级到cu117,就没有出现这个问题了

RuojiWang commented 6 months ago

我在ubuntu 18.04上遇到了同样的错误,我升级gcc8就好了,也不知道是不是这个问题。

具体是怎么升级gcc8呢,有没有解决步骤呢,感谢

RuojiWang commented 6 months ago

我将cuda降级到cu117,就没有出现这个问题了

请问您是降低显卡的cuda,还是pytorch的cuda版本呢?

jamzhou commented 4 days ago

我把cuda从12降到11后,就好了。cuda对于c++版本也有要求