LiveTalking icon indicating copy to clipboard operation
LiveTalking copied to clipboard

编译raymarching.cu的时候出现错误:fatal error C1189: #error: You need C++17 to compile PyTorch

Open wxzz opened this issue 1 year ago • 6 comments

C:\Users\WXZZ\Desktop\metahuman-stream-main>python app.py Traceback (most recent call last): File "C:\Users\WXZZ\Desktop\metahuman-stream-main\ernerf\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 "D:\Anaconda3\Lib\site-packages\torch\utils\cpp_extension.py", line 2100, in _run_ninja_build subprocess.run( File "D:\Anaconda3\Lib\subprocess.py", line 571, 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\WXZZ\Desktop\metahuman-stream-main\app.py", line 332, in from ernerf.nerf_triplane.network import NeRFNetwork File "C:\Users\WXZZ\Desktop\metahuman-stream-main\ernerf\nerf_triplane\network.py", line 6, in from .renderer import NeRFRenderer File "C:\Users\WXZZ\Desktop\metahuman-stream-main\ernerf\nerf_triplane\renderer.py", line 10, in from .. import raymarching File "C:\Users\WXZZ\Desktop\metahuman-stream-main\ernerf\raymarching_init_.py", line 1, in from .raymarching import * File "C:\Users\WXZZ\Desktop\metahuman-stream-main\ernerf\raymarching\raymarching.py", line 12, in from .backend import backend File "C:\Users\WXZZ\Desktop\metahuman-stream-main\ernerf\raymarching\backend.py", line 31, in backend = load(name='raymarching_face', ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "D:\Anaconda3\Lib\site-packages\torch\utils\cpp_extension.py", line 1308, in load return jit_compile( ^^^^^^^^^^^^^ File "D:\Anaconda3\Lib\site-packages\torch\utils\cpp_extension.py", line 1710, in jit_compile write_ninja_file_and_build_library( File "D:\Anaconda3\Lib\site-packages\torch\utils\cpp_extension.py", line 1823, in write_ninja_file_and_build_library run_ninja_build( File "D:\Anaconda3\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 .6\bin\nvcc --generate-dependencies-with-compile --dependency-output raymarching.cuda.o.d -Xcudafe --diag_suppress=dll_i nterface_conflict_dllexport_assumed -Xcudafe --diag_suppress=dll_interface_conflict_none_assumed -Xcudafe --diag_suppres s=field_without_dll_interface -Xcudafe --diag_suppress=base_class_has_different_dll_interface -Xcompiler /EHsc -Xcompile r /wd4068 -Xcompiler /wd4067 -Xcompiler /wd4624 -Xcompiler /wd4190 -Xcompiler /wd4018 -Xcompiler /wd4275 -Xcompiler /wd4 267 -Xcompiler /wd4244 -Xcompiler /wd4251 -Xcompiler /wd4819 -Xcompiler /MD -DTORCH_EXTENSION_NAME=raymarching_face -DT ORCH_API_INCLUDE_EXTENSION_H -ID:\Anaconda3\Lib\site-packages\torch\include -ID:\Anaconda3\Lib\site-packages\torch\inclu de\torch\csrc\api\include -ID:\Anaconda3\Lib\site-packages\torch\include\TH -ID:\Anaconda3\Lib\site-packages\torch\inclu de\THC "-IC:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.6\include" -ID:\Anaconda3\Include -D_GLIBCXX_USE_CXX11 ABI=0 -D__CUDA_NO_HALF_OPERATORS -D__CUDA_NO_HALF_CONVERSIONS -D__CUDA_NO_BFLOAT16_CONVERSIONS -D__CUDA_NO_HALF2_O PERATORS --expt-relaxed-constexpr -gencode=arch=compute_61,code=compute_61 -gencode=arch=compute_61,code=sm_61 -std=c+ +17 -O3 -std=c++14 -U__CUDA_NO_HALF_OPERATORS -U__CUDA_NO_HALF_CONVERSIONS__ -U__CUDA_NO_HALF2_OPERATORS__ -c C:\Users \WXZZ\Desktop\metahuman-stream-main\ernerf\raymarching\src\raymarching.cu -o raymarching.cuda.o FAILED: raymarching.cuda.o C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.6\bin\nvcc --generate-dependencies-with-compile --dependency-outp ut raymarching.cuda.o.d -Xcudafe --diag_suppress=dll_interface_conflict_dllexport_assumed -Xcudafe --diag_suppress=dll_i nterface_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 -Xcom piler /MD -DTORCH_EXTENSION_NAME=raymarching_face -DTORCH_API_INCLUDE_EXTENSION_H -ID:\Anaconda3\Lib\site-packages\torc h\include -ID:\Anaconda3\Lib\site-packages\torch\include\torch\csrc\api\include -ID:\Anaconda3\Lib\site-packages\torch\i nclude\TH -ID:\Anaconda3\Lib\site-packages\torch\include\THC "-IC:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.6 \include" -ID:\Anaconda3\Include -D_GLIBCXX_USE_CXX11_ABI=0 -D__CUDA_NO_HALF_OPERATORS_ -D__CUDA_NO_HALF_CONVERSIONS__ -D__CUDA_NO_BFLOAT16_CONVERSIONS__ -D__CUDA_NO_HALF2_OPERATORS__ --expt-relaxed-constexpr -gencode=arch=compute_61,code= compute_61 -gencode=arch=compute_61,code=sm_61 -std=c++17 -O3 -std=c++14 -U__CUDA_NO_HALF_OPERATORS__ -U__CUDA_NO_HALF_C ONVERSIONS__ -U__CUDA_NO_HALF2_OPERATORS__ -c C:\Users\WXZZ\Desktop\metahuman-stream-main\ernerf\raymarching\src\raymarc hing.cu -o raymarching.cuda.o cl: 命令行 warning D9025 :正在重写“/D__CUDA_NO_HALF_OPERATORS__”(用“/U__CUDA_NO_HALF_OPERATORS__”) cl: 命令行 warning D9025 :正在重写“/D__CUDA_NO_HALF_CONVERSIONS__”(用“/U__CUDA_NO_HALF_CONVERSIONS__”) cl: 命令行 warning D9025 :正在重写“/D__CUDA_NO_HALF2_OPERATORS__”(用“/U__CUDA_NO_HALF2_OPERATORS__”) raymarching.cu D:/Anaconda3/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.

备注:cuda 是12.6版本。 QQ截图20240802161058

wxzz avatar Aug 02 '24 08:08 wxzz

image

wxzz avatar Aug 02 '24 08:08 wxzz

更改成c++17了,还是报这个异常。Ubuntu22,g++ 11.4

charles4song avatar Aug 02 '24 12:08 charles4song

更改成c++17了,还是报这个异常。Ubuntu22,g++ 11.4

好了。有2个c++14,需要都替换了

charles4song avatar Aug 02 '24 12:08 charles4song

更改成c++17了,还是报这个异常。Ubuntu22,g++ 11.4

好了。有2个c++14,需要都替换了

@charles4song 我应该怎么操作一下?

wxzz avatar Aug 02 '24 14:08 wxzz

更改成c++17了,还是报这个异常。Ubuntu22,g++ 11.4

好了。有2个c++14,需要都替换了

@charles4song 我应该怎么操作一下?

搜索替换下。要不然容易疏忽

联想截图_20240802233059

charles4song avatar Aug 02 '24 15:08 charles4song

@charles4song 已经解决,谢谢。应该是nvcc_flags变量-std=c++17这的问题。

wxzz avatar Aug 03 '24 14:08 wxzz