spconv icon indicating copy to clipboard operation
spconv copied to clipboard

nvlink fatal : Could not open input file '/usr/lib/x86_64-linux-gnu/libpthread.a'

Open SteveJMao opened this issue 1 year ago • 5 comments

Following the instructions, when running ‘python setup.py bdist_wheel’ , I got caught in: [ 95%] Linking CUDA device code CMakeFiles/spconv.dir/cmake_device_link.o nvlink fatal : Could not open input file '/usr/lib/x86_64-linux-gnu/libpthread.a' make[2]: *** [src/spconv/CMakeFiles/spconv.dir/build.make:293: src/spconv/CMakeFiles/spconv.dir/cmake_device_link.o] Error 1 make[1]: *** [CMakeFiles/Makefile2:180: src/spconv/CMakeFiles/spconv.dir/all] Error 2 make: *** [Makefile:136: all] Error 2 Traceback (most recent call last): File "setup.py", line 108, in zip_safe=False, File "/home/user4/.conda/envs/coalign/lib/python3.7/site-packages/setuptools/init.py", line 108, in setup return distutils.core.setup(**attrs) File "/home/user4/.conda/envs/coalign/lib/python3.7/site-packages/setuptools/_distutils/core.py", line 185, in setup return run_commands(dist) File "/home/user4/.conda/envs/coalign/lib/python3.7/site-packages/setuptools/_distutils/core.py", line 201, in run_commands dist.run_commands() File "/home/user4/.conda/envs/coalign/lib/python3.7/site-packages/setuptools/_distutils/dist.py", line 969, in run_commands self.run_command(cmd) File "/home/user4/.conda/envs/coalign/lib/python3.7/site-packages/setuptools/dist.py", line 1221, in run_command super().run_command(command) File "/home/user4/.conda/envs/coalign/lib/python3.7/site-packages/setuptools/_distutils/dist.py", line 988, in run_command cmd_obj.run() File "/home/user4/.conda/envs/coalign/lib/python3.7/site-packages/wheel/bdist_wheel.py", line 343, in run self.run_command("build") File "/home/user4/.conda/envs/coalign/lib/python3.7/site-packages/setuptools/_distutils/cmd.py", line 318, in run_command self.distribution.run_command(command) File "/home/user4/.conda/envs/coalign/lib/python3.7/site-packages/setuptools/dist.py", line 1221, in run_command super().run_command(command) File "/home/user4/.conda/envs/coalign/lib/python3.7/site-packages/setuptools/_distutils/dist.py", line 988, in run_command cmd_obj.run() File "/home/user4/.conda/envs/coalign/lib/python3.7/site-packages/setuptools/_distutils/command/build.py", line 131, in run self.run_command(cmd_name) File "/home/user4/.conda/envs/coalign/lib/python3.7/site-packages/setuptools/_distutils/cmd.py", line 318, in run_command self.distribution.run_command(command) File "/home/user4/.conda/envs/coalign/lib/python3.7/site-packages/setuptools/dist.py", line 1221, in run_command super().run_command(command) File "/home/user4/.conda/envs/coalign/lib/python3.7/site-packages/setuptools/_distutils/dist.py", line 988, in run_command cmd_obj.run() File "setup.py", line 48, in run self.build_extension(ext) File "setup.py", line 92, in build_extension subprocess.check_call(['cmake', '--build', '.'] + build_args, cwd=self.build_temp) File "/home/user4/.conda/envs/coalign/lib/python3.7/subprocess.py", line 363, in check_call raise CalledProcessError(retcode, cmd) subprocess.CalledProcessError: Command '['cmake', '--build', '.', '--config', 'Release', '--', '-j4']' returned non-zero exit status 2.

I have no idea how to solve the problem and looking forward to hearing from you soon. Thanks! BTW, my system configuration: Operating system: ubuntu 20.04 Compiler: gcc 9.4.0 CUDA version (if applicable): 11.3 CUDNN version (if applicable):8.4.1.50 Python version: 3.7.12

SteveJMao avatar Apr 14 '23 05:04 SteveJMao

I just solved the issue, by removing Line 7 - 10 of src/spconv/CMakeLists.txt.

These four lines of code should be removed somehow,

find_package(OpenMP)
if(OpenMP_CXX_FOUND)
    target_link_libraries(spconv PUBLIC OpenMP::OpenMP_CXX)
endif()

netbeifeng avatar May 03 '23 05:05 netbeifeng

hi, have u solved it ? I have the same error when runningpython setup.py bdist_wheel, could u give me some advice

DurbinLiu avatar Jan 19 '24 15:01 DurbinLiu

I just solved the issue, by removing Line 7 - 10 of src/spconv/CMakeLists.txt.

These four lines of code should be removed somehow,

find_package(OpenMP)
if(OpenMP_CXX_FOUND)
    target_link_libraries(spconv PUBLIC OpenMP::OpenMP_CXX)
endif()

Hi, I successfully installed spconv1.2.1 as your advice. However, when training the Error comes as follows: "ImportError: cannot import name 'spconv_utils' from partially initialized module 'spconv' (most likely due to a circular import) (/home/durbin/projs/spconv/spconv/init.py)" So maybe it is not a good solution.

DurbinLiu avatar Jan 19 '24 15:01 DurbinLiu

How about this?

  1. source ~/.bashrc
  2. conda activate <your_env>
  3. python setup.py bdist_wheel

shnshnslin avatar Jun 20 '24 00:06 shnshnslin

I have solved the issue. This may caused by the low version of cuda. You can use a higer version of cuda when compiling by adding a line in the line 57 in spconv/setup.py of v1.2.1. For example, if you want to use the cuda-11.8, please add: '-DCMAKE_CUDA_COMPILER=/usr/local/cuda-11.8/bin/nvcc'

hollow-503 avatar Aug 02 '24 10:08 hollow-503