CUDA version is always 10.2

username: jloomis
cooked: <p>After installing a handful of versions of pytorch with CUDA (<code>11.7 nightly</code>, <code>11.6 nightly</code>, <code>11.3</code>), I can’t get <code>torch.version.cuda</code> to be anything but <code>10.2</code></p>
<pre><code class="lang-auto">[me@legion imagen-test]$ sudo pip3 install torch torchvision torchaudio --extra-index-url https://download.pytorch.org/whl/cu113
Looking in indexes: https://pypi.org/simple, https://download.pytorch.org/whl/cu113
Collecting torch
  Downloading https://download.pytorch.org/whl/cu113/torch-1.11.0%2Bcu113-cp310-cp310-linux_x86_64.whl (1637.0 MB)
     |████████████████████████████████| 1637.0 MB 28 kB/s              
Collecting torchvision
  Downloading https://download.pytorch.org/whl/cu113/torchvision-0.12.0%2Bcu113-cp310-cp310-linux_x86_64.whl (22.3 MB)
     |████████████████████████████████| 22.3 MB 12.2 MB/s            
Collecting torchaudio
  Downloading https://download.pytorch.org/whl/cu113/torchaudio-0.11.0%2Bcu113-cp310-cp310-linux_x86_64.whl (2.9 MB)
     |████████████████████████████████| 2.9 MB 455 kB/s            
Requirement already satisfied: typing-extensions in /usr/lib/python3.10/site-packages (from torch) (4.2.0)
Requirement already satisfied: numpy in /usr/lib/python3.10/site-packages (from torchvision) (1.22.4)
Requirement already satisfied: requests in /usr/lib/python3.10/site-packages (from torchvision) (2.27.1)
Requirement already satisfied: pillow!=8.3.*,&gt;=5.3.0 in /usr/lib/python3.10/site-packages (from torchvision) (9.1.0)
Requirement already satisfied: chardet&gt;=3.0.2 in /usr/lib/python3.10/site-packages (from requests-&gt;torchvision) (4.0.0)
Requirement already satisfied: idna&gt;=2.5 in /usr/lib/python3.10/site-packages (from requests-&gt;torchvision) (3.3)
Requirement already satisfied: urllib3&gt;=1.21.1 in /usr/lib/python3.10/site-packages (from requests-&gt;torchvision) (1.26.9)
Installing collected packages: torch, torchvision, torchaudio
Successfully installed torch-1.11.0+cu113 torchaudio-0.11.0+cu113 torchvision-0.12.0+cu113
[me@legion imagen-test]$ python
Python 3.10.4 (main, Mar 23 2022, 23:05:40) [GCC 11.2.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
&gt;&gt;&gt; import torch
&gt;&gt;&gt; print(torch.version.cuda)
10.2
</code></pre>

username: ptrblck
cooked: <p>Most likely you have multiple PyTorch installations in your current environment and <code>import torch</code> selects the “default” one shipping with the CUDA 10.2 runtime.<br>
Uninstall all PyTorch installations via rerunning <code>pip uninstall torch -y</code> and <code>conda uninstall pytorch -y</code> until no installations can be found. Then install the new wheel.</p>

username: jloomis
cooked: <p>I don’t have any conda installation, but after uninstalling torch with pip, verifying uninstallation, and reinstalling, I still get CUDA 10.2.</p>
<pre><code class="lang-auto">[me@legion imagen-test]$ sudo pip uninstall torch -y
Found existing installation: torch 1.11.0
Uninstalling torch-1.11.0:
  Successfully uninstalled torch-1.11.0
[me@legion imagen-test]$ pip uninstall torch -y
WARNING: Skipping torch as it is not installed.
[me@legion imagen-test]$ python
...
&gt;&gt;&gt; import torch
Traceback (most recent call last):
  File "&lt;stdin&gt;", line 1, in &lt;module&gt;
ModuleNotFoundError: No module named 'torch'
&gt;&gt;&gt; exit()
[me@legion imagen-test]$ pip3 install torch --extra-index-url https://download.pytorch.org/whl/cu117
Defaulting to user installation because normal site-packages is not writeable
Looking in indexes: https://pypi.org/simple, https://download.pytorch.org/whl/cu117
Collecting torch
  Downloading torch-1.11.0-cp310-cp310-manylinux1_x86_64.whl (750.6 MB)
     |████████████████████████████████| 750.6 MB 9.2 kB/s             
Requirement already satisfied: typing-extensions in /usr/lib/python3.10/site-packages (from torch) (4.2.0)
Installing collected packages: torch
Successfully installed torch-1.11.0
[me@legion imagen-test]$ python
Python 3.10.4 (main, Mar 23 2022, 23:05:40) [GCC 11.2.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
&gt;&gt;&gt; import torch
&gt;&gt;&gt; print(torch.version.cuda)
10.2
</code></pre>

username: ptrblck
cooked: <p>You are installing the default CUDA 10.2 wheel, as <code>--extra-index-url https://download.pytorch.org/whl/cu117</code> is not a thing yet (check the URL and it will show an error) so <code>pip install</code> pulls the default wheel. Use the provided install commands from the <a href="https://pytorch.org/get-started/locally/">website</a> or verify the existence of internal wheels manually.</p>