Last active
January 14, 2025 15:02
-
-
Save bobvanluijt/2552a93b13b0c49194744f2dcf2c7318 to your computer and use it in GitHub Desktop.
Install CUDA on Ubuntu 22.04 + transformers
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Assumes Ubuntu 22.04 | |
$ sudo apt-get update && \ | |
sudo apt-get -y install gcc && \ | |
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 && \ | |
wget https://developer.download.nvidia.com/compute/cuda/12.3.1/local_installers/cuda-repo-ubuntu2204-12-3-local_12.3.1-545.23.08-1_amd64.deb && \ | |
sudo dpkg -i cuda-repo-ubuntu2204-12-3-local_12.3.1-545.23.08-1_amd64.deb && \ | |
sudo cp /var/cuda-repo-ubuntu2204-12-3-local/cuda-*-keyring.gpg /usr/share/keyrings/ && \ | |
sudo apt-get update && \ | |
sudo apt-get -y install cuda-toolkit-12-3 nvidia-cuda-toolkit python3-pip nvtop && \ | |
sudo apt-get -y install cuda && \ | |
export PATH=/usr/local/cuda-12.2/bin${PATH:+:${PATH}} && \ | |
export LD_LIBRARY_PATH=/usr/local/cuda-12.2/lib64${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}} && \ | |
pip3 install torch transformers |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment