ThibaultGROUEIX / ChamferDistancePytorch

Chamfer Distance in Pytorch with f-score
MIT License
336 stars 45 forks source link

error:Command '['ninja', '-v']' returned non-zero exit status 1. #31

Open TheVipar opened 1 year ago

TheVipar commented 1 year ago

dear mr, waht can i do to solve this problem may i get a advised version of python+torch+cuda from you?

running install running bdist_egg running egg_info writing chamfer_3D.egg-info/PKG-INFO writing dependency_links to chamfer_3D.egg-info/dependency_links.txt writing top-level names to chamfer_3D.egg-info/top_level.txt reading manifest file 'chamfer_3D.egg-info/SOURCES.txt' writing manifest file 'chamfer_3D.egg-info/SOURCES.txt' installing library code to build/bdist.linux-x86_64/egg running install_lib running build_ext building 'chamfer_3D' extension gcc -pthread -B /root/miniconda3/compiler_compat -Wl,--sysroot=/ -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -I/root/miniconda3/lib/python3.8/site-packages/torch/include -I/root/miniconda3/lib/python3.8/site-packages/torch/include/torch/csrc/api/include -I/root/miniconda3/lib/python3.8/site-packages/torch/include/TH -I/root/miniconda3/lib/python3.8/site-packages/torch/include/THC -I:/usr/local/cuda-11.0/include -I/root/miniconda3/include/python3.8 -c chamfer_cuda.cpp -o build/temp.linux-x86_64-3.8/chamfer_cuda.o -DTORCH_API_INCLUDE_EXTENSION_H -DPYBIND11_COMPILER_TYPE="_gcc" -DPYBIND11_STDLIB="_libstdcpp" -DPYBIND11_BUILD_ABI="_cxxabi1011" -DTORCH_EXTENSION_NAME=chamfer_3D -D_GLIBCXX_USE_CXX11_ABI=0 -std=c++14 cc1plus: warning: command line option ‘-Wstrict-prototypes’ is valid for C/ObjC but not for C++ In file included from /root/miniconda3/lib/python3.8/site-packages/torch/include/ATen/Parallel.h:149:0, from /root/miniconda3/lib/python3.8/site-packages/torch/include/torch/csrc/api/include/torch/utils.h:3, from /root/miniconda3/lib/python3.8/site-packages/torch/include/torch/csrc/api/include/torch/nn/cloneable.h:5, from /root/miniconda3/lib/python3.8/site-packages/torch/include/torch/csrc/api/include/torch/nn.h:3, from /root/miniconda3/lib/python3.8/site-packages/torch/include/torch/csrc/api/include/torch/all.h:12, from /root/miniconda3/lib/python3.8/site-packages/torch/include/torch/csrc/api/include/torch/torch.h:3, from chamfer_cuda.cpp:1: /root/miniconda3/lib/python3.8/site-packages/torch/include/ATen/ParallelOpenMP.h:84:0: warning: ignoring #pragma omp parallel [-Wunknown-pragmas]

pragma omp parallel for if ((end - begin) >= grain_size)

:/usr/local/cuda-11.0/bin/nvcc -I/root/miniconda3/lib/python3.8/site-packages/torch/include -I/root/miniconda3/lib/python3.8/site-packages/torch/include/torch/csrc/api/include -I/root/miniconda3/lib/python3.8/site-packages/torch/include/TH -I/root/miniconda3/lib/python3.8/site-packages/torch/include/THC -I:/usr/local/cuda-11.0/include -I/root/miniconda3/include/python3.8 -c chamfer3D.cu -o build/temp.linux-x86_64-3.8/chamfer3D.o -DCUDA_NO_HALF_OPERATORS -DCUDA_NO_HALF_CONVERSIONS -DCUDA_NO_HALF2_OPERATORS --expt-relaxed-constexpr --compiler-options '-fPIC' -DTORCH_API_INCLUDE_EXTENSION_H -DPYBIND11_COMPILER_TYPE="_gcc" -DPYBIND11_STDLIB="_libstdcpp" -DPYBIND11_BUILD_ABI="_cxxabi1011" -DTORCH_EXTENSION_NAME=chamfer_3D -D_GLIBCXX_USE_CXX11_ABI=0 -gencode=arch=compute_86,code=sm_86 -std=c++14 unable to execute ':/usr/local/cuda-11.0/bin/nvcc': No such file or directory error: command ':/usr/local/cuda-11.0/bin/nvcc' failed with exit status 1 (base) root@55987af7de94:~/chamfer3D# python setup.py install running install running bdist_egg running egg_info writing chamfer_3D.egg-info/PKG-INFO writing dependency_links to chamfer_3D.egg-info/dependency_links.txt writing top-level names to chamfer_3D.egg-info/top_level.txt reading manifest file 'chamfer_3D.egg-info/SOURCES.txt' writing manifest file 'chamfer_3D.egg-info/SOURCES.txt' installing library code to build/bdist.linux-x86_64/egg running install_lib running build_ext building 'chamfer_3D' extension Emitting ninja build file /root/chamfer3D/build/temp.linux-x86_64-3.8/build.ninja... Compiling objects... Allowing ninja to set a default number of workers... (overridable by setting the environment variable MAX_JOBS=N) [1/2] :/usr/local/cuda-11.0/bin/nvcc -I/root/miniconda3/lib/python3.8/site-packages/torch/include -I/root/miniconda3/lib/python3.8/site-packages/torch/include/torch/csrc/api/include -I/root/miniconda3/lib/python3.8/site-packages/torch/include/TH -I/root/miniconda3/lib/python3.8/site-packages/torch/include/THC -I:/usr/local/cuda-11.0/include -I/root/miniconda3/include/python3.8 -c -c /root/chamfer3D/chamfer3D.cu -o /root/chamfer3D/build/temp.linux-x86_64-3.8/chamfer3D.o -DCUDA_NO_HALF_OPERATORS -DCUDA_NO_HALF_CONVERSIONS -DCUDA_NO_HALF2_OPERATORS --expt-relaxed-constexpr --compiler-options ''"'"'-fPIC'"'"'' -DTORCH_API_INCLUDE_EXTENSION_H '-DPYBIND11_COMPILER_TYPE="_gcc"' '-DPYBIND11_STDLIB="_libstdcpp"' '-DPYBIND11_BUILD_ABI="_cxxabi1011"' -DTORCH_EXTENSION_NAME=chamfer_3D -D_GLIBCXX_USE_CXX11_ABI=0 -gencode=arch=compute_86,code=sm_86 -std=c++14 FAILED: /root/chamfer3D/build/temp.linux-x86_64-3.8/chamfer3D.o :/usr/local/cuda-11.0/bin/nvcc -I/root/miniconda3/lib/python3.8/site-packages/torch/include -I/root/miniconda3/lib/python3.8/site-packages/torch/include/torch/csrc/api/include -I/root/miniconda3/lib/python3.8/site-packages/torch/include/TH -I/root/miniconda3/lib/python3.8/site-packages/torch/include/THC -I:/usr/local/cuda-11.0/include -I/root/miniconda3/include/python3.8 -c -c /root/chamfer3D/chamfer3D.cu -o /root/chamfer3D/build/temp.linux-x86_64-3.8/chamfer3D.o -DCUDA_NO_HALF_OPERATORS -DCUDA_NO_HALF_CONVERSIONS -D__CUDA_NO_HALF2_OPERATORS__ --expt-relaxed-constexpr --compiler-options ''"'"'-fPIC'"'"'' -DTORCH_API_INCLUDE_EXTENSION_H '-DPYBIND11_COMPILER_TYPE="_gcc"' '-DPYBIND11_STDLIB="_libstdcpp"' '-DPYBIND11_BUILD_ABI="_cxxabi1011"' -DTORCH_EXTENSION_NAME=chamfer_3D -D_GLIBCXX_USE_CXX11_ABI=0 -gencode=arch=compute_86,code=sm_86 -std=c++14 /bin/sh: 1: :/usr/local/cuda-11.0/bin/nvcc: not found [2/2] c++ -MMD -MF /root/chamfer3D/build/temp.linux-x86_64-3.8/chamfer_cuda.o.d -pthread -B /root/miniconda3/compiler_compat -Wl,--sysroot=/ -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -I/root/miniconda3/lib/python3.8/site-packages/torch/include -I/root/miniconda3/lib/python3.8/site-packages/torch/include/torch/csrc/api/include -I/root/miniconda3/lib/python3.8/site-packages/torch/include/TH -I/root/miniconda3/lib/python3.8/site-packages/torch/include/THC -I:/usr/local/cuda-11.0/include -I/root/miniconda3/include/python3.8 -c -c /root/chamfer3D/chamfer_cuda.cpp -o /root/chamfer3D/build/temp.linux-x86_64-3.8/chamfer_cuda.o -DTORCH_API_INCLUDE_EXTENSION_H '-DPYBIND11_COMPILER_TYPE="_gcc"' '-DPYBIND11_STDLIB="_libstdcpp"' '-DPYBIND11_BUILD_ABI="_cxxabi1011"' -DTORCH_EXTENSION_NAME=chamfer_3D -D_GLIBCXX_USE_CXX11_ABI=0 -std=c++14 cc1plus: warning: command line option ‘-Wstrict-prototypes’ is valid for C/ObjC but not for C++ In file included from /root/miniconda3/lib/python3.8/site-packages/torch/include/ATen/Parallel.h:149:0, from /root/miniconda3/lib/python3.8/site-packages/torch/include/torch/csrc/api/include/torch/utils.h:3, from /root/miniconda3/lib/python3.8/site-packages/torch/include/torch/csrc/api/include/torch/nn/cloneable.h:5, from /root/miniconda3/lib/python3.8/site-packages/torch/include/torch/csrc/api/include/torch/nn.h:3, from /root/miniconda3/lib/python3.8/site-packages/torch/include/torch/csrc/api/include/torch/all.h:12, from /root/miniconda3/lib/python3.8/site-packages/torch/include/torch/csrc/api/include/torch/torch.h:3, from /root/chamfer3D/chamfer_cuda.cpp:1: /root/miniconda3/lib/python3.8/site-packages/torch/include/ATen/ParallelOpenMP.h:84:0: warning: ignoring #pragma omp parallel [-Wunknown-pragmas]

pragma omp parallel for if ((end - begin) >= grain_size)

ninja: build stopped: subcommand failed. Traceback (most recent call last): File "/root/miniconda3/lib/python3.8/site-packages/torch/utils/cpp_extension.py", line 1533, in _run_ninja_build subprocess.run( File "/root/miniconda3/lib/python3.8/subprocess.py", line 512, 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 "setup.py", line 4, in setup( File "/root/miniconda3/lib/python3.8/site-packages/setuptools/init.py", line 153, in setup return distutils.core.setup(**attrs) File "/root/miniconda3/lib/python3.8/distutils/core.py", line 148, in setup dist.run_commands() File "/root/miniconda3/lib/python3.8/distutils/dist.py", line 966, in run_commands self.run_command(cmd) File "/root/miniconda3/lib/python3.8/distutils/dist.py", line 985, in run_command cmd_obj.run() File "/root/miniconda3/lib/python3.8/site-packages/setuptools/command/install.py", line 67, in run self.do_egg_install() File "/root/miniconda3/lib/python3.8/site-packages/setuptools/command/install.py", line 109, in do_egg_install self.run_command('bdist_egg') File "/root/miniconda3/lib/python3.8/distutils/cmd.py", line 313, in run_command self.distribution.run_command(command) File "/root/miniconda3/lib/python3.8/distutils/dist.py", line 985, in run_command cmd_obj.run() File "/root/miniconda3/lib/python3.8/site-packages/setuptools/command/bdist_egg.py", line 167, in run cmd = self.call_command('install_lib', warn_dir=0) File "/root/miniconda3/lib/python3.8/site-packages/setuptools/command/bdist_egg.py", line 153, in call_command self.run_command(cmdname) File "/root/miniconda3/lib/python3.8/distutils/cmd.py", line 313, in run_command self.distribution.run_command(command) File "/root/miniconda3/lib/python3.8/distutils/dist.py", line 985, in run_command cmd_obj.run() File "/root/miniconda3/lib/python3.8/site-packages/setuptools/command/install_lib.py", line 11, in run self.build() File "/root/miniconda3/lib/python3.8/distutils/command/install_lib.py", line 107, in build self.run_command('build_ext') File "/root/miniconda3/lib/python3.8/distutils/cmd.py", line 313, in run_command self.distribution.run_command(command) File "/root/miniconda3/lib/python3.8/distutils/dist.py", line 985, in run_command cmd_obj.run() File "/root/miniconda3/lib/python3.8/site-packages/setuptools/command/build_ext.py", line 79, in run _build_ext.run(self) File "/root/miniconda3/lib/python3.8/distutils/command/build_ext.py", line 340, in run self.build_extensions() File "/root/miniconda3/lib/python3.8/site-packages/torch/utils/cpp_extension.py", line 670, in build_extensions build_ext.build_extensions(self) File "/root/miniconda3/lib/python3.8/distutils/command/build_ext.py", line 449, in build_extensions self._build_extensions_serial() File "/root/miniconda3/lib/python3.8/distutils/command/build_ext.py", line 474, in _build_extensions_serial self.build_extension(ext) File "/root/miniconda3/lib/python3.8/site-packages/setuptools/command/build_ext.py", line 196, in build_extension _build_ext.build_extension(self, ext) File "/root/miniconda3/lib/python3.8/distutils/command/build_ext.py", line 528, in build_extension objects = self.compiler.compile(sources, File "/root/miniconda3/lib/python3.8/site-packages/torch/utils/cpp_extension.py", line 491, in unix_wrap_ninja_compile _write_ninja_file_and_compile_objects( File "/root/miniconda3/lib/python3.8/site-packages/torch/utils/cpp_extension.py", line 1250, in _write_ninja_file_and_compile_objects _run_ninja_build( File "/root/miniconda3/lib/python3.8/site-packages/torch/utils/cpp_extension.py", line 1555, in _run_ninja_build raise RuntimeError(message) from e RuntimeError: Error compiling objects for extension

TheVipar commented 1 year ago

thank you so much

Hanhan952 commented 1 year ago

hi, I have the same problem, did you solve it??

qjin7796 commented 1 year ago

You can try changing ['ninja', '-v'] to ['ninja','--version'] in cpp_extension.py