Search Our Database

Installing Nvidia GPU Driver on Ubuntu: A Step-by-Step Guide

Last updated on |

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!

 

🚀 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: System Reboot

Reboot your system to apply the updates and ensure a clean installation environment:

sudo reboot

Step 3: Linux Headers Installation

Install the necessary Linux headers required for driver compilation:

sudo apt install -y linux-headers-generic linux-headers-$(uname -r)

Step 4: Nvidia Driver Installation

Search for latest driver version:

apt search "nvidia-driver-" | awk -F/ '/^nvidia-driver-.*server/&&!/open/{print $1}' | sort -h

Version list as of May 2025

nvidia-driver-418-server
nvidia-driver-440-server
nvidia-driver-450-server
nvidia-driver-460-server
nvidia-driver-470-server
nvidia-driver-510-server
nvidia-driver-515-server
nvidia-driver-525-server
nvidia-driver-535-server
nvidia-driver-550-server
nvidia-driver-565-server
nvidia-driver-570-server

Install the following Nvidia drivers and utilities: (replacing the version number as required)

nvidia-dkms-<VERSION>-server
nvidia-driver-<VERSION>-server
nvidia-utils-<VERSION>-server

Example :

sudo apt install -y nvidia-dkms-570-server nvidia-driver-570-server nvidia-utils-570-server

Step 5: System Reboot

Reboot your system to load the GPU Driver:

sudo reboot

Step 6: GPU Driver Verification

To make sure everything’s working as it should, run:

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 Nvidia CUDA Keyring according to your Ubuntu version

Ubuntu 20.04 LTS

wget https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2004/x86_64/cuda-keyring_1.1-1_all.deb

Ubuntu 22.04 LTS

wget https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2204/x86_64/cuda-keyring_1.1-1_all.deb

Ubuntu 24.04 LTS

wget https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2404/x86_64/cuda-keyring_1.1-1_all.deb

Step 2 : Add Nvidia CUDA Keyring and Install Nvidia CUDA Toolkit

sudo dpkg -i cuda-keyring_1.1-1_all.deb
sudo apt-get update
sudo apt-get -y install cuda-toolkit

Step 3 : Add CUDA Toolkit into PATH variable

echo 'export PATH=${PATH}:/usr/local/cuda/bin' >> /etc/bash.bashrc
export PATH=${PATH}:/usr/local/cuda/bin

Step 4 : CUDA Toolkit verification

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-get update

Step 3 : Install the NVIDIA Container Toolkit packages

sudo apt-get install -y nvidia-container-toolkit
nvidia-ctk runtime configure --runtime=docker

Step 4 : Restart Docker

systemctl restart docker

Step 5 : Nvidia Container Toolkit verification

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!