The way I have installed pytorch with CUDA (on Linux) is by:
- Going to the pytorch website and manually filling in the GUI checklist, and copy pasting the resulting command
conda install pytorch torchvision torchaudio cudatoolkit=11.3 -c pytorch - Going to the NVIDIA cudatoolkit install website, filling in the GUI, and copy pasting the following code:
wget https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2004/x86_64/cuda-ubuntu2004.pin
sudo mv cuda-ubuntu2004.pin /etc/apt/preferences.d/cuda-repository-pin-600
wget https://developer.download.nvidia.com/compute/cuda/11.5.1/local_installers/cuda-repo-ubuntu2004-11-5-local_11.5.1-495.29.05-1_amd64.deb
sudo dpkg -i cuda-repo-ubuntu2004-11-5-local_11.5.1-495.29.05-1_amd64.deb
sudo apt-key add /var/cuda-repo-ubuntu2004-11-5-local/7fa2af80.pub
sudo apt-get update
sudo apt-get -y install cuda
By the way, if I don't install the toolkit from the NVIDIA website then pytorch tells me CUDA is unavailably, probably because the pytorch conda install command doesn't install the drivers.
Is there a way to do all of this in a cleaner way, without manually checking the latest version each time you reinstall, or filling in a GUI?

