Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

setup.py issue #13

Closed
Allianc-rgb opened this issue Nov 2, 2021 · 4 comments
Closed

setup.py issue #13

Allianc-rgb opened this issue Nov 2, 2021 · 4 comments

Comments

@Allianc-rgb
Copy link

Hi, Thanks for your great paper and code, I bnefit a lot.

But when I run python setup.py install --user manually under each dependency directory ,some errors occur:

running install
running bdist_egg
running egg_info
writing chamfer.egg-info/PKG-INFO
writing dependency_links to chamfer.egg-info/dependency_links.txt
writing top-level names to chamfer.egg-info/top_level.txt
reading manifest file 'chamfer.egg-info/SOURCES.txt'
writing manifest file 'chamfer.egg-info/SOURCES.txt'
installing library code to build/bdist.linux-x86_64/egg
running install_lib
running build_ext
building 'chamfer' extension
Emitting ninja build file /home/car/chr/PoinTr/extensions/chamfer_dist/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/1] :/usr/local/cuda-11.1/bin/nvcc -I/home/car/anaconda3/lib/python3.8/site-packages/torch/include -I/home/car/anaconda3/lib/python3.8/site-packages/torch/include/torch/csrc/api/include -I/home/car/anaconda3/lib/python3.8/site-packages/torch/include/TH -I/home/car/anaconda3/lib/python3.8/site-packages/torch/include/THC -I:/usr/local/cuda-11.1/include -I/home/car/anaconda3/include/python3.8 -c -c /home/car/chr/PoinTr/extensions/chamfer_dist/chamfer.cu -o /home/car/chr/PoinTr/extensions/chamfer_dist/build/temp.linux-x86_64-3.8/chamfer.o -D__CUDA_NO_HALF_OPERATORS__ -D__CUDA_NO_HALF_CONVERSIONS__ -D__CUDA_NO_BFLOAT16_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 -D_GLIBCXX_USE_CXX11_ABI=0 -gencode=arch=compute_50,code=compute_50 -gencode=arch=compute_50,code=sm_50 -std=c++14
FAILED: /home/car/chr/PoinTr/extensions/chamfer_dist/build/temp.linux-x86_64-3.8/chamfer.o
:/usr/local/cuda-11.1/bin/nvcc -I/home/car/anaconda3/lib/python3.8/site-packages/torch/include -I/home/car/anaconda3/lib/python3.8/site-packages/torch/include/torch/csrc/api/include -I/home/car/anaconda3/lib/python3.8/site-packages/torch/include/TH -I/home/car/anaconda3/lib/python3.8/site-packages/torch/include/THC -I:/usr/local/cuda-11.1/include -I/home/car/anaconda3/include/python3.8 -c -c /home/car/chr/PoinTr/extensions/chamfer_dist/chamfer.cu -o /home/car/chr/PoinTr/extensions/chamfer_dist/build/temp.linux-x86_64-3.8/chamfer.o -D__CUDA_NO_HALF_OPERATORS
-D__CUDA_NO_HALF_CONVERSIONS
_ -D__CUDA_NO_BFLOAT16_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 -D_GLIBCXX_USE_CXX11_ABI=0 -gencode=arch=compute_50,code=compute_50 -gencode=arch=compute_50,code=sm_50 -std=c++14
/bin/sh: 1: :/usr/local/cuda-11.1/bin/nvcc: not found
ninja: build stopped: subcommand failed.
Traceback (most recent call last):
File "/home/car/anaconda3/lib/python3.8/site-packages/torch/utils/cpp_extension.py", line 1666, in _run_ninja_build
subprocess.run(
File "/home/car/anaconda3/lib/python3.8/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 "setup.py", line 11, in
setup(name='chamfer',
File "/home/car/anaconda3/lib/python3.8/site-packages/setuptools/init.py", line 153, in setup
return distutils.core.setup(**attrs)
File "/home/car/anaconda3/lib/python3.8/distutils/core.py", line 148, in setup
dist.run_commands()
File "/home/car/anaconda3/lib/python3.8/distutils/dist.py", line 966, in run_commands
self.run_command(cmd)
File "/home/car/anaconda3/lib/python3.8/distutils/dist.py", line 985, in run_command
cmd_obj.run()
File "/home/car/anaconda3/lib/python3.8/site-packages/setuptools/command/install.py", line 67, in run
self.do_egg_install()
File "/home/car/anaconda3/lib/python3.8/site-packages/setuptools/command/install.py", line 109, in do_egg_install
self.run_command('bdist_egg')
File "/home/car/anaconda3/lib/python3.8/distutils/cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "/home/car/anaconda3/lib/python3.8/distutils/dist.py", line 985, in run_command
cmd_obj.run()
File "/home/car/anaconda3/lib/python3.8/site-packages/setuptools/command/bdist_egg.py", line 164, in run
cmd = self.call_command('install_lib', warn_dir=0)
File "/home/car/anaconda3/lib/python3.8/site-packages/setuptools/command/bdist_egg.py", line 150, in call_command
self.run_command(cmdname)
File "/home/car/anaconda3/lib/python3.8/distutils/cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "/home/car/anaconda3/lib/python3.8/distutils/dist.py", line 985, in run_command
cmd_obj.run()
File "/home/car/anaconda3/lib/python3.8/site-packages/setuptools/command/install_lib.py", line 11, in run
self.build()
File "/home/car/anaconda3/lib/python3.8/distutils/command/install_lib.py", line 107, in build
self.run_command('build_ext')
File "/home/car/anaconda3/lib/python3.8/distutils/cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "/home/car/anaconda3/lib/python3.8/distutils/dist.py", line 985, in run_command
cmd_obj.run()
File "/home/car/anaconda3/lib/python3.8/site-packages/setuptools/command/build_ext.py", line 79, in run
_build_ext.run(self)
File "/home/car/anaconda3/lib/python3.8/site-packages/Cython/Distutils/old_build_ext.py", line 186, in run
_build_ext.build_ext.run(self)
File "/home/car/anaconda3/lib/python3.8/distutils/command/build_ext.py", line 340, in run
self.build_extensions()
File "/home/car/anaconda3/lib/python3.8/site-packages/torch/utils/cpp_extension.py", line 709, in build_extensions
build_ext.build_extensions(self)
File "/home/car/anaconda3/lib/python3.8/site-packages/Cython/Distutils/old_build_ext.py", line 195, in build_extensions
_build_ext.build_ext.build_extensions(self)
File "/home/car/anaconda3/lib/python3.8/distutils/command/build_ext.py", line 449, in build_extensions
self._build_extensions_serial()
File "/home/car/anaconda3/lib/python3.8/distutils/command/build_ext.py", line 474, in _build_extensions_serial
self.build_extension(ext)
File "/home/car/anaconda3/lib/python3.8/site-packages/setuptools/command/build_ext.py", line 202, in build_extension
_build_ext.build_extension(self, ext)
File "/home/car/anaconda3/lib/python3.8/distutils/command/build_ext.py", line 528, in build_extension
objects = self.compiler.compile(sources,
File "/home/car/anaconda3/lib/python3.8/site-packages/torch/utils/cpp_extension.py", line 530, in unix_wrap_ninja_compile
_write_ninja_file_and_compile_objects(
File "/home/car/anaconda3/lib/python3.8/site-packages/torch/utils/cpp_extension.py", line 1355, in _write_ninja_file_and_compile_objects
_run_ninja_build(
File "/home/car/anaconda3/lib/python3.8/site-packages/torch/utils/cpp_extension.py", line 1682, in _run_ninja_build
raise RuntimeError(message) from e
RuntimeError: Error compiling objects for extension

This is my envs:
-- pytorch 1.9.1
-- python 3.8
-- cudnn 8.05
-- g++ 7.5.0
-- gcc 7.5.0
-- nvcc 11.1
-- ninja 1.10.2.git
I make sure cuda and cudnn both are appropriate, ninja is the latest version.Can you give me some advice? thank you a lot.

@yuxumin
Copy link
Owner

yuxumin commented Nov 2, 2021

@Allianc-rgb, Hi, try to reinstall the pytorch according to the cuda version in your server by conda. The cuda version for pytorch should be the same as nvcc -V. ( setup problems are mainly caused by the mismatching of cuda version.)

@Allianc-rgb
Copy link
Author

@Allianc-rgb, Hi, try to reinstall the pytorch according to the cuda version in your server by conda. The cuda version for pytorch should be the same as nvcc -V. ( setup problems are mainly caused by the mismatching of cuda version.)

OK, I'll try it

@yuxumin
Copy link
Owner

yuxumin commented Nov 2, 2021

Try it in a new virtual env to avoid other problems.

@Allianc-rgb
Copy link
Author

@yuxumin It works, thank you

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants