Skip to content

Instantly share code, notes, and snippets.

@crabhi
Created May 16, 2023 09:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save crabhi/e11ae3c4a88be2181c10b6be6d7e8d2c to your computer and use it in GitHub Desktop.
Save crabhi/e11ae3c4a88be2181c10b6be6d7e8d2c to your computer and use it in GitHub Desktop.

Install PyTorch 2.0.1 on Ubuntu 22.04

...from wheel

Install CUDA repo from Nvidia

(Ubuntu has CUDA 11.5, PyTorch wheels need 11.7)

wget https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2204/x86_64/cuda-ubuntu2204.pin
sudo mv cuda-ubuntu2204.pin /etc/apt/preferences.d/cuda-repository-pin-600
sudo apt-key adv --fetch-keys https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2204/x86_64/3bf863cc.pub
sudo add-apt-repository "deb https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2204/x86_64/ /"

Install CUDA 11.7 (not the latest v12) and other libraries

sudo apt-get -y install cuda=11.7.1-1 libcublas11 libcufft10 libcudart11.0 libcudnn8 libcupti11.7 libnccl2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment