Skip to content

pip repeatedly selecting wrong CUDA version during install #308

Open
@fratajcz

Description

@fratajcz

Hi!

I am trying to get an installation running on an HPC cluster with somewhat older dependencies. I have found torch 1.8.0 with CUDA 11.1 to work, so now I want to install the matching torch_sparse version:

$pip install torch-sparse -f https://data.pyg.org/whl/torch-1.8.0+cu111.html --no-cache-dir

Looking in links: https://data.pyg.org/whl/torch-1.8.0+cu111.html
Collecting torch-sparse
  Downloading torch_sparse-0.6.16.tar.gz (208 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 208.2/208.2 kB 11.8 MB/s eta 0:00:00
  Preparing metadata (setup.py) ... done
Requirement already satisfied: scipy in /home/icb/florin.ratajczak/anaconda3/envs/speostest/lib/python3.7/site-packages (from torch-sparse) (1.7.3)
Requirement already satisfied: numpy<1.23.0,>=1.16.5 in /home/icb/florin.ratajczak/anaconda3/envs/speostest/lib/python3.7/site-packages (from scipy->torch-sparse) (1.21.5)
Building wheels for collected packages: torch-sparse
  Building wheel for torch-sparse (setup.py) ... done
  Created wheel for torch-sparse: filename=torch_sparse-0.6.16-cp37-cp37m-linux_x86_64.whl size=1716194 sha256=46187b7f1bf7bae117f0e216f72bd6cf67ae95c2f9b6734d5369aa47099de042
  Stored in directory: /tmp/pip-ephem-wheel-cache-23v87jns/wheels/ff/5c/28/5d12cf8ac7bb8bc3de9dda8fa446cb4aeb9fffe19ef1028538
Successfully built torch-sparse
Installing collected packages: torch-sparse
Successfully installed torch-sparse-0.6.16

I just added the --no-cache-dir flag to make sure it doesnt load some other version from cache.

However, when I now try to import it, it says its compiled for CUDA 12.0:

(speostest) [florin.ratajczak@hpc-submit03gui speos]$ python
Python 3.7.16 (default, Jan 17 2023, 22:20:44) 
[GCC 11.2.0] :: Anaconda, Inc. on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import torch
>>> torch.__version__
'1.8.0'
>>> torch.version.cuda
'11.1'
>>> import torch_sparse
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/icb/florin.ratajczak/anaconda3/envs/speostest/lib/python3.7/site-packages/torch_sparse/__init__.py", line 33, in <module>
    f'Detected that PyTorch and torch_sparse were compiled with '
RuntimeError: Detected that PyTorch and torch_sparse were compiled with different CUDA versions. PyTorch has CUDA version 11.1 and torch_sparse has CUDA version 12.0. Please reinstall the torch_sparse that matches your PyTorch install.

Any idea why it says it was compiled for CUDA 12.0? I might have to host a course on that cluster in a week or so, so any help is much appreciated!

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions