PyTorch not recognising CUDA device

I’ve installed anaconda 26.1.1 on windows 10, and am trying to get PyTorch to work on my workstation with a Quadro P5000.

I have installed cudatoolkit, cudnn and pytorch, but my system is not recognising the cuda device. How do I configure this to work?

List of installed packages

Name                     Version          Build            Channel

cudatoolkit                11.8.0           h09e9e62_13      conda-forge
cudnn                      9.10.1.4         h4851267_0       conda-forge
libcudnn                   9.10.1.4         h49adc43_0       conda-forge
libcudnn-dev               9.10.1.4         h49adc43_0       conda-forge
pytorch                    2.8.0            cpu_mkl_py313hea03fb1_101
pytorch-cpu                2.8.0            cpu_mkl_h1234567_102
pytorch-cuda               11.8             h24eeafa_6                 pytorch

print(“CUDA available:”, torch.cuda.is_available())
CUDA available: False

You have installed multiple PyTorch builds from various channels that could conflict with each other. I would recommend sticking to our install instructions from the Get Started page and install PyTorch once in a new virtual environment.

I’ve removed all pytorch copies and tried to start again.

I installed pytorch with

conda install pytorch-cuda=11.8 -c pytorch -c nvidia

Now pytorch-cuda is the only copy

In [12]: conda list pytorch

# packages in environment at C:\Users\<USER>\anaconda3:
# Name                     Version          Build            Channel
pytorch-cuda               11.8             h24eeafa_6       pytorch

However, I now get the following error

In [13]: torch.cuda.is_available()

AttributeError                            Traceback (most recent call last)
Cell In[13], line 1
----> 1 torch.cuda.is_available()

AttributeError: module ‘torch’ has no attribute ‘cuda’

Could you advise what I’m doing wrong?