Cuda 10.2 not recognised on Pip installed Pytorch 1.7.1
Pip installing Pytorch 1.7.1 here on Gtx1660(latest drivers installed) doesn't recognise the installed Cuda toolkit 10.2 on my machine(Windows10).
As this is a personal project, I don't wish to use Anaconda.
How to resolve this?
#INSTALLATION (10.2 CUDA SUPPORT)
pip install torch===1.7.1 torchvision===0.8.2 torchaudio===0.7.2 -f https://download.pytorch.org/whl/torch_stable.html

#CODE
import torch 
device = torch.device(&quot;cuda&quot;)
# device = torch.device(&quot;cuda:0&quot;) #ALSO NOT WORKING
cuda_available = torch.cuda.is_available()
cuda_init = torch.cuda.is_initialized()
print(f'device_current = {device},cuda_available = {cuda_available} and cuda_init = {cuda_init}\n')

torch.cuda.init()
print(f'device_current = {device} and cuda_init = {cuda_init}')

#TERMINAL
device_current = cuda:0,cuda_available = False and cuda_init = False

Traceback (most recent call last):
  File &quot;f:\Script\Ai\Pytorch\mod_test\test1.py&quot;, line 8, in &lt;module&gt;
    torch.cuda.init()
  File &quot;C:\Users\User0\AppData\Local\Programs\Python\Python39\lib\site-packages\torch\cuda\__init__.py&quot;, line 137, in init
    _lazy_init()
  File &quot;C:\Users\User0\AppData\Local\Programs\Python\Python39\lib\site-packages\torch\cuda\__init__.py&quot;, line 166, in _lazy_init
    raise AssertionError(&quot;Torch not compiled with CUDA enabled&quot;)
AssertionError: Torch not compiled with CUDA enabled


I could be wrong, but here is what I found while searching on their package registry.
For a PyTorch 1.7.1 pip install. The instructions on pytorch.org are:
## cu101
pip install torch==1.7.1+cu101 torchvision==0.8.2+cu101 torchaudio===0.7.2 -f https://download.pytorch.org/whl/torch_stable.html

## cu110
pip install torch===1.7.1+cu110 torchvision===0.8.2+cu110 torchaudio===0.7.2 -f https://download.pytorch.org/whl/torch_stable.html

Yet the command for CUDA 10.2 support is:
## cu102
pip install torch===1.7.1 torchvision===0.8.2 torchaudio===0.7.2 -f https://download.pytorch.org/whl/torch_stable.html

This seems off because the CUDA version is not stated anywhere in the command. Yet download.pytorch.org provides support for this particular PyTorch version with cu92, cu101, cu102, and cu110.

You can either use:
pip install torch==1.7.0 torchvision==0.8.1 -f https://download.pytorch.org/whl/cu102/torch_stable.html

or try this instead from the main Torch stable directory:
pip install torch==1.7.1+cu102 torchvision==0.8.2+cu102 torchaudio===0.7.2 -f https://download.pytorch.org/whl/torch_stable.html

