Tue, Aug 22, 2023
Read in 2 minutes
It's the drivers, and it's fast!
CUDA (Compute Unified Device Architecture) is a parallel computing platform and programming model developed by NVIDIA. It empowers developers to tap into the immense computational power of NVIDIA GPUs for accelerating a wide range of tasks.
With CUDA, tasks that demand intensive parallel processing, such as deep learning, scientific simulations, and data analysis, can be performed dramatically faster. By leveraging the thousands of cores within a GPU, CUDA has revolutionized fields that require heavy computational lifting, making it a go-to solution for researchers, developers, and data scientists.
We’re going to be following these steps:
Very easy way to keep up with new releases.
Follow these steps to install CUDA drivers on the latest Ubuntu:
Check GPU Compatibility: Ensure your GPU is compatible with the CUDA version you intend to install. Refer to NVIDIA’s official documentation for compatibility details.
Open up a terminal Ctrl+Alt+T
and type
lspci | grep -i nvidia
The output should be shomething like this:
If there is no output, then you don’t have a Nvidia GPU. Sorry.
Update System:
sudo apt update
sudo apt upgrade -y
Nvidia drivers: Instructions from the official nvidia driver installation guide for ubuntu 22.xx found here.
sudo apt install linux-headers-$(uname -r)
wget https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2204/x86_64/cuda-keyring_1.1-1_all.deb
sudo dpkg -i cuda-keyring_1.1-1_all.deb
sudo apt update
sudo apt install cuda-drivers
Disable default driver: By disabling the default Nvidia driver from Canonical you will save a lot of trouble.
echo -e "blacklist nouveau\noptions nouveau modeset=0" | sudo tee /etc/modprobe.d/blacklist-nouveau.conf
sudo update-initramfs -u
Reboot: Reboot your system to apply the Nouveau driver changes.
CUDA package installation: With all the steps above, you can safely copy&paste this code block.
sudo apt install cuda
Reboot: Reboot your system to get your CUDA up and running!
Verifications: The best way to check everything went well is to check nvidia-smi
nvidia-smi
The output should be like this, and with DRIVER VERSION and CUDA VERSION.
The package manager will automatically update everything. True Gold.
This is a wrap-up of the official Nvidia CUDA installation Guide for Linux, found here