Search Our Database
Installing Nvidia GPU Driver on Ubuntu: A Step-by-Step Guide
Introduction
Nvidia GPUs power many of today’s advanced computing tasks, from graphic design to AI and machine learning.
To get the most out of your Nvidia GPU, it’s essential to install the correct drivers.
This guide will walk you through installing Nvidia GPU drivers on Ubuntu, step-by-step.
We’ll also cover optional tools, such as the CUDA Toolkit and Nvidia Container Toolkit, which can unlock additional features and capabilities.
Follow along to set up your Nvidia GPU quickly and easily!
Tested on Nvidia RTX 30xx , RTX 40xx , RTX 50xx and H200NVL series
Official References :
Ubuntu – Nvidia GPU Driver :
https://docs.nvidia.com/datacenter/tesla/driver-installation-guide/ubuntu.html
Nvidia CUDA Toolkit :
https://developer.nvidia.com/cuda-downloads
Nvidia Container Toolkit :
https://docs.nvidia.com/datacenter/cloud-native/container-toolkit/latest/install-guide.html
🚀 GPU Software Components Overview
| Component | Required? | Purpose | When You Need It |
|---|---|---|---|
| NVIDIA Driver | ✅ Yes | Enables the system to detect and communicate with the NVIDIA GPU. | Always required for the GPU to function. |
| CUDA Toolkit | ⚙️ Optional | Provides tools and libraries for GPU-accelerated apps (like AI/ML). | Needed only if your app depends on CUDA or you’re developing. |
| Container Toolkit | ⚙️ Optional | Allows Docker containers to access the GPU hardware. | Needed only if you’re using containers with GPU workloads. |
Prerequisites
- Ubuntu operating system installed
- Administrative (sudo) privileges
- Compatible Nvidia GPU hardware
- Internet connectivity for package downloads
Installation Procedure
Step 1: System Update
Begin by updating the package list to ensure you have access to the latest software versions:
sudo apt update sudo apt upgrade -y
Step 2: Linux Headers Installation
Install the necessary Linux headers required for driver compilation:
sudo apt install -y linux-headers-$(uname -r)
Step 3: Download and install Nvidia Repository Keyring according to your Ubuntu version
if [ -f /etc/os-release ]; then
. /etc/os-release
case "${VERSION_ID}" in
20*) repo_ver="ubuntu2004" ;;
22*) repo_ver="ubuntu2204" ;;
24*) repo_ver="ubuntu2404" ;;
esac
wget https://developer.download.nvidia.com/compute/cuda/repos/${repo_ver}/x86_64/cuda-keyring_1.1-1_all.deb
sudo dpkg -i cuda-keyring_1.1-1_all.deb
else
echo "Error: /etc/os-release not found. Cannot determine OS."
fi
Optional Step: Use IP ServerOne’s Nvidia Mirror
sudo tee /etc/apt/sources.list.d/cuda-$(. /etc/os-release; echo ubuntu${VERSION_ID//./})-x86_64.list <<< "deb [signed-by=/usr/share/keyrings/cuda-archive-keyring.gpg] https://developer.download.nvidia.com/compute/cuda/repos/$(. /etc/os-release; echo ubuntu${VERSION_ID//./})/x86_64/ /"
Step 4: Nvidia Driver and CUDA Toolkit Installation
sudo apt update sudo apt -V install -y libnvidia-compute nvidia-dkms-open
Step 5: System Reboot
Reboot your system to load the GPU Driver:
sudo reboot
Step 6: GPU Driver Verification
To make sure everything is working as it should, run:
sudo nvidia-smi
If you see your GPU info pop up, you’re all set! 🎉
Optional : Installing Nvidia CUDA Toolkit
Running a CUDA application requires the system with at least one CUDA capable GPU and a driver that is compatible with the CUDA Toolkit.
Step 1: Download and install Nvidia Repository Keyring according to your Ubuntu version
Ensure that you have installed Nvidia GPU Driver following the steps above
Step 2 : Install Nvidia CUDA Toolkit
sudo apt update sudo apt -y install cuda-toolkit
Step 3 : Add CUDA Toolkit into PATH variable
sudo tee -a /etc/bash.bashrc <<< 'export PATH=${PATH}:/usr/local/cuda/bin'
export PATH=${PATH}:/usr/local/cuda/bin
Step 4 : CUDA Toolkit verification
sudo nvcc --version
If you see NVIDIA (R) Cuda compiler driver info pop up, you’re all set! 🎉
Optional : Installing Nvidia Container Toolkit
The NVIDIA Container Toolkit is a collection of libraries and utilities enabling users to build and run GPU-accelerated containers.
Required if you want to use GPU within Docker
Step 1 : Configure the production repository
curl -fsSL https://nvidia.github.io/libnvidia-container/gpgkey | sudo gpg --dearmor -o /usr/share/keyrings/nvidia-container-toolkit-keyring.gpg \
&& curl -s -L https://nvidia.github.io/libnvidia-container/stable/deb/nvidia-container-toolkit.list | \
sed 's#deb https://#deb [signed-by=/usr/share/keyrings/nvidia-container-toolkit-keyring.gpg] https://#g' | \
sudo tee /etc/apt/sources.list.d/nvidia-container-toolkit.list
Step 2 : Update the packages list from the repository
sudo apt update
Step 3 : Install the NVIDIA Container Toolkit packages
sudo apt install -y nvidia-container-toolkit sudo nvidia-ctk runtime configure --runtime=docker
Step 4 : Restart Docker
sudo systemctl restart docker
Step 5 : Nvidia Container Toolkit verification
sudo docker run --pull=always --rm --gpus all ubuntu nvidia-smi
If you see your GPU info pop up, you’re all set! 🎉
Conclusion
By following this guide, you’ve successfully installed the NVIDIA GPU drivers on your Ubuntu system.
Your system is now ready to handle GPU-powered applications, including deep learning frameworks, rendering software, and other high-performance tasks.
If you have any questions or need additional help, please open a ticket through your Customer Portal account or email us directly at support@ipserverone.com.
We’re always here to help!