Torch.cuda.is_available() is false on windows when everything installed

I just got a new desktop. It has a rtx 3080 gpu. I have torch 1.12.0+cpu installed. cuda 11.6 installed. visual studio 2019 installed. everytime I do torch.conda.is_available() it returns false. I have been trying for hours with no luck

I just installed torch that is not the cpu only version so the torch version is now 1.12.0. Still no luck

I cannot reproduce the issue on a Windows Laptop with a GPU and can properly use the CUDA runtime:

pip3 install torch torchvision torchaudio --extra-index-url https://download.pytorch.org/whl/cu116
...
>>> import torch
>>> torch.__version__
'1.12.0+cu116'
>>> torch.version.cuda
'11.6'
>>> x = torch.randn(1).cuda()
>>> x
tensor([0.0287], device='cuda:0')

Have you selected the correct interpreter? Otherwise, Visual Studio will default to the default env where it’s not installed. I think the command is Ctrl + Shift + P to select the interpreter.

Also, it’s torch.cuda.is_available() not torch.conda :slight_smile:

problem solved. Unsure of the issue. remade the environment and installed using pytorch commands.