I have a new Lenovo machine with an Nvidia RTX 4080 running Windows 11, and am trying to install PyTorch under Anaconda. The machine came with CUDA 12.2, which I downgraded to 12.0 to make the PyTorch installation easier. But I’m having no luck. !nvcc --version confirms release 12.0, V12.0.76, and !nvidia-smi confirms Driver Version: 528.49 CUDA Version: 12.0.
I’ve tried the following, all without success, and with the noted results:
conda install torchvision torchaudio pytorch-cuda=12.0 -c pytorch -c nvidia
produces this error text:
PackagesNotFoundError: The following packages are not available from current channels: - pytorch-cuda=12.0
conda install pytorch torchvision torchaudio cudatoolkit=12.0 -c pytorch -c conda-forge
produces this error text:
PackagesNotFoundError: The following packages are not available from current channels: - cudatoolkit=12.0
pip install torch==2.0.1+cu121 -f https://download.pytorch.org/whl/cu120/torch_stable.html
produces this error text:
ERROR: Could not find a version that satisfies the requirement torch==2.0.1+cu121 (from versions: 2.0.0, 2.0.1)
ERROR: No matching distribution found for torch==2.0.1+cu121
pip install torch==1.12.1+cu120 torchvision==0.13.1+cu120 torchaudio==0.12.1
produces this error text:
ERROR: Could not find a version that satisfies the requirement torch==1.12.1+cu120 (from versions: 2.0.0, 2.0.1)
ERROR: No matching distribution found for torch==1.12.1+cu120
Thanks for your help!
sjfrank:
The machine came with CUDA 12.2, which I downgraded to 12.0 to make the PyTorch installation easier.
The locally installed CUDA toolkit won’t be used if you install the PyTorch binaries as they ship with their own CUDA dependencies. Downgrading won’t make installing PyTorch easier or harder.
Which Python version are you using and is it still a supported one?
Maybe I’m doing this wrong, but I tried
pip install torch==2.0.1+cu121 -f https://download.pytorch.org/whl/nightly/cu121/torch-2.1.0.dev20230811%2Bcu121-cp311-cp311-win_amd64.whl
and got:
Looking in links: https://download.pytorch.org/whl/nightly/cu121/torch-2.1.0.dev20230811%2Bcu121-cp311-cp311-win_amd64.whl
Note: you may need to restart the kernel to use updated packages.
WARNING: Skipping page https://download.pytorch.org/whl/nightly/cu121/torch-2.1.0.dev20230811%2Bcu121-cp311-cp311-win_amd64.whl because the HEAD request got Content-Type: binary/octet-stream. The only supported Content-Types are application/vnd.pypi.simple.v1+json, application/vnd.pypi.simple.v1+html, and text/html
ERROR: Could not find a version that satisfies the requirement torch==2.0.1+cu121 (from versions: 2.0.0, 2.0.1, 2.1.0.dev20230811+cu121)
ERROR: No matching distribution found for torch==2.0.1+cu121
This worked:
pip install https://download.pytorch.org/whl/nightly/cu121/torch-2.1.0.dev20230811%2Bcu121-cp311-cp311-win_amd64.whl
And PyTorch now sees the GPU! Thanks very much!