hanhung / PureCLIPNeRF

Other
174 stars 8 forks source link

Get a building error: subprocess.CalledProcessError: Command '['ninja', '-v']' returned non-zero exit status 1. #2

Open HelixNGC7293 opened 2 years ago

HelixNGC7293 commented 2 years ago

I tries to run the code on Windows, but got this error when building "render_utils_cuda", here is the full log message:

Using C:\Users\qwswe\AppData\Local\torch_extensions\torch_extensions\Cache\py38_cu113 as PyTorch extensions root... Detected CUDA files, patching ldflags Emitting ninja build file C:\Users\qwswe\AppData\Local\torch_extensions\torch_extensions\Cache\py38_cu113\adam_upd_cuda\build.ninja... Building extension module adam_upd_cuda... Allowing ninja to set a default number of workers... (overridable by setting the environment variable MAX_JOBS=N) ninja: no work to do. Loading extension module adam_upd_cuda... Using C:\Users\qwswe\AppData\Local\torch_extensions\torch_extensions\Cache\py38_cu113 as PyTorch extensions root... Detected CUDA files, patching ldflags Emitting ninja build file C:\Users\qwswe\AppData\Local\torch_extensions\torch_extensions\Cache\py38_cu113\render_utils_cuda\build.ninja... Building extension module render_utils_cuda... Allowing ninja to set a default number of workers... (overridable by setting the environment variable MAX_JOBS=N) [1/2] C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.2\bin\nvcc --generate-dependencies-with-compile --dependency-output render_utils_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=render_utils_cuda -DTORCH_API_INCLUDE_EXTENSION_H -IC:\Users\qwswe\Anaconda3\envs\PureCLIPNeRF\lib\site-packages\torch\include -IC:\Users\qwswe\Anaconda3\envs\PureCLIPNeRF\lib\site-packages\torch\include\torch\csrc\api\include -IC:\Users\qwswe\Anaconda3\envs\PureCLIPNeRF\lib\site-packages\torch\include\TH -IC:\Users\qwswe\Anaconda3\envs\PureCLIPNeRF\lib\site-packages\torch\include\THC "-IC:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.2\include" -IC:\Users\qwswe\Anaconda3\envs\PureCLIPNeRF\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 -c D:\AI\PureCLIPNeRF\lib\cuda\render_utils_kernel.cu -o render_utils_kernel.cuda.o FAILED: render_utils_kernel.cuda.o C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.2\bin\nvcc --generate-dependencies-with-compile --dependency-output render_utils_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=render_utils_cuda -DTORCH_API_INCLUDE_EXTENSION_H -IC:\Users\qwswe\Anaconda3\envs\PureCLIPNeRF\lib\site-packages\torch\include -IC:\Users\qwswe\Anaconda3\envs\PureCLIPNeRF\lib\site-packages\torch\include\torch\csrc\api\include -IC:\Users\qwswe\Anaconda3\envs\PureCLIPNeRF\lib\site-packages\torch\include\TH -IC:\Users\qwswe\Anaconda3\envs\PureCLIPNeRF\lib\site-packages\torch\include\THC "-IC:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.2\include" -IC:\Users\qwswe\Anaconda3\envs\PureCLIPNeRF\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 -c D:\AI\PureCLIPNeRF\lib\cuda\render_utils_kernel.cu -o render_utils_kernel.cuda.o C:/Users/qwswe/Anaconda3/envs/PureCLIPNeRF/lib/site-packages/torch/include\c10/macros/Macros.h(142): warning C4067: unexpected tokens following preprocessor directive - expected a newline C:\Users\qwswe\Anaconda3\envs\PureCLIPNeRF\lib\site-packages\torch\include\pybind11\detail/common.h(108): warning C4005: 'HAVE_SNPRINTF': macro redefinition C:\Users\qwswe\Anaconda3\envs\PureCLIPNeRF\Include\pyerrors.h(315): note: see previous definition of 'HAVE_SNPRINTF' C:/Users/qwswe/Anaconda3/envs/PureCLIPNeRF/lib/site-packages/torch/include\c10/macros/Macros.h(142): warning C4067: unexpected tokens following preprocessor directive - expected a newline C:\Users\qwswe\Anaconda3\envs\PureCLIPNeRF\lib\site-packages\torch\include\pybind11\detail/common.h(108): warning C4005: 'HAVE_SNPRINTF': macro redefinition C:\Users\qwswe\Anaconda3\envs\PureCLIPNeRF\Include\pyerrors.h(315): note: see previous definition of 'HAVE_SNPRINTF' D:/AI/PureCLIPNeRF/lib/cuda/render_utils_kernel.cu(47): error: calling a host function("ceilf") from a global__ function("infer_n_samples_cuda_kernel ") is not allowed

D:/AI/PureCLIPNeRF/lib/cuda/render_utils_kernel.cu(47): error: identifier "__ceilf" is undefined in device code

D:/AI/PureCLIPNeRF/lib/cuda/render_utils_kernel.cu(312): error: calling a host function("roundf") from a global__ function("maskcache_lookup_cuda_kernel ") is not allowed

D:/AI/PureCLIPNeRF/lib/cuda/render_utils_kernel.cu(312): error: identifier "__roundf" is undefined in device code

D:/AI/PureCLIPNeRF/lib/cuda/render_utils_kernel.cu(313): error: calling a host function("roundf") from a global__ function("maskcache_lookup_cuda_kernel ") is not allowed

D:/AI/PureCLIPNeRF/lib/cuda/render_utils_kernel.cu(313): error: identifier "__roundf" is undefined in device code

D:/AI/PureCLIPNeRF/lib/cuda/render_utils_kernel.cu(314): error: calling a host function("roundf") from a global__ function("maskcache_lookup_cuda_kernel ") is not allowed

D:/AI/PureCLIPNeRF/lib/cuda/render_utils_kernel.cu(314): error: identifier "__roundf" is undefined in device code

8 errors detected in the compilation of "D:/AI/PureCLIPNeRF/lib/cuda/render_utils_kernel.cu". render_utils_kernel.cu ninja: build stopped: subcommand failed. Traceback (most recent call last): File "C:\Users\qwswe\Anaconda3\envs\PureCLIPNeRF\lib\site-packages\torch\utils\cpp_extension.py", line 1808, in _run_ninja_build subprocess.run( File "C:\Users\qwswe\Anaconda3\envs\PureCLIPNeRF\lib\subprocess.py", line 516, 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 "run.py", line 23, in import train_exp, train_imp File "D:\AI\PureCLIPNeRF\train_exp.py", line 23, in from lib import utils, dvgo_exp File "D:\AI\PureCLIPNeRF\lib\dvgo_exp.py", line 18, in render_utils_cuda = load( File "C:\Users\qwswe\Anaconda3\envs\PureCLIPNeRF\lib\site-packages\torch\utils\cpp_extension.py", line 1202, in load return _jit_compile( File "C:\Users\qwswe\Anaconda3\envs\PureCLIPNeRF\lib\site-packages\torch\utils\cpp_extension.py", line 1425, in _jit_compile _write_ninja_file_and_build_library( File "C:\Users\qwswe\Anaconda3\envs\PureCLIPNeRF\lib\site-packages\torch\utils\cpp_extension.py", line 1537, in _write_ninja_file_and_build_library _run_ninja_build( File "C:\Users\qwswe\Anaconda3\envs\PureCLIPNeRF\lib\site-packages\torch\utils\cpp_extension.py", line 1824, in _run_ninja_build raise RuntimeError(message) from e RuntimeError: Error building extension 'render_utils_cuda'

Is this a pytorch compatible issue? I'm using pytorch 1.11

hanhung commented 2 years ago

I think it is probably a problem with the compilation environment you are using in Windows. There seems to be related issues in the original DVGO repo: https://github.com/sunset1995/DirectVoxGO/issues/32, https://github.com/sunset1995/DirectVoxGO/issues/13 that might help you get the code running on Windows.