princeton-vl / lietorch

BSD 3-Clause "New" or "Revised" License
679 stars 50 forks source link

CUDA version mismatch #15

Closed yriuss closed 2 years ago

yriuss commented 2 years ago

After sudo python3 setup.py install, I get the following error:

running install
running bdist_egg
running egg_info
writing lietorch.egg-info/PKG-INFO
writing dependency_links to lietorch.egg-info/dependency_links.txt
writing top-level names to lietorch.egg-info/top_level.txt
reading manifest file 'lietorch.egg-info/SOURCES.txt'
writing manifest file 'lietorch.egg-info/SOURCES.txt'
installing library code to build/bdist.linux-x86_64/egg
running install_lib
running build_py
running build_ext
Traceback (most recent call last):
  File "/home/adriel/Documents/mestrado/projeto/repos/lietorch/setup.py", line 9, in <module>
    setup(
  File "/usr/lib/python3/dist-packages/setuptools/__init__.py", line 153, in setup
    return distutils.core.setup(**attrs)
  File "/usr/lib/python3.9/distutils/core.py", line 148, in setup
    dist.run_commands()
  File "/usr/lib/python3.9/distutils/dist.py", line 966, in run_commands
    self.run_command(cmd)
  File "/usr/lib/python3.9/distutils/dist.py", line 985, in run_command
    cmd_obj.run()
  File "/usr/lib/python3/dist-packages/setuptools/command/install.py", line 67, in run
    self.do_egg_install()
  File "/usr/lib/python3/dist-packages/setuptools/command/install.py", line 109, in do_egg_install
    self.run_command('bdist_egg')
  File "/usr/lib/python3.9/distutils/cmd.py", line 313, in run_command
    self.distribution.run_command(command)
  File "/usr/lib/python3.9/distutils/dist.py", line 985, in run_command
    cmd_obj.run()
  File "/usr/lib/python3/dist-packages/setuptools/command/bdist_egg.py", line 164, in run
    cmd = self.call_command('install_lib', warn_dir=0)
  File "/usr/lib/python3/dist-packages/setuptools/command/bdist_egg.py", line 150, in call_command
    self.run_command(cmdname)
  File "/usr/lib/python3.9/distutils/cmd.py", line 313, in run_command
    self.distribution.run_command(command)
  File "/usr/lib/python3.9/distutils/dist.py", line 985, in run_command
    cmd_obj.run()
  File "/usr/lib/python3/dist-packages/setuptools/command/install_lib.py", line 23, in run
    self.build()
  File "/usr/lib/python3.9/distutils/command/install_lib.py", line 109, in build
    self.run_command('build_ext')
  File "/usr/lib/python3.9/distutils/cmd.py", line 313, in run_command
    self.distribution.run_command(command)
  File "/usr/lib/python3.9/distutils/dist.py", line 985, in run_command
    cmd_obj.run()
  File "/usr/lib/python3/dist-packages/setuptools/command/build_ext.py", line 79, in run
    _build_ext.run(self)
  File "/usr/lib/python3.9/distutils/command/build_ext.py", line 340, in run
    self.build_extensions()
  File "/usr/local/lib/python3.9/dist-packages/torch-1.10.0-py3.9-linux-x86_64.egg/torch/utils/cpp_extension.py", line 404, in build_extensions
    self._check_cuda_version()
  File "/usr/local/lib/python3.9/dist-packages/torch-1.10.0-py3.9-linux-x86_64.egg/torch/utils/cpp_extension.py", line 781, in _check_cuda_version
    raise RuntimeError(CUDA_MISMATCH_MESSAGE.format(cuda_str_version, torch.version.cuda))
RuntimeError: 
The detected CUDA version (11.2) mismatches the version that was used to compile
PyTorch (10.2). Please make sure to use the same CUDA versions.

But my nvcc version is 11.2.

zachteed commented 2 years ago

The last line of the error message says "The detected CUDA version (11.2) mismatches the version that was used to compile PyTorch (10.2). Please make sure to use the same CUDA versions".

If you have cuda 11.2 installed, all you need to do is install the version of PyTorch built with Cuda 11 conda install scipy pyyaml pytorch torchvision torchaudio cudatoolkit=11.3 -c pytorch

I haven't found there to be any issues required minor version mismatches 11.2 vs 11.3, only major versions cause problems.