How to Install NVIDIA Drivers on Ubuntu (26.04, 24.04, 22.04)

Last updated Sunday, February 22, 2026 3:22 pm Joshua James 20 min read 6 comments

Install NVIDIA drivers on Ubuntu to enable GPU acceleration for gaming, 3D rendering, and CUDA development. Ubuntu provides multiple installation methods, and the best choice depends on whether you want the distribution defaults, additional PPA branches, or NVIDIA’s CUDA packaging workflow.

The steps below start with driver cleanup and pre-install checks, then walk through four installation methods. You will use ubuntu-drivers devices to identify the recommended driver, install the branch that fits your hardware, fix common desktop issues, and verify that NVIDIA tools load correctly.

Install NVIDIA Drivers on Ubuntu

Start by choosing the installation method that matches your system. The table below compares the default Ubuntu repository, the graphics-drivers PPA, and the NVIDIA CUDA repository so you can pick the right path before running any commands.

MethodChannelBranch SourceUpdatesBest For
Default Repository (CLI/GUI)Ubuntu ReposUbuntu-tested branch selectionAutomatic via apt upgradeMost users who prefer tested, system-managed drivers
graphics-drivers PPALaunchpad PPAAdditional driver branches (often newer or legacy)Automatic via apt upgradeUsers who want extra branch choices between Ubuntu updates
NVIDIA CUDA RepositoryNVIDIA CUDANVIDIA-packaged CUDA/driver branchesAutomatic via apt upgradeGPU computing, CUDA development, machine learning

For most users, the default repository method is recommended because it provides the least friction and integrates cleanly with Ubuntu updates. Use the graphics-drivers PPA when you need a different branch than the default repository offers. Use the CUDA repository when you specifically need NVIDIA’s CUDA packaging and driver builds for development or compute workloads.

This guide covers Ubuntu 26.04 LTS, 24.04 LTS, and 22.04 LTS. The default repository and graphics-drivers PPA methods work on all three releases.

NVIDIA’s CUDA repository currently publishes ubuntu2404 and ubuntu2204 repositories only, not ubuntu2604. If NVIDIA adds Ubuntu 26.04 CUDA packages later, this guide will be updated for that method.

Remove Previous NVIDIA Drivers on Ubuntu

Before switching installation methods, first remove existing NVIDIA drivers completely to avoid conflicts. Mixing driver sources can cause boot failures or graphics instability. Specifically, this section covers uninstalling APT-based drivers, runfile installations, and CUDA Toolkit remnants. After removal, the system will automatically fall back to Mesa open-source drivers until new drivers are installed.

If you haven’t previously installed NVIDIA drivers through any method, skip directly to the preparation section below.

Remove Old NVIDIA Driver Repositories

If you previously enabled the graphics-drivers PPA or the NVIDIA CUDA repository, remove those sources before reinstalling to avoid mixed driver branches or duplicate repository warnings:

sudo add-apt-repository --remove ppa:graphics-drivers/ppa
sudo rm -f /etc/apt/sources.list.d/graphics-drivers-ubuntu-ppa*.list
sudo rm -f /etc/apt/sources.list.d/graphics-drivers-ubuntu-ppa*.sources
sudo rm -f /etc/apt/sources.list.d/nvidia-drivers.list
sudo rm -f /etc/apt/sources.list.d/nvidia-cuda.sources

Run sudo apt update after removing these entries so APT stops pulling packages from the old sources:

sudo apt update

Remove NVIDIA Packages via APT

To begin, remove any NVIDIA-related packages installed through APT. Use the following commands to purge the currently installed driver packages and clean up any lingering dependencies. Quoting 'nvidia*' ensures the shell passes the wildcard to APT without expanding it prematurely:

sudo apt remove --purge 'nvidia*'
sudo apt autoremove --purge

If you previously installed the CUDA Toolkit through Ubuntu’s package repositories, purge those packages as well before installing a new driver source. This removes meta-packages such as cuda-drivers, cuda-toolkit-12-4, and libcuda1 that keep NVIDIA components pinned in place.

sudo apt remove --purge 'cuda-*' 'libcuda*' 'nvidia-cuda-toolkit'
sudo apt autoremove --purge

Before switching to a different installation method, confirm the old APT packages are gone or only left as removed config entries (rc):

dpkg -l | grep -Ei '^(ii|rc)\s+(nvidia|cuda|libnvidia|libcuda)'

Expected result: no lines starting with ii for NVIDIA or CUDA packages before you continue.

No output (or only lines starting with rc)

Remove NVIDIA Drivers Installed via Runfile

Alternatively, if you installed NVIDIA drivers using a runfile (a standalone installer downloaded directly from NVIDIA’s website), the uninstallation process differs from APT-based installations. Fortunately, runfile installations include an uninstaller script:

The uninstaller refuses to run while GNOME, KDE, or Wayland sessions are active. Press Ctrl+Alt+F3 to reach a text console, sign in, and stop your display manager (for example, sudo systemctl stop gdm3 or sudo systemctl stop lightdm) before continuing. After cleanup, reboot or start the display manager again.

Before running the uninstaller, remove any NVIDIA-created modprobe blacklist files so the system can boot back into the open-source Nouveau driver if needed:

Warning: The next command deletes NVIDIA installer blacklist files from system modprobe directories. Review the paths first if you manually manage custom modprobe rules.

sudo rm -rf /lib/modprobe.d/nvidia-installer-*
sudo rm -rf /etc/modprobe.d/nvidia-installer-*
sudo rm -rf /usr/lib/modprobe.d/nvidia-installer-*

Next, edit /etc/default/grub and remove any custom parameters such as nvidia-drm.modeset=1 or nvidia-drm.fbdev=1 that were added to support the proprietary driver. After saving the file, rebuild GRUB and your initramfs:

sudo update-grub
sudo update-initramfs -u

Finally, run the bundled uninstaller to remove the driver:

sudo /usr/bin/nvidia-uninstall

Remove CUDA Toolkit Installed via Runfile

Similarly, if you installed the CUDA Toolkit using a runfile, remove it using the included cuda-uninstaller script. Replace X.Y with your installed CUDA version number:

sudo /usr/local/cuda-X.Y/bin/cuda-uninstaller

Remember to replace X.Y with the version number of your installed CUDA toolkit. For instance, if you have CUDA 12.0 installed, use cuda-12.0 instead.

Prepare Ubuntu for NVIDIA Driver Installation

Updating your system, installing kernel headers, and verifying GPU compatibility prevent common installation failures. This section covers the essential preparation steps.

Update Ubuntu System Packages

Update your system packages to minimize conflicts during driver installation. This is especially important for kernel and graphics driver installations.

Update your package list:

sudo apt update

This guide uses sudo for commands that need root privileges. If your user is not in the sudoers file yet, run the commands as root or follow the guide on how to add a new user to sudoers on Ubuntu.

Upgrade any outdated packages:

sudo apt upgrade

For LTS users with recent hardware, the HWE kernel provides newer kernel versions and improved driver compatibility without upgrading your entire Ubuntu release.

Ubuntu Server and other minimal images often skip kernel headers, yet DKMS (Dynamic Kernel Module Support) requires them to compile NVIDIA modules. Install the headers that match your running kernel before proceeding:

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

If you compile OpenGL or EGL applications locally, install NVIDIA’s GLVND development stack and build helpers now. These libraries are optional for driver installation but save time when you later build GPU-aware software:

sudo apt install pkg-config libglvnd-dev libegl-dev libgl-dev libgles-dev libglx-dev libopengl-dev gcc make

Verify NVIDIA GPU Compatibility

Next, verify your graphics card compatibility if you have older hardware. Users with recent cards can skip this step.

First, find your graphics card model:

lspci | grep -e VGA

The grep filter keeps the output focused on display adapters. If you want more filtering examples, see our grep command guide with examples.

This command displays information about your graphics card. Example output:

03:00.0 VGA compatible controller: NVIDIA Corporation TU117 [GeForce GTX 1650] (rev a1)

After obtaining your card model, verify compatibility if you have older hardware. Check the NVIDIA driver support matrix to see if your card is supported by current drivers. Some older GPUs may require legacy driver versions instead.

Method 1: Install NVIDIA Drivers on Ubuntu via CLI

The command line offers the most flexible and fastest installation approach. Therefore, most users should start here.

Identify Available NVIDIA Drivers

Open a terminal from the applications menu (or search for “Terminal” in Activities). If ubuntu-drivers is missing, which is common on Ubuntu Server or minimal installs, install it first:

sudo apt install ubuntu-drivers-common

Now list available drivers for your GPU:

ubuntu-drivers devices

Example output showing detected GPU and recommended driver:

== /sys/devices/pci0000:00/0000:00:01.0/0000:01:00.0 ==
modalias : pci:v000010DEd00001F82sv...
vendor   : NVIDIA Corporation
model    : TU117 [GeForce GTX 1650]
driver   : nvidia-driver-550 - third-party non-free recommended
driver   : nvidia-driver-550-open - third-party non-free
driver   : nvidia-driver-535 - third-party non-free
driver   : xserver-xorg-video-nouveau - distro free builtin

Alternatively, list drivers without device detection:

ubuntu-drivers list

Servers and GPU compute hosts should include the --gpgpu flag to see the recommended -server builds:

ubuntu-drivers list --gpgpu

If you do not see --gpgpu in ubuntu-drivers --help, check ubuntu-drivers list --help or ubuntu-drivers install --help. It is a subcommand option.

The ubuntu-drivers tool uses Ubuntu-packaged drivers and is usually the safest starting point when Secure Boot is enabled. If Secure Boot still blocks the modules on your system, use the troubleshooting section below to enroll a Machine Owner Key (MOK) or temporarily disable Secure Boot during installation.

In the example output, the graphics card model is “TU117 [GeForce GTX 1650]”, and the recommended NVIDIA driver is “nvidia-driver-550”. However, your NVIDIA graphics card model may differ, so look for the driver marked “recommended” in your output. Consequently, always install the driver version that matches your hardware.

Install NVIDIA Drivers from Ubuntu Repositories

Install the recommended driver automatically using the ubuntu-drivers install command:

sudo ubuntu-drivers install

The tool analyzes your hardware and installs the recommended driver. Expected output during installation:

Installing nvidia-driver-550...
Setting up nvidia-dkms-550...
Building initial module for 6.8.0-xx-generic
Done.

Alternatively, if you prefer explicit control while staying inside the helper tool, specify the driver version from the ubuntu-drivers list output (replace <version> with the number shown as “recommended”):

sudo ubuntu-drivers install nvidia:<version>

Additionally, you can install a specific driver version from the output above. Choose the version that matches your hardware and whether your output lists an -open build:

sudo apt install nvidia-driver-<version>
sudo apt install nvidia-driver-<version>-open

For older GPUs that require legacy drivers:

sudo apt install nvidia-driver-470

Ubuntu Server editions should install the -server metapackages, which provide the same driver versions without pulling unnecessary desktop components. Use one of the following commands that matches the release you selected above:

sudo apt install nvidia-driver-<version>-server
sudo apt install nvidia-driver-<version>-server-open

The ubuntu-drivers tool can install the same packages on servers with a single command:

sudo ubuntu-drivers install --gpgpu nvidia:<version>-server

After selecting a server driver, pull in the matching utilities so headless hosts still have nvidia-smi and related tooling:

sudo apt install nvidia-utils-<version>-server

After installation completes, reboot to load the kernel modules:

sudo reboot

Linux requires a reboot to load new kernel modules. Your system will reboot and automatically use the new NVIDIA drivers.

Method 2: Install NVIDIA Drivers on Ubuntu via GUI (Desktop Only)

The graphical interface method is recommended for users who prefer visual tools over the command line.

This workflow only exists on Ubuntu Desktop editions where GNOME and the Additional Drivers panel are installed. Ubuntu Server users should stick with the CLI methods above.

Ubuntu 26.04 desktop installs may not include the GUI tools by default. If “Additional Drivers” is missing from the menu, install software-properties-gtk first, then open the app again:

sudo apt install software-properties-gtk

Open Ubuntu Additional Drivers

First, open the “Additional Drivers” application from your application menu:

  1. Click “Activities” in the top-left corner of the screen.
  2. Then, type “Additional Drivers” in the search bar.
  3. Select the “Additional Drivers” application from the search results.

Select and Install an NVIDIA Driver in Additional Drivers

Once opened, the “Software & Updates” window displays available drivers for your NVIDIA graphics card. Notably, the number of drivers listed varies depending on your graphics card model.

From here, select the NVIDIA driver you wish to install and click “Apply Changes”. The installation typically takes 2 to 3 minutes depending on your system.

Finally, reboot your system after installation completes.

Method 3: Install NVIDIA Drivers on Ubuntu via graphics-drivers PPA

The graphics-drivers PPA (Personal Package Archive) adds more NVIDIA driver branches than the default Ubuntu repository and can expose newer or legacy options sooner. Use it when the default repository does not provide the branch you need, not automatically for every system.

Install graphics-drivers PPA Prerequisites

First, install the required dependencies:

sudo apt install software-properties-common

Add graphics-drivers PPA

Once dependencies are installed, add the graphics-drivers PPA to your system:

sudo add-apt-repository ppa:graphics-drivers/ppa

Refresh APT for NVIDIA Drivers from the PPA

Update the package list to detect drivers from the PPA:

sudo apt update

Expected output should include the PPA InRelease line for your Ubuntu codename (for example resolute, noble, or jammy):

Get:1 https://ppa.launchpadcontent.net/graphics-drivers/ppa/ubuntu resolute InRelease [27.2 kB]
Get:2 https://ppa.launchpadcontent.net/graphics-drivers/ppa/ubuntu resolute/main amd64 Packages [6,156 B]
Reading package lists...

Verify Available NVIDIA Drivers

List the PPA’s available drivers:

ubuntu-drivers devices

The output may show newer branches, legacy branches, or a different recommended branch than the default repository. Compare the recommended entry and install the branch that matches your GPU support status.

Install NVIDIA Drivers from PPA

Install the recommended driver from the PPA:

sudo ubuntu-drivers install

Alternatively, install a specific version directly (replace <version> with the recommendation from ubuntu-drivers devices):

sudo apt install nvidia-driver-<version>
sudo apt install nvidia-driver-<version>-open

When running Ubuntu Server with the graphics-drivers PPA, select the matching -server or -server-open metapackage instead to keep the installation lean. Choose whichever command matches your preferred driver branch:

sudo apt install nvidia-driver-<version>-server
sudo apt install nvidia-driver-<version>-server-open

Prefer sticking with ubuntu-drivers? Use the GPGPU flag to install the same packages from the PPA:

sudo ubuntu-drivers install --gpgpu nvidia:<version>-server

Remember to add the matching utilities for headless systems:

sudo apt install nvidia-utils-<version>-server

Finally, reboot your system after installation completes.

Method 4: Install NVIDIA Drivers on Ubuntu via CUDA Repository

NVIDIA currently publishes CUDA repositories for Ubuntu 24.04 LTS and 22.04 LTS only. The ubuntu2604 CUDA repository and key URL return 404 on Ubuntu 26.04 LTS, so use the default repository or graphics-drivers PPA on 26.04 until NVIDIA publishes an Ubuntu 26.04 CUDA repo.

Install CUDA Repository Prerequisites

The NVIDIA CUDA repository provides drivers alongside CUDA Toolkit support. The build-essential package includes the GCC compiler and build tools for DKMS (Dynamic Kernel Module Support), which automatically rebuilds drivers after kernel updates. Some minimal Ubuntu images omit curl, so install the required tools first. The key download commands use curl; our curl command in Linux guide explains common flags such as -fsSL.

sudo apt install build-essential dkms curl ca-certificates gpg

Import NVIDIA CUDA Repository GPG Key

Import the GPG key for your Ubuntu version:

Ubuntu 24.04 Noble Numbat:

curl -fsSL https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2404/x86_64/3bf863cc.pub | sudo gpg --dearmor -o /usr/share/keyrings/nvidia-drivers.gpg

Ubuntu 22.04 Jammy Jellyfish:

curl -fsSL https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2204/x86_64/3bf863cc.pub | sudo gpg --dearmor -o /usr/share/keyrings/nvidia-drivers.gpg

Add NVIDIA CUDA Repository

Add the NVIDIA CUDA repository using the modern DEB822 format. Choose the command matching your Ubuntu version:

Ubuntu 24.04 Noble Numbat:

cat <<EOF | sudo tee /etc/apt/sources.list.d/nvidia-cuda.sources
Types: deb
URIs: https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2404/x86_64/
Suites: /
Signed-By: /usr/share/keyrings/nvidia-drivers.gpg
EOF

Ubuntu 22.04 Jammy Jellyfish:

cat <<EOF | sudo tee /etc/apt/sources.list.d/nvidia-cuda.sources
Types: deb
URIs: https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2204/x86_64/
Suites: /
Signed-By: /usr/share/keyrings/nvidia-drivers.gpg
EOF

Update APT After Adding the NVIDIA CUDA Repository

Update your package list to include the new repository:

sudo apt update

Expected output should include NVIDIA’s CUDA repository lines:

Get:4 https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2404/x86_64  InRelease [1,581 B]
Get:7 https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2404/x86_64  Packages [1,218 kB]
Reading package lists...

Verify the repository is configured correctly by checking that APT recognizes NVIDIA packages:

apt-cache policy nvidia-driver-580

Expected output showing the CUDA repository as a package source:

nvidia-driver-580:
  Installed: (none)
  Candidate: 580.126.16-1ubuntu1
  Version table:
     580.126.16-1ubuntu1 500
        500 https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2404/x86_64  Packages
     580.126.09-0ubuntu0.24.04.1 500
        500 http://archive.ubuntu.com/ubuntu noble-updates/restricted amd64 Packages

Install NVIDIA Drivers from CUDA Repository

Search for available NVIDIA driver versions:

apt-cache search '^nvidia-driver-[0-9]+'

Example output showing available driver versions:

nvidia-driver-570 - NVIDIA driver metapackage
nvidia-driver-580 - NVIDIA driver metapackage
nvidia-driver-590 - NVIDIA driver metapackage

NVIDIA offers both proprietary and open-source drivers. Proprietary drivers typically deliver better performance and full feature support for gaming and professional work. Meanwhile, open-source drivers provide better Linux kernel integration and work reliably with Secure Boot. For most users, try proprietary drivers first.

Install the latest proprietary driver (replace <version> with the branch you want from the apt-cache search output):

sudo apt install nvidia-driver-<version>

Alternatively, install the latest open-source driver:

sudo apt install nvidia-driver-<version>-open

For Ubuntu Server, install the proprietary server build:

sudo apt install nvidia-driver-<version>-server

Or install the open-source server build:

sudo apt install nvidia-driver-<version>-server-open

Install the matching utilities so headless systems have nvidia-smi and related tools:

sudo apt install nvidia-utils-<version>-server

For CUDA Toolkit installation alongside drivers, refer to our comprehensive CUDA Toolkit installation guide which covers driver selection, CUDA package options, and GPU computing setup.

Install NVIDIA Headless Drivers

For servers, Docker containers, or headless compute nodes without a display, headless drivers omit GUI components while providing full GPU computing capabilities. Therefore, these are ideal for machine learning, render farms, or compute servers.

Install the proprietary headless driver:

sudo apt install nvidia-headless-<version>

Or the open-source headless driver:

sudo apt install nvidia-headless-<version>-open

Pair headless builds with the matching user-space utilities so commands like nvidia-smi work:

sudo apt install nvidia-utils-<version>

For data center servers with NVSwitch hardware, also install Fabric Manager (replace <version> with the same branch you used above):

sudo apt install nvidia-fabricmanager-<version> libnvidia-nscq-<version>

Finally, after installation completes, reboot to load the drivers:

sudo reboot

Troubleshoot NVIDIA Driver Installation Issues on Ubuntu

Installation failures and display issues usually stem from driver conflicts, Secure Boot blocking modules, or stale GNOME settings. Below, this section covers quick fixes for the most common problems.

Secure Boot Blocks NVIDIA Driver Loading

Systems with Secure Boot enabled block unsigned kernel modules, preventing NVIDIA drivers from loading. Consequently, you have two options: disable Secure Boot in BIOS/UEFI settings during installation, or enroll a Machine Owner Key (MOK) to sign DKMS-built modules.

For most users, temporarily disabling Secure Boot during driver installation is simplest:

  1. Reboot and enter BIOS/UEFI (usually by pressing Del, F2, or F12 during startup)
  2. Find “Secure Boot” in Security settings and disable it
  3. Save and reboot
  4. Install NVIDIA drivers using any method above
  5. Re-enable Secure Boot only after enrolling a key that signs the NVIDIA modules; otherwise leave it disabled

If you need Secure Boot enabled, enroll a Machine Owner Key (MOK) so DKMS signs the drivers before you switch it back on:

sudo update-secureboot-policy --new-key
sudo reboot

During reboot, follow the on-screen MOK enrollment prompt. After enrollment, reinstall the NVIDIA driver so the modules are signed, then re-enable Secure Boot. For more background, refer to Debian’s Secure Boot and DKMS documentation; the process applies to Ubuntu as well.

Black Screen or No Display After Installation

If your system boots to a black screen, the NVIDIA driver failed to load or Nouveau (the open-source driver) is still active. Next, boot into recovery mode or a virtual console:

lsmod | grep nvidia

If this shows no output, the NVIDIA driver did not load. If the driver loaded successfully, you would see output similar to:

nvidia_drm             77488  1
nvidia_modeset       1315840  1 nvidia_drm
nvidia              56766464  1 nvidia_modeset
video                  65536  2 nvidia_modeset

Next, check DKMS status:

sudo dkms status

Expected successful output:

nvidia/550.135, 6.8.0-50-generic, x86_64: installed

If the driver shows as “unbuilt” or “failed” (for example: nvidia/550.135: added instead of installed), rebuild it:

sudo dkms autoinstall

Expected output during successful rebuild:

nvidia/550.135, 6.8.0-50-generic: installing module
original module
  No original module exists within this kernel
Depmod...
Building module:
cleaning build area...
make -j8 KERNELRELEASE=6.8.0-50-generic...
Done.

If you see Nouveau loading instead of NVIDIA, blacklist it permanently:

echo "blacklist nouveau
options nouveau modeset=0" | sudo tee /etc/modprobe.d/blacklist-nouveau.conf

Rebuild your initramfs and reboot:

sudo update-initramfs -u && sudo reboot

DKMS Build Failures After Kernel Updates

If DKMS fails to rebuild drivers after a kernel update, ensure kernel headers match your running kernel:

uname -r

Expected output should match your running kernel version, for example:

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

Then force DKMS to rebuild:

sudo dkms autoinstall && sudo update-initramfs -u

Remove Ghost “Unknown Display” Entries

Some GNOME installs display an extra “Unknown Display” entry after switching driver branches because stale monitor layout files linger in your profile or in GDM’s configuration. Delete those layout files so GNOME regenerates them with the active displays:

rm -f ~/.config/monitors.xml
sudo rm -f /var/lib/gdm3/.config/monitors.xml

Log out and back in (or restart GDM on multi-user systems) so GNOME creates a fresh layout without the phantom monitor. Repeat the user-specific removal command for any additional desktop accounts affected by the ghost entry.

Restore Wayland on the Login Screen

If Wayland disappears as a session option, edit the GDM configuration file:

sudo nano /etc/gdm3/custom.conf

Find the line WaylandEnable=false and change it to WaylandEnable=true, or uncomment it if already set to true. Save the file with Ctrl+O and exit with Ctrl+X. Then neutralize GDM’s old udev rule and reboot:

sudo ln -s /dev/null /etc/udev/rules.d/61-gdm.rules
sudo reboot

Stabilize Wayland Sessions with NVIDIA

Wayland behaves best on GNOME 46 and NVIDIA driver 555 or newer. Edit the GRUB configuration file:

sudo nano /etc/default/grub

Find the line containing GRUB_CMDLINE_LINUX and add the parameters nvidia-drm.modeset=1 nvidia-drm.fbdev=1 inside the quotes. For example:

GRUB_CMDLINE_LINUX="nvidia-drm.modeset=1 nvidia-drm.fbdev=1"

Save the file, then update GRUB and reboot:

sudo update-grub
sudo reboot

Verify the proprietary EGL bindings are installed. Ubuntu 24.04’s packages include libnvidia-egl-wayland1, but you can reinstall it if Wayland keeps falling back to Mesa (skip this step if you installed NVIDIA 555+ runfiles because they already provide the library):

sudo apt install libnvidia-egl-wayland1

Chrome, Chromium, and Electron apps (VS Code, Slack, etc.) may still default to XWayland. Enable the Wayland Ozone backend by setting the “Preferred Ozone platform” flag to “Wayland” or launching Electron apps with --enable-features=UseOzonePlatform,WaylandWindowDecorations --ozone-platform-hint=auto.

Disable Problematic GSP Firmware (Optional)

Preview NVIDIA drivers occasionally enable GSP firmware that hurts responsiveness. Check whether GSP is active:

nvidia-smi -q | grep "GSP Firmware"

If a version number appears (instead of N/A), edit the GRUB configuration file:

sudo nano /etc/default/grub

Add nvidia.NVreg_EnableGpuFirmware=0 inside the quotes on the GRUB_CMDLINE_LINUX line, then save the file and apply the changes:

sudo update-grub
sudo reboot

Fix Suspend or Resume Artifacts

Systems that resume to flickering displays often lack the Preserve Video Memory Allocations parameter. Edit the GRUB configuration file:

sudo nano /etc/default/grub

Add nvidia.NVreg_PreserveVideoMemoryAllocations=1 inside the GRUB_CMDLINE_LINUX quotes, save the file, then apply the changes and reboot:

sudo update-grub
sudo reboot

After rebooting, verify the setting is active:

cat /proc/driver/nvidia/params | grep PreserveVideoMemoryAllocations

Expected output confirming the setting is enabled:

PreserveVideoMemoryAllocations: 1

Confirm NVIDIA Drivers Work on Ubuntu

After installing NVIDIA drivers and rebooting, verify the installation from the terminal first, then use the NVIDIA GUI tools if you need display or performance tuning options.

Check NVIDIA Drivers via Terminal

First, confirm which kernel module version is loaded:

cat /proc/driver/nvidia/version

Expected output showing the installed driver version:

NVRM version: NVIDIA UNIX x86_64 Kernel Module  550.135  Sun Dec  1 08:51:30 UTC 2024
GCC version:  gcc version 13.2.0 (Ubuntu 13.2.0-23ubuntu4)

Then, use nvidia-smi to see GPU utilization, memory usage, and driver status:

nvidia-smi

Expected output showing GPU information and driver version (your driver branch and CUDA version may differ):

+-----------------------------------------------------------------------------------------+
| NVIDIA-SMI 550.135                Driver Version: 550.135        CUDA Version: 12.4     |
|-----------------------------------------+------------------------+----------------------+
| GPU  Name                 Persistence-M | Bus-Id          Disp.A | Volatile Uncorr. ECC |
| Fan  Temp   Perf          Pwr:Usage/Cap |           Memory-Usage | GPU-Util  Compute M. |
|=========================================+========================+======================|
|   0  NVIDIA GeForce GTX 1650       Off | 00000000:01:00.0   On |                  N/A |
| 35%   42C    P8               8W /  75W |     256MiB /   4096MiB |      2%      Default |
+-----------------------------------------+------------------------+----------------------+

If you have a laptop with NVIDIA Optimus technology (hybrid Intel + NVIDIA graphics), you may need to manually switch to NVIDIA mode using prime-select before nvidia-smi works. However, switching to NVIDIA mode without the proper X.Org input drivers can cause frozen keyboard and mouse at the login screen.

Before switching to NVIDIA mode, install the complete X.Org input driver stack:

sudo apt install xserver-xorg-input-all
sudo prime-select nvidia
sudo reboot

If your keyboard and mouse freeze after rebooting, access recovery mode by holding Shift during boot, select “Advanced options,” choose “recovery mode,” then “Drop to root shell.” Switch back to Intel graphics, reboot, install the input drivers, and retry:

sudo prime-select intel
sudo reboot

Additionally, for a more detailed graphical overview, install GPU Viewer to monitor real-time GPU metrics, temperatures, and utilization.

Access NVIDIA Settings GUI

Alternatively, launch the NVIDIA settings GUI for graphical configuration. Open the terminal and enter:

nvidia-settings

Alternatively, you can also access NVIDIA settings through the application menu: Activities > Show Applications > NVIDIA X Server Settings.

The NVIDIA settings GUI displays your GPU configuration, information, and customizable settings. From here, you can adjust display settings, manage performance profiles, and configure advanced driver options.

NVIDIA Driver References and Support Links

Use these references for upstream driver documentation, branch information, and community support when troubleshooting or planning upgrades:

  • Graphics Drivers PPA: Access the latest NVIDIA drivers from the Ubuntu graphics drivers PPA. This repository often has the most up-to-date drivers available.
  • NVIDIA Unix Drivers: Visit NVIDIA’s official page for Unix drivers to download the latest drivers directly from NVIDIA.
  • NVIDIA CUDA Toolkit Downloads: Access NVIDIA’s CUDA downloads page for current toolkit packages and supported platforms.
  • NVIDIA Tesla Driver Documentation: Read the documentation for NVIDIA Tesla drivers, providing detailed information on driver branches and updates.
  • NVIDIA Forums: Join the NVIDIA community forums to discuss issues, share solutions, and get support from other NVIDIA users.

Frequently Asked Questions

Is the NVIDIA CUDA repository available on Ubuntu 26.04 LTS?

No. NVIDIA currently publishes CUDA repositories for Ubuntu 24.04 and 22.04, but the ubuntu2604 repository and key URLs return 404. On Ubuntu 26.04, use the default Ubuntu repository or the graphics-drivers PPA until NVIDIA publishes a CUDA repository for 26.04.

How do I update NVIDIA drivers on Ubuntu after installation?

Use the same package source you originally installed from, then run sudo apt update and upgrade the NVIDIA packages. For a targeted upgrade, use sudo apt install --only-upgrade nvidia-driver-<version> nvidia-utils-<version>, then reboot if the kernel module or DKMS package was updated.

Why is nvidia-smi missing after I install NVIDIA drivers on Ubuntu?

The nvidia-smi command is provided by NVIDIA utilities packages, not every driver metapackage alone. Install the matching utilities package for your branch, such as nvidia-utils-<version> or nvidia-utils-<version>-server, then run nvidia-smi again.

Are legacy NVIDIA drivers like 390 or 470 available on Ubuntu 24.04 and 26.04?

Ubuntu 24.04 still exposes some legacy branches, including nvidia-driver-470, while Ubuntu 26.04 defaults to newer branches and may not include older legacy metapackages in the default repositories. Verify availability with apt-cache policy before choosing a legacy branch, and confirm the branch still supports your GPU generation.

Conclusion

Your Ubuntu system now has NVIDIA drivers installed and verified working, whether you used the default repository, the graphics-drivers PPA, the CUDA repository, or the desktop GUI workflow. From here, you can install CUDA Toolkit on Ubuntu, install the HWE kernel on Ubuntu for newer hardware support, or install GPU Viewer on Ubuntu to monitor temperatures and utilization.

Found this guide useful?

Support LinuxCapable to keep tutorials free and up to date.

Buy me a coffee Buy me a coffee

6 thoughts on “How to Install NVIDIA Drivers on Ubuntu (26.04, 24.04, 22.04)”

  1. Just as a heads-up after rebooting I could not get to nvidia-smi so I did (DO NOT ENTER THIS COMMAND YET) sudo prime-select nvidia. And after rebooting again I couldn’t use my mouse or keyboard, found a solution here:
    https://forums.developer.nvidia.com/t/ubuntu-22-04-2-lts-nvidia-525-105-17-hangs-on-login-screen/249679

    Which basically is doing: sudo apt-get install xserver-xorg-input-all
    Then do “sudo prime-select nvidia” and reboot

    NOTE: If after reboot your mouse and keyboard are not responding enter in recovery mode (select to open a shell) and switch back to intel “sudo prime-select nvidia” then do the steps above.

    Reply
    • Thanks for sharing this, Alexouwu. Your case matches an Optimus setup where switching to NVIDIA mode before installing input drivers can leave the keyboard and mouse unresponsive.

      Install the full X.Org input stack, then switch to NVIDIA and reboot:

      sudo apt install xserver-xorg-input-all
      sudo prime-select nvidia
      sudo reboot

      If input is frozen after reboot, use recovery mode, drop to a root shell, switch back to Intel graphics, reboot, install the input package, then retry the NVIDIA switch:

      sudo prime-select intel
      sudo reboot

      The verification section now includes this Optimus prerequisite to prevent others from hitting this issue. Thanks for surfacing it!

      Reply
Before commenting, please review our Comments Policy.
Formatting tips for your comment

You can use basic HTML to format your comment. Useful tags currently allowed:

You type Result
<code>command</code> command
<strong>bold</strong> bold
<em>italic</em> italic
<a href="URL">link</a> link
<blockquote>quote</blockquote> quote block

Leave a Comment

We read and reply to every comment - let us know how we can help or improve this guide.

Let us know you are human: