Last active
April 5, 2025 22:42
-
-
Save shkarupa-alex/4829bc79a1bef8740ddaedd809f68c40 to your computer and use it in GitHub Desktop.
Ubuntu 22.04 + Cuda
This file contains 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
# Prioritize NVIDIA packages | |
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 | |
# Fetch NVIDIA keys | |
sudo apt-key adv --fetch-keys https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2204/x86_64/3bf863cc.pub | |
# Add NVIDIA repos | |
sudo add-apt-repository "deb https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2204/x86_64/ /" | |
sudo apt-get update && sudo apt-get upgrade | |
# Install NVIDIA driver & CUDA | |
# + stable for RTX 4090 + TF 2.13 | |
# sudo apt-get install cuda-drivers cuda-11-8 libcudnn8=8.9.2.26-1+cuda11.8 libcudnn8-dev=8.9.2.26-1+cuda11.8 libnccl2 libnccl-dev | |
# - latest for TF 2.16.1 | |
# sudo apt-get install cuda-drivers cuda-12-2 libcudnn8 libcudnn8-dev libnccl2 libnccl-dev | |
# - latest for TF 2.17.0 | |
# sudo apt-get install cuda-drivers cuda-12-3 libcudnn8 libcudnn8-dev libnccl2 libnccl-dev | |
# latest for TF 2.18.0 | |
sudo apt-get install cuda-drivers cuda-12-6 cudnn9-cuda-12-6 libcudnn8-dev libnccl2 libnccl-dev | |
# Reboot. Check that GPUs are visible | |
nvidia-smi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
It will encounter
nvidia-dkms-535 : Depends: nvidia-kernel-common-535 (= 535.129.03-0ubuntu1) but 535.129.03-0ubuntu0.22.04.1 is to be installed
problems.And we can solve with https://askubuntu.com/questions/1491916/problem-with-nvidia-package-dependencies .