Upgrade to cuda in a conda environment

Hi everyone,

I had pytorch installed in a conda environment using the CPU. On a new machine I have a GPU available, so I want to upgrade to the CUDA version. I’ve removed pytorch from the environment and then run the recommended line, in my case:

conda install pytorch torchvision torchaudio pytorch-cuda=12.1 -c pytorch -c nvidia

However, I keep getting offered the CPU build:

pytorch            pytorch/win-64::pytorch-2.2.0-py3.9_cpu_0

How can I upgrade to the CUDA build?

I’ve checked similar questions here and here but can’t find any answers there.