PyTorch CUDA version is always 10.2
I've installed a handful of PyTorch versions (CUDA 11.7 nightly, CUDA 11.6 nightly, 11.3), but every time, torch.version.cuda returns 10.2.
I'd like to run PyTorch on CUDA 11.7. My graphics card has CUDA capability sm_86.
[me@legion imagen-test]$ sudo pip3 install torch torchvision torchaudio --extra-index-url https://download.pytorch.org/whl/cu113 
...
[me@legion imagen-test]$ python
&gt;&gt;&gt; import torch
&gt;&gt;&gt; print(torch.version.cuda)
10.2

When I actually try to use PyTorch, I get an error saying the PyTorch version I have installed doesn't support the newer version of CUDA my graphics card requires.
&gt;&gt;&gt; torch.Tensor([1,2,3]).cuda()
...
NVIDIA GeForce RTX 3060 Laptop GPU with CUDA capability sm_86 is not compatible with the current PyTorch installation.
The current PyTorch install supports CUDA capabilities sm_37 sm_50 sm_60 sm_70.
...
RuntimeError: CUDA error: no kernel image is available for execution on the device
CUDA kernel errors might be asynchronously reported at some other API call,so the stacktrace below might be incorrect.
For debugging consider passing CUDA_LAUNCH_BLOCKING=1.

I'm completely stumped, and unsure where to go from here. I'd appreciate any help.

You've probably installed PyTorch with CUDA 10.2 among your different installed versions. This may be taking priority over the versions of PyTorch. To fix this, simply uninstall all versions of PyTorch with pip uninstall torch -y and reinstall PyTorch with CUDA 11.7.
Source: https://discuss.pytorch.org/t/cuda-version-is-always-10-2/152876
