Closed Shreeyak closed 3 years ago
Getting the same error when trying to build from source:
~/work/ref-repos/chamferdist master python setup.py install
running install
running bdist_egg
running egg_info
creating chamferdist.egg-info
writing chamferdist.egg-info/PKG-INFO
writing dependency_links to chamferdist.egg-info/dependency_links.txt
writing requirements to chamferdist.egg-info/requires.txt
writing top-level names to chamferdist.egg-info/top_level.txt
writing manifest file 'chamferdist.egg-info/SOURCES.txt'
reading manifest file 'chamferdist.egg-info/SOURCES.txt'
writing manifest file 'chamferdist.egg-info/SOURCES.txt'
installing library code to build/bdist.linux-x86_64/egg
running install_lib
running build_py
creating build
creating build/lib.linux-x86_64-3.8
creating build/lib.linux-x86_64-3.8/chamferdist
copying chamferdist/__init__.py -> build/lib.linux-x86_64-3.8/chamferdist
copying chamferdist/chamfer.py -> build/lib.linux-x86_64-3.8/chamferdist
copying chamferdist/version.py -> build/lib.linux-x86_64-3.8/chamferdist
copying chamferdist/knn.cu -> build/lib.linux-x86_64-3.8/chamferdist
copying chamferdist/mink.cuh -> build/lib.linux-x86_64-3.8/chamferdist
copying chamferdist/index_utils.cuh -> build/lib.linux-x86_64-3.8/chamferdist
copying chamferdist/dispatch.cuh -> build/lib.linux-x86_64-3.8/chamferdist
copying chamferdist/cutils.h -> build/lib.linux-x86_64-3.8/chamferdist
copying chamferdist/knn.h -> build/lib.linux-x86_64-3.8/chamferdist
running build_ext
building 'chamferdist._C' extension
creating /home/shrek/work/ref-repos/chamferdist/build/temp.linux-x86_64-3.8
creating /home/shrek/work/ref-repos/chamferdist/build/temp.linux-x86_64-3.8/chamferdist
Emitting ninja build file /home/shrek/work/ref-repos/chamferdist/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/3] /usr/local/cuda-11.0/bin/nvcc -DWITH_CUDA -Ichamferdist -I/home/shrek/miniconda3/envs/cleargrasp/lib/python3.8/site-packages/torch/include -I/home/shrek/miniconda3/envs/cleargrasp/lib/python3.8/site-packages/torch/include/torch/csrc/api/include -I/home/shrek/miniconda3/envs/cleargrasp/lib/python3.8/site-packages/torch/include/TH -I/home/shrek/miniconda3/envs/cleargrasp/lib/python3.8/site-packages/torch/include/THC -I/usr/local/cuda-11.0/include -I/home/shrek/miniconda3/envs/cleargrasp/include/python3.8 -c -c /home/shrek/work/ref-repos/chamferdist/chamferdist/knn.cu -o /home/shrek/work/ref-repos/chamferdist/build/temp.linux-x86_64-3.8/chamferdist/knn.o -D__CUDA_NO_HALF_OPERATORS__ -D__CUDA_NO_HALF_CONVERSIONS__ -D__CUDA_NO_HALF2_OPERATORS__ --expt-relaxed-constexpr --compiler-options ''"'"'-fPIC'"'"'' -DCUDA_HAS_FP16=1 -D__CUDA_NO_HALF_OPERATORS__ -D__CUDA_NO_HALF_CONVERSIONS__ -D__CUDA_NO_HALF2_OPERATORS__ -DTORCH_API_INCLUDE_EXTENSION_H '-DPYBIND11_COMPILER_TYPE="_gcc"' '-DPYBIND11_STDLIB="_libstdcpp"' '-DPYBIND11_BUILD_ABI="_cxxabi1011"' -DTORCH_EXTENSION_NAME=_C -D_GLIBCXX_USE_CXX11_ABI=0 -gencode=arch=compute_86,code=sm_86 -std=c++14
FAILED: /home/shrek/work/ref-repos/chamferdist/build/temp.linux-x86_64-3.8/chamferdist/knn.o
/usr/local/cuda-11.0/bin/nvcc -DWITH_CUDA -Ichamferdist -I/home/shrek/miniconda3/envs/cleargrasp/lib/python3.8/site-packages/torch/include -I/home/shrek/miniconda3/envs/cleargrasp/lib/python3.8/site-packages/torch/include/torch/csrc/api/include -I/home/shrek/miniconda3/envs/cleargrasp/lib/python3.8/site-packages/torch/include/TH -I/home/shrek/miniconda3/envs/cleargrasp/lib/python3.8/site-packages/torch/include/THC -I/usr/local/cuda-11.0/include -I/home/shrek/miniconda3/envs/cleargrasp/include/python3.8 -c -c /home/shrek/work/ref-repos/chamferdist/chamferdist/knn.cu -o /home/shrek/work/ref-repos/chamferdist/build/temp.linux-x86_64-3.8/chamferdist/knn.o -D__CUDA_NO_HALF_OPERATORS__ -D__CUDA_NO_HALF_CONVERSIONS__ -D__CUDA_NO_HALF2_OPERATORS__ --expt-relaxed-constexpr --compiler-options ''"'"'-fPIC'"'"'' -DCUDA_HAS_FP16=1 -D__CUDA_NO_HALF_OPERATORS__ -D__CUDA_NO_HALF_CONVERSIONS__ -D__CUDA_NO_HALF2_OPERATORS__ -DTORCH_API_INCLUDE_EXTENSION_H '-DPYBIND11_COMPILER_TYPE="_gcc"' '-DPYBIND11_STDLIB="_libstdcpp"' '-DPYBIND11_BUILD_ABI="_cxxabi1011"' -DTORCH_EXTENSION_NAME=_C -D_GLIBCXX_USE_CXX11_ABI=0 -gencode=arch=compute_86,code=sm_86 -std=c++14
nvcc fatal : Unsupported gpu architecture 'compute_86'
[2/3] c++ -MMD -MF /home/shrek/work/ref-repos/chamferdist/build/temp.linux-x86_64-3.8/chamferdist/knn_cpu.o.d -pthread -B /home/shrek/miniconda3/envs/cleargrasp/compiler_compat -Wl,--sysroot=/ -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -DWITH_CUDA -Ichamferdist -I/home/shrek/miniconda3/envs/cleargrasp/lib/python3.8/site-packages/torch/include -I/home/shrek/miniconda3/envs/cleargrasp/lib/python3.8/site-packages/torch/include/torch/csrc/api/include -I/home/shrek/miniconda3/envs/cleargrasp/lib/python3.8/site-packages/torch/include/TH -I/home/shrek/miniconda3/envs/cleargrasp/lib/python3.8/site-packages/torch/include/THC -I/usr/local/cuda-11.0/include -I/home/shrek/miniconda3/envs/cleargrasp/include/python3.8 -c -c /home/shrek/work/ref-repos/chamferdist/chamferdist/knn_cpu.cpp -o /home/shrek/work/ref-repos/chamferdist/build/temp.linux-x86_64-3.8/chamferdist/knn_cpu.o -std=c++14 -DTORCH_API_INCLUDE_EXTENSION_H '-DPYBIND11_COMPILER_TYPE="_gcc"' '-DPYBIND11_STDLIB="_libstdcpp"' '-DPYBIND11_BUILD_ABI="_cxxabi1011"' -DTORCH_EXTENSION_NAME=_C -D_GLIBCXX_USE_CXX11_ABI=0
cc1plus: warning: command line option ‘-Wstrict-prototypes’ is valid for C/ObjC but not for C++
In file included from /home/shrek/miniconda3/envs/cleargrasp/lib/python3.8/site-packages/torch/include/ATen/Parallel.h:149:0,
from /home/shrek/miniconda3/envs/cleargrasp/lib/python3.8/site-packages/torch/include/torch/csrc/api/include/torch/utils.h:3,
from /home/shrek/miniconda3/envs/cleargrasp/lib/python3.8/site-packages/torch/include/torch/csrc/api/include/torch/nn/cloneable.h:5,
from /home/shrek/miniconda3/envs/cleargrasp/lib/python3.8/site-packages/torch/include/torch/csrc/api/include/torch/nn.h:3,
from /home/shrek/miniconda3/envs/cleargrasp/lib/python3.8/site-packages/torch/include/torch/csrc/api/include/torch/all.h:12,
from /home/shrek/miniconda3/envs/cleargrasp/lib/python3.8/site-packages/torch/include/torch/extension.h:4,
from /home/shrek/work/ref-repos/chamferdist/chamferdist/knn_cpu.cpp:3:
/home/shrek/miniconda3/envs/cleargrasp/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)
[3/3] c++ -MMD -MF /home/shrek/work/ref-repos/chamferdist/build/temp.linux-x86_64-3.8/chamferdist/ext.o.d -pthread -B /home/shrek/miniconda3/envs/cleargrasp/compiler_compat -Wl,--sysroot=/ -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -DWITH_CUDA -Ichamferdist -I/home/shrek/miniconda3/envs/cleargrasp/lib/python3.8/site-packages/torch/include -I/home/shrek/miniconda3/envs/cleargrasp/lib/python3.8/site-packages/torch/include/torch/csrc/api/include -I/home/shrek/miniconda3/envs/cleargrasp/lib/python3.8/site-packages/torch/include/TH -I/home/shrek/miniconda3/envs/cleargrasp/lib/python3.8/site-packages/torch/include/THC -I/usr/local/cuda-11.0/include -I/home/shrek/miniconda3/envs/cleargrasp/include/python3.8 -c -c /home/shrek/work/ref-repos/chamferdist/chamferdist/ext.cpp -o /home/shrek/work/ref-repos/chamferdist/build/temp.linux-x86_64-3.8/chamferdist/ext.o -std=c++14 -DTORCH_API_INCLUDE_EXTENSION_H '-DPYBIND11_COMPILER_TYPE="_gcc"' '-DPYBIND11_STDLIB="_libstdcpp"' '-DPYBIND11_BUILD_ABI="_cxxabi1011"' -DTORCH_EXTENSION_NAME=_C -D_GLIBCXX_USE_CXX11_ABI=0
cc1plus: warning: command line option ‘-Wstrict-prototypes’ is valid for C/ObjC but not for C++
In file included from /home/shrek/miniconda3/envs/cleargrasp/lib/python3.8/site-packages/torch/include/ATen/Parallel.h:149:0,
from /home/shrek/miniconda3/envs/cleargrasp/lib/python3.8/site-packages/torch/include/torch/csrc/api/include/torch/utils.h:3,
from /home/shrek/miniconda3/envs/cleargrasp/lib/python3.8/site-packages/torch/include/torch/csrc/api/include/torch/nn/cloneable.h:5,
from /home/shrek/miniconda3/envs/cleargrasp/lib/python3.8/site-packages/torch/include/torch/csrc/api/include/torch/nn.h:3,
from /home/shrek/miniconda3/envs/cleargrasp/lib/python3.8/site-packages/torch/include/torch/csrc/api/include/torch/all.h:12,
from /home/shrek/miniconda3/envs/cleargrasp/lib/python3.8/site-packages/torch/include/torch/extension.h:4,
from /home/shrek/work/ref-repos/chamferdist/chamferdist/ext.cpp:1:
/home/shrek/miniconda3/envs/cleargrasp/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 "/home/shrek/miniconda3/envs/cleargrasp/lib/python3.8/site-packages/torch/utils/cpp_extension.py", line 1533, in _run_ninja_build
subprocess.run(
File "/home/shrek/miniconda3/envs/cleargrasp/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 76, in <module>
setup(
File "/home/shrek/miniconda3/envs/cleargrasp/lib/python3.8/site-packages/setuptools/__init__.py", line 153, in setup
return distutils.core.setup(**attrs)
File "/home/shrek/miniconda3/envs/cleargrasp/lib/python3.8/distutils/core.py", line 148, in setup
dist.run_commands()
File "/home/shrek/miniconda3/envs/cleargrasp/lib/python3.8/distutils/dist.py", line 966, in run_commands
self.run_command(cmd)
File "/home/shrek/miniconda3/envs/cleargrasp/lib/python3.8/distutils/dist.py", line 985, in run_command
cmd_obj.run()
File "/home/shrek/miniconda3/envs/cleargrasp/lib/python3.8/site-packages/setuptools/command/install.py", line 67, in run
self.do_egg_install()
File "/home/shrek/miniconda3/envs/cleargrasp/lib/python3.8/site-packages/setuptools/command/install.py", line 109, in do_egg_install
self.run_command('bdist_egg')
File "/home/shrek/miniconda3/envs/cleargrasp/lib/python3.8/distutils/cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "/home/shrek/miniconda3/envs/cleargrasp/lib/python3.8/distutils/dist.py", line 985, in run_command
cmd_obj.run()
File "/home/shrek/miniconda3/envs/cleargrasp/lib/python3.8/site-packages/setuptools/command/bdist_egg.py", line 167, in run
cmd = self.call_command('install_lib', warn_dir=0)
File "/home/shrek/miniconda3/envs/cleargrasp/lib/python3.8/site-packages/setuptools/command/bdist_egg.py", line 153, in call_command
self.run_command(cmdname)
File "/home/shrek/miniconda3/envs/cleargrasp/lib/python3.8/distutils/cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "/home/shrek/miniconda3/envs/cleargrasp/lib/python3.8/distutils/dist.py", line 985, in run_command
cmd_obj.run()
File "/home/shrek/miniconda3/envs/cleargrasp/lib/python3.8/site-packages/setuptools/command/install_lib.py", line 11, in run
self.build()
File "/home/shrek/miniconda3/envs/cleargrasp/lib/python3.8/distutils/command/install_lib.py", line 107, in build
self.run_command('build_ext')
File "/home/shrek/miniconda3/envs/cleargrasp/lib/python3.8/distutils/cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "/home/shrek/miniconda3/envs/cleargrasp/lib/python3.8/distutils/dist.py", line 985, in run_command
cmd_obj.run()
File "/home/shrek/miniconda3/envs/cleargrasp/lib/python3.8/site-packages/setuptools/command/build_ext.py", line 79, in run
_build_ext.run(self)
File "/home/shrek/miniconda3/envs/cleargrasp/lib/python3.8/distutils/command/build_ext.py", line 340, in run
self.build_extensions()
File "/home/shrek/miniconda3/envs/cleargrasp/lib/python3.8/site-packages/torch/utils/cpp_extension.py", line 670, in build_extensions
build_ext.build_extensions(self)
File "/home/shrek/miniconda3/envs/cleargrasp/lib/python3.8/distutils/command/build_ext.py", line 449, in build_extensions
self._build_extensions_serial()
File "/home/shrek/miniconda3/envs/cleargrasp/lib/python3.8/distutils/command/build_ext.py", line 474, in _build_extensions_serial
self.build_extension(ext)
File "/home/shrek/miniconda3/envs/cleargrasp/lib/python3.8/site-packages/setuptools/command/build_ext.py", line 196, in build_extension
_build_ext.build_extension(self, ext)
File "/home/shrek/miniconda3/envs/cleargrasp/lib/python3.8/distutils/command/build_ext.py", line 528, in build_extension
objects = self.compiler.compile(sources,
File "/home/shrek/miniconda3/envs/cleargrasp/lib/python3.8/site-packages/torch/utils/cpp_extension.py", line 491, in unix_wrap_ninja_compile
_write_ninja_file_and_compile_objects(
File "/home/shrek/miniconda3/envs/cleargrasp/lib/python3.8/site-packages/torch/utils/cpp_extension.py", line 1250, in _write_ninja_file_and_compile_objects
_run_ninja_build(
File "/home/shrek/miniconda3/envs/cleargrasp/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
I had similar issues on an RTX3090; here's what worked for me as of today.
python 3.6 (didn't try 3.7 or 3.9) torch 1.7.1 (torch. 1.7.0 worked too) cudatoolkit 10.2 or 11.0 (nvcc version 11.2)
I'd be curious to know if other versions worked for you.
Thanks! Turns out to be some problem with CUDA 11.0. I installed CUDA 11.1 and compiled pytorch 1.7.1 from source. That fixed my issues! I'm using Python 3.7.7
Unable to install from pip or compile from source for CUDA 11.0 (Using Ampere GPUs) Any tips to fix?
Here's the complete log (it's large):