erikwijmans / Pointnet2_PyTorch

PyTorch implementation of Pointnet2/Pointnet++
The Unlicense
1.52k stars 343 forks source link

pointnet2_ops install problem #174

Closed Chopper-233 closed 3 weeks ago

Chopper-233 commented 1 year ago

os:python3.8 cuda 11.3 pytorch 1.10.1 while i'm running the command pip install "git+https://github.com/erikwijmans/Pointnet2_PyTorch.git#egg=pointnet2_ops&subdirectory=pointnet2_ops_lib", i meet the issue following,and i try many solutions found on the internet but no one worked,i hope you can help me solve it nvcc warning : The 'compute_35', 'compute_37', 'compute_50', 'sm_35', 'sm_37' and 'sm_50' architectures are deprecated, and may be removed in a future release (Use -Wno-deprecated-gpu-targets to suppress warning). ninja: build stopped: subcommand failed. Traceback (most recent call last): File "D:\Anaconda\envs\ulip\lib\site-packages\torch\utils\cpp_extension.py", line 1723, in _run_ninja_build env=env) File "D:\Anaconda\envs\ulip\lib\subprocess.py", line 512, in run output=stdout, stderr=stderr) 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 "<string>", line 36, in <module>
    File "<pip-setuptools-caller>", line 34, in <module>
    File "C:\Users\李文峤\AppData\Local\Temp\pip-install-kwvdlqzz\pointnet2-ops_fc850762ca7249e1bbcb92749807b38c\pointnet2_ops_lib\setup.py", line 38, in <module>
      include_package_data=True,
    File "D:\Anaconda\envs\ulip\lib\site-packages\setuptools\__init__.py", line 87, in setup
      return distutils.core.setup(**attrs)
    File "D:\Anaconda\envs\ulip\lib\site-packages\setuptools\_distutils\core.py", line 185, in setup
      return run_commands(dist)
    File "D:\Anaconda\envs\ulip\lib\site-packages\setuptools\_distutils\core.py", line 201, in run_commands
      dist.run_commands()
    File "D:\Anaconda\envs\ulip\lib\site-packages\setuptools\_distutils\dist.py", line 969, in run_commands
      self.run_command(cmd)
    File "D:\Anaconda\envs\ulip\lib\site-packages\setuptools\dist.py", line 1208, in run_command
      super().run_command(command)
    File "D:\Anaconda\envs\ulip\lib\site-packages\setuptools\_distutils\dist.py", line 988, in run_command
      cmd_obj.run()
    File "D:\Anaconda\envs\ulip\lib\site-packages\setuptools\command\install.py", line 68, in run
      return orig.install.run(self)
    File "D:\Anaconda\envs\ulip\lib\site-packages\setuptools\_distutils\command\install.py", line 698, in run
      self.run_command('build')
    File "D:\Anaconda\envs\ulip\lib\site-packages\setuptools\_distutils\cmd.py", line 318, in run_command
      self.distribution.run_command(command)
    File "D:\Anaconda\envs\ulip\lib\site-packages\setuptools\dist.py", line 1208, in run_command
      super().run_command(command)
    File "D:\Anaconda\envs\ulip\lib\site-packages\setuptools\_distutils\dist.py", line 988, in run_command
      cmd_obj.run()
    File "D:\Anaconda\envs\ulip\lib\site-packages\setuptools\_distutils\command\build.py", line 132, in run
      self.run_command(cmd_name)
    File "D:\Anaconda\envs\ulip\lib\site-packages\setuptools\_distutils\cmd.py", line 318, in run_command
      self.distribution.run_command(command)
    File "D:\Anaconda\envs\ulip\lib\site-packages\setuptools\dist.py", line 1208, in run_command
      super().run_command(command)
    File "D:\Anaconda\envs\ulip\lib\site-packages\setuptools\_distutils\dist.py", line 988, in run_command
      cmd_obj.run()
    File "D:\Anaconda\envs\ulip\lib\site-packages\setuptools\command\build_ext.py", line 84, in run
      _build_ext.run(self)
    File "D:\Anaconda\envs\ulip\lib\site-packages\setuptools\_distutils\command\build_ext.py", line 346, in run
      self.build_extensions()
    File "D:\Anaconda\envs\ulip\lib\site-packages\torch\utils\cpp_extension.py", line 735, in build_extensions
      build_ext.build_extensions(self)
    File "D:\Anaconda\envs\ulip\lib\site-packages\setuptools\_distutils\command\build_ext.py", line 468, in build_extensions
      self._build_extensions_serial()
    File "D:\Anaconda\envs\ulip\lib\site-packages\setuptools\_distutils\command\build_ext.py", line 494, in _build_extensions_serial
      self.build_extension(ext)
    File "D:\Anaconda\envs\ulip\lib\site-packages\setuptools\command\build_ext.py", line 246, in build_extension
      _build_ext.build_extension(self, ext)
    File "D:\Anaconda\envs\ulip\lib\site-packages\setuptools\_distutils\command\build_ext.py", line 556, in build_extension
      depends=ext.depends,
    File "D:\Anaconda\envs\ulip\lib\site-packages\torch\utils\cpp_extension.py", line 717, in win_wrap_ninja_compile
      with_cuda=with_cuda)
    File "D:\Anaconda\envs\ulip\lib\site-packages\torch\utils\cpp_extension.py", line 1404, in _write_ninja_file_and_compile_objects
      error_prefix='Error compiling objects for extension')
    File "D:\Anaconda\envs\ulip\lib\site-packages\torch\utils\cpp_extension.py", line 1733, in _run_ninja_build
      raise RuntimeError(message) from e
  RuntimeError: Error compiling objects for extension
  [end of output]

note: This error originates from a subprocess, and is likely not a problem with pip. error: legacy-install-failure

× Encountered error while trying to install package. ╰─> pointnet2_ops

note: This is an issue with the package mentioned above, not pip. hint: See above for output from the failure.

zhaotong96 commented 1 year ago

Same problem , are you figure it out?

nasheizhidaoei commented 1 year ago

@Chopper-233 hey bro, have you figure out this problem? thanks!

Pipe-Runner commented 1 year ago

Use PyTorch version: 1.13 with CUDA Toolkit version 11.7 conda install pytorch==1.13.0 torchvision==0.14.0 torchaudio==0.13.0 pytorch-cuda=11.7 -c pytorch -c nvidia

Then install CUDA toolkit version 11.7 as well: https://developer.nvidia.com/cuda-11-7-0-download-archive

Once installed make sure to add the following to bashrc/zshrc:

export LD_LIBRARY_PATH="/usr/local/cuda-11.7/lib64:$LD_LIBRARY_PATH"
export PATH="/usr/local/cuda-11.7/bin:$PATH"

Start new shell, run pip install -r requirements.txt. It will work. I was trying with latest version of pyTorch with CUDA toolkit version 12.1 but it was failing to compile.

Be aware that you don't need to downgrade the driver while installing outdated version of CUDA toolkit. I am using 530 driver.

mujtabaasad commented 1 year ago

I am still getting the same error even with pytorch==1.13.0 torchvision==0.14.0 torchaudio==0.13.0 pytorch-cuda=11.7 . Did anyone solved it??

plebbyd commented 12 months ago

I am having this issue and none of the recommendations are working. If anyone who has been able to get the CUDA kernels to build successfully can help, that would be much appreciated.

TouqeerAhmad commented 11 months ago

@plebbyd did you have any success with this? I installed PyTorch 1.13 with CUDA 11.7 as @Pipe-Runner advised. Also Installed the CUDA toolkit version 11.7 and then set the environment variables properly as suggested above and in other issues on this repo. I am still not able to run the pip install -r requirements.txt successfully.

I am on Ubuntu 22.04.3 LTS in a Conda virtual env.

Any advise?

ZewLin commented 9 months ago

@Pipe-Runner Thanks a lot bro,your advice works for me!!!

printpal-io commented 9 months ago

@plebbyd did you have any success with this? I installed PyTorch 1.13 with CUDA 11.7 as @Pipe-Runner advised. Also Installed the CUDA toolkit version 11.7 and then set the environment variables properly as suggested above and in other issues on this repo. I am still not able to run the pip install -r requirements.txt successfully.

I am on Ubuntu 22.04.3 LTS in a Conda virtual env.

Any advise?

@TouqeerAhmad this is Plebbyd on the company GitHub account. I was able to get it installed by using a very specific OS and set of libraries. See here: https://github.com/junshengzhou/3D-OAE/issues/4#issuecomment-1817906072

Hetal-patel1994 commented 8 months ago

@TouqeerAhmad did you got any solution??? I was working on Ubuntu 22.04.3 LTS in a Conda virtual env but got few errors and later figured out pip install -r requirements.txt needs gcc version < 10.0 which is not possible with Ubuntu 22.04 LTS.

I was able to run pip install -r requirements.txt on Ubuntu 20.04 LTS in a conda virtual env with gcc version 9.4.0
PyTorch version: 1.13 with CUDA Toolkit version 11.7

heidapao2b commented 6 months ago

The following problems occur: note: This error originates from a subprocess, and is likely not a problem with pip. ERROR: Failed building wheel for pointnet2_ops Running setup.py clean for pointnet2_ops error: subprocess-exited-with-error

× python setup.py clean did not run successfully. │ exit code: 1 ╰─> [6 lines of output] Traceback (most recent call last): File "", line 2, in File "", line 34, in File "/home/flk/Workspace/M3DM/Pointnet2_PyTorch/pointnet2_ops_lib/pip-install-zfrk2e2k/pointnet2-ops_df35402efea9452981365e177e43d4da/pointnet2_ops_lib/setup.py", line 17, in exec(open(osp.join("pointnet2_ops", "_version.py")).read()) FileNotFoundError: [Errno 2] No such file or directory: 'pointnet2_ops/_version.py' [end of output]

note: This error originates from a subprocess, and is likely not a problem with pip. ERROR: Failed cleaning build dir for pointnet2_ops Failed to build pointnet2_ops ERROR: Could not build wheels for pointnet2_ops, which is required to install pyproject.toml-based projects

JINXER000 commented 3 months ago

I solved it by revising setup.py in pointcloud2_ops_lib: from

os.environ["TORCH_CUDA_ARCH_LIST"] = "3.7+PTX;5.0;6.0;6.1;6.2;7.0;7.5"

to

os.environ["TORCH_CUDA_ARCH_LIST"] = "8.6"

As the GPU arch does not match that of my computer. To customize the arch on your own PC, you can find it in this https://stackoverflow.com/questions/68496906/pytorch-installation-for-different-cuda-architectures

legel commented 2 months ago

The solution by @JINXER000 worked for me on a A100 GPU.

anoushkrit commented 1 month ago

Solution by @JINXER000 worked for me, on A6000. Thanks a lot man!!

ZeroMeOut commented 1 month ago

I solved it by revising setup.py in pointcloud2_ops_lib: from

os.environ["TORCH_CUDA_ARCH_LIST"] = "3.7+PTX;5.0;6.0;6.1;6.2;7.0;7.5"

to

os.environ["TORCH_CUDA_ARCH_LIST"] = "8.6"

As the GPU arch does not match that of my computer. To customize the arch on your own PC, you can find it in this https://stackoverflow.com/questions/68496906/pytorch-installation-for-different-cuda-architectures

Thank you so much. It worked for me on a 3050.

chuanfushen commented 3 weeks ago

Use PyTorch version: 1.13 with CUDA Toolkit version 11.7 conda install pytorch==1.13.0 torchvision==0.14.0 torchaudio==0.13.0 pytorch-cuda=11.7 -c pytorch -c nvidia

Then install CUDA toolkit version 11.7 as well: https://developer.nvidia.com/cuda-11-7-0-download-archive

Once installed make sure to add the following to bashrc/zshrc:

export LD_LIBRARY_PATH="/usr/local/cuda-11.7/lib64:$LD_LIBRARY_PATH"
export PATH="/usr/local/cuda-11.7/bin:$PATH"

Start new shell, run pip install -r requirements.txt. It will work. I was trying with latest version of pyTorch with CUDA toolkit version 12.1 but it was failing to compile.

Be aware that you don't need to downgrade the driver while installing outdated version of CUDA toolkit. I am using 530 driver.

life saver, man

shngt commented 1 week ago

I solved it by revising setup.py in pointcloud2_ops_lib: from

os.environ["TORCH_CUDA_ARCH_LIST"] = "3.7+PTX;5.0;6.0;6.1;6.2;7.0;7.5"

to

os.environ["TORCH_CUDA_ARCH_LIST"] = "8.6"

As the GPU arch does not match that of my computer. To customize the arch on your own PC, you can find it in this https://stackoverflow.com/questions/68496906/pytorch-installation-for-different-cuda-architectures

Can this fix be added in the main repository? I think it should just be a matter of appending ";8.6" to the existing string?