NVidia drivers
For installing the Nvidia drivers and CUDA, I directly use the repository from Nvidia:
wget https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2404/x86_64/cuda-ubuntu2404.pin
sudo mv cuda-ubuntu2404.pin /etc/apt/preferences.d/cuda-repository-pin-600
wget https://developer.download.nvidia.com/compute/cuda/13.0.0/local_installers/cuda-repo-ubuntu2404-13-0-local_13.0.0-580.65.06-1_amd64.deb
sudo dpkg -i cuda-repo-ubuntu2404-13-0-local_13.0.0-580.65.06-1_amd64.deb
sudo cp /var/cuda-repo-ubuntu2404-13-0-local/cuda-*-keyring.gpg /usr/share/keyrings/
sudo apt update
sudo apt install -y cuda
If you have Secure Boot enabled, you need to provide the UEFI with the key:
sudo update-secureboot-policy --enroll-key
After the installation, you need to add the following lines to your ~/.bashrc
file to
ensure
tee --append ~/.bashrc <<EOF
export PATH=${PATH}:/usr/local/cuda-13.0/bin
EOF
source ~/.bashrc