How To Install Nvidia Drivers on Ubuntu 26.04 LTS

Install Nvidia Drivers on Ubuntu 26.04

Ubuntu 26.04 LTS ships with the open-source Nouveau driver enabled by default. Nouveau gets you to a desktop, but it lacks the hardware-level access your GPU needs for CUDA workloads, gaming, multi-monitor setups at full refresh rate, and machine learning tasks with TensorFlow or PyTorch. The good news is that Ubuntu 26.04 now officially packages the Nvidia 595.58.03 driver in its restricted repository, so you no longer need third-party repositories just to get a stable, tested driver on a fresh install.

This guide covers how to install Nvidia drivers on Ubuntu 26.04 using four methods: the ubuntu-drivers tool (recommended for most users), direct APT commands, the desktop GUI panel, and Nvidia’s CUDA repository for ML and AI workloads. Each step includes an explanation of why it matters, not just what to type.

Prerequisites

Before running a single command, confirm your setup meets these requirements:

  • Operating System: Ubuntu 26.04 LTS (fresh or fully updated install)
  • GPU Architecture: Turing (RTX 20xx) or newer for open kernel modules; Maxwell/Pascal GPUs use the proprietary module
  • User Privileges: A user account with sudo access
  • Internet Connection: Active and stable for downloading packages
  • Free Disk Space: Minimum 2GB on the root partition
  • Secure Boot Status: Know whether it is enabled in BIOS/UEFI before you start (affects the MOK enrollment step)
  • Tools Needed: apt, ubuntu-drivers-common, pciutils, linux-headers (installed in Step 1)

Confirm your GPU is visible to the system before anything else:

lspci | grep -E 'VGA|3D|Display'

Why this command matters: The Linux kernel enumerates hardware over the PCI bus at boot. If your GPU does not appear here, no driver installation will fix the problem. This command catches connection issues, disabled PCIe slots, or GPU hardware failures before you waste time installing software.

Expected output example:

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

Step 1: Update Your System and Install Kernel Headers

Update System Packages

Always start with a full system update before installing any driver. Stale package metadata causes APT to resolve outdated dependency trees, which can pull library versions incompatible with newer kernel ABIs.

sudo apt update && sudo apt upgrade -y

Why apt upgrade before the driver: Ubuntu 26.04 may have pending kernel updates. Installing a driver against the current kernel and then upgrading to a newer kernel afterward breaks the DKMS module, forcing a manual rebuild.

Install Kernel Headers and Build Tools

sudo apt install linux-headers-$(uname -r) pciutils build-essential -y

Why kernel headers: DKMS (Dynamic Kernel Module Support) compiles the Nvidia kernel module from source and links it against your exact running kernel. Without matching headers, the DKMS build fails silently and Nouveau remains active after the next reboot.

Why build-essential: This package installs GCC, Make, and related compilers that DKMS calls during module compilation. Ubuntu Server and minimal installs often exclude these tools.

Why pciutils: Provides the lspci command that the ubuntu-drivers tool calls internally to identify your GPU hardware and match it to the correct driver branch.

Step 2: Check Available Nvidia Drivers for Your GPU

Skipping this step and guessing a version number is the most common reason driver installs fail. Ubuntu 26.04 recommends different driver branches based on GPU architecture. Installing nvidia-driver-595 on a Maxwell-era card like a GTX 970 will produce a non-booting system because that driver does not support that GPU generation.

First, install the detection tool if it is missing (standard on Ubuntu Server and minimal installs):

sudo apt install ubuntu-drivers-common -y

Then list available drivers matched to your specific GPU:

ubuntu-drivers devices

On Ubuntu 26.04, the 595 driver may appear only as a DKMS package. Use this flag to confirm:

ubuntu-drivers list --include-dkms

For servers and headless GPU compute nodes, filter for server-oriented builds:

ubuntu-drivers list --gpgpu

Why the --gpgpu flag: This flag tells the tool to show nvidia-driver-*-server variants, which omit desktop display libraries. Installing a desktop driver on a headless server pulls unnecessary packages and introduces display-manager dependencies on a machine that will never have a monitor.

Sample output from ubuntu-drivers devices:

vendor   : NVIDIA Corporation
model    : TU117 [GeForce GTX 1650]
driver   : nvidia-driver-595     - third-party non-free recommended
driver   : nvidia-driver-580     - third-party non-free
driver   : nvidia-driver-550     - third-party non-free
driver   : xserver-xorg-video-nouveau - distro free builtin

Look for the entry marked recommended. That is the driver branch Ubuntu has validated against your specific GPU and the current kernel. Use it unless you have a specific CUDA version requirement or legacy hardware constraint.

Step 3: Install Nvidia Drivers via ubuntu-drivers (Recommended)

This is the safest installation path for the majority of Ubuntu 26.04 desktop and workstation users. The ubuntu-drivers tool handles DKMS module compilation, Secure Boot MOK prompts, and future kernel upgrade compatibility automatically.

Auto-Install the Recommended Driver

sudo ubuntu-drivers install

Why use ubuntu-drivers install instead of specifying a version manually: The tool cross-references your GPU model, current kernel version, and available packages to select the best-fit branch. It removes human error from version selection entirely.

Note for Ubuntu 26.04 users: The older ubuntu-drivers autoinstall command is deprecated on 26.04. Always use ubuntu-drivers install instead.

Install a Specific Driver Version

If you need a particular branch, for example 595 for improved Wayland support or the new CUDA performance profile, specify it directly:

sudo ubuntu-drivers install nvidia:595

If the 595 package is only available as DKMS on your system (common on 26.04), add the --include-dkms flag to force a module rebuild during installation:

sudo ubuntu-drivers install --include-dkms nvidia:595

Why --include-dkms matters: On some Ubuntu 26.04 configurations, the tool skips DKMS packages without this flag, silently installing an older pre-compiled branch instead. This is a known behavior reported in Ubuntu Discourse where the tool installs nvidia-driver-580 instead of the requested 595.

For server and headless compute deployments:

sudo ubuntu-drivers install --gpgpu nvidia:595-server

Reboot the System

sudo reboot

Why a reboot is mandatory: The Nouveau driver holds an active lock on the GPU’s DRM (Direct Rendering Manager) subsystem and frame buffer memory. A full reboot is the only way to unload Nouveau from kernel memory and allow the new Nvidia kernel module to claim the GPU cleanly.

Step 4: Install Nvidia Drivers via Direct APT (Sysadmin Method)

Direct APT installation gives you granular control over which package flavor gets installed. This method is ideal for sysadmins managing fleets, writing Ansible playbooks, or automating server builds where ubuntu-drivers interactive prompts are not suitable.

Proprietary Driver (Broadest Hardware Compatibility)

sudo apt install nvidia-driver-595 -y

Open Kernel Module Variant (Turing and Newer GPUs Only)

sudo apt install nvidia-driver-595-open -y

Why two variants exist: Nvidia released an open-source kernel module in 2022. The -open variant is Nvidia’s own open kernel-side code and supports only Turing (RTX 20xx) and newer architectures. The proprietary module supports older hardware generations. Installing the -open variant on a Pascal or Maxwell GPU will fail the DKMS build because those architectures are not supported.

Server and Headless Deployments

sudo apt install nvidia-driver-595-server nvidia-utils-595-server -y

Why install nvidia-utils separately on servers: The nvidia-smi command comes from the nvidia-utils package, not the driver itself. On headless servers, this package is not always pulled in automatically as a dependency, leaving you without GPU monitoring tools after the driver installs.

Reboot after installation:

sudo reboot

Step 5: Install Nvidia Drivers via GUI (Desktop Users)

The Additional Drivers panel is the most beginner-friendly option on Ubuntu 26.04 Desktop. Under the hood, it runs the same APT commands as the direct APT method, but it removes the risk of typos in package names.

Important limitations: This method only works on Ubuntu Desktop with GNOME installed. It does not work over SSH, on Ubuntu Server, or on minimal installs.

If the panel is missing, install it first:

sudo apt install software-properties-gtk -y

Steps to use the GUI:

  1. Press the Super key (Windows key) and search for “Additional Drivers”
  2. Open the application and wait for the hardware scan to finish
  3. Select the Nvidia driver entry marked “tested” or the highest available version number
  4. Click “Apply Changes” and enter your sudo password when prompted
  5. Wait for the installation to complete, then click Restart Now

Why the system scan takes time: The Additional Drivers panel queries ubuntu-drivers devices in the background, which reads PCI bus data and checks package availability against your current kernel before displaying results.

Step 6: Install Nvidia Drivers via CUDA Repository (ML and AI Workloads)

When your work requires CUDA Toolkit alongside the driver, install from Nvidia’s official CUDA repository. This ensures the driver version and CUDA version are validated together by Nvidia. Ubuntu’s default repository does not always carry the latest CUDA-aligned driver.

Who should use this method: ML engineers, AI researchers, and developers who need specific CUDA Toolkit versions. Desktop and gaming users should stick with Method 1 or Method 2.

Add the CUDA Keyring for Ubuntu 26.04

curl -fsSLO https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2604/x86_64/cuda-keyring_1.1-1_all.deb
sudo dpkg -i cuda-keyring_1.1-1_all.deb
rm -f cuda-keyring_1.1-1_all.deb

Why install the keyring first: APT blocks installation from unsigned repositories with an error and refuses to proceed. The cuda-keyring package installs both the GPG signing key and the repository source file simultaneously, preventing “unsigned package” errors.

Why delete the .deb file after install: APT reads the keyring and source file from their installed locations. The downloaded .deb file is no longer needed and just takes up space.

Refresh APT to pick up the new repository:

sudo apt update

Install the Driver

For the open kernel module (Turing and newer GPUs):

sudo apt install nvidia-open -y

For the proprietary driver (older GPUs or specific workload requirements):

sudo apt install cuda-drivers -y

Why cuda-drivers is a metapackage: It selects the exact driver version validated against the CUDA Toolkit version in the same repository. This prevents version mismatches that cause libcuda.so linking errors at runtime, which are notoriously difficult to debug on production ML systems.

Reboot:

sudo reboot

Handling Secure Boot During Installation

If your machine has Secure Boot enabled in UEFI, expect this step. UEFI Secure Boot requires all kernel modules to carry a cryptographic signature. Nvidia’s DKMS-compiled modules are unsigned by default, so the bootloader rejects them at load time, leaving you with no GPU output on the login screen.

During the ubuntu-drivers install process, Ubuntu prompts you to set a MOK (Machine Owner Key) password.

After reboot, you will see a blue UEFI screen. Follow these steps exactly:

  1. Select “Enroll MOK”
  2. Select “Continue”
  3. Select “Yes”
  4. Enter the password you set during installation (no visual feedback while typing is normal)
  5. Select “Reboot”

Why MOK enrollment matters: The MOK you enroll tells UEFI to trust modules signed with your local key. If you skip this step or reboot too quickly past the blue screen, the Nvidia module is never trusted and Nouveau remains active. The symptom is a working desktop but a failed nvidia-smi.

If MOK management is outside your workflow, disable Secure Boot in BIOS/UEFI before installation and re-evaluate your security policy separately.

Verify the Nvidia Driver Installation

A successful apt install does not guarantee the kernel module loaded correctly. The module can fail silently if DKMS did not compile successfully or if Secure Boot enrollment was skipped. Always verify before declaring the install complete.

Check Loaded Kernel Modules

lsmod | grep nvidia

A healthy output shows these modules:

nvidia_drm             98304  4
nvidia_modeset       1441792  6 nvidia_drm
nvidia              56610816  414 nvidia_modeset

If this output is empty, the module did not load. Move to the troubleshooting section.

Check Driver Version from the Kernel

cat /proc/driver/nvidia/version

Expected output:

NVRM version: NVIDIA UNIX x86_64 Kernel Module  595.58.03  ...
GCC version: gcc version 14.x.x (Ubuntu ...)

Run the Definitive GPU Status Check

nvidia-smi

A healthy output displays:

+-----------------------------------------------------------------------------------------+
| NVIDIA-SMI 595.58.03    Driver Version: 595.58.03    CUDA Version: 12.9               |
|-----------------------------------------+----------------------+----------------------+
| GPU  Name                 Persistence-M | Bus-Id        Disp.A | Volatile Uncorr. ECC |
|   0  NVIDIA GeForce GTX 1650        Off | 00000000:03:00.0  On |                  N/A |
+-----------------------------------------------------------------------------------------+

Why nvidia-smi is the gold standard for verification: This tool communicates directly with the Nvidia kernel module through /dev/nvidiactl. If nvidia-smi runs without errors, the driver is fully loaded, the GPU is accessible to the OS, and compute workloads (CUDA, OpenCL, Vulkan) will function correctly.

Troubleshooting Common Issues

Problem 1: Black Screen or No Display After Reboot

Why it happens: Nouveau is still loaded, or the DKMS module build failed for the current kernel.

Check DKMS status first:

sudo dkms status

If the output shows added, built, or failed instead of installed, the Nvidia module was not compiled for your running kernel. Fix it:

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

Why dkms autoinstall: This command re-triggers kernel module compilation for all DKMS-registered drivers. It builds the Nvidia module against the exact running kernel version, which is what the bootloader needs to load the driver successfully.

Then blacklist Nouveau to prevent it from loading at boot:

echo -e "blacklist nouveau\noptions nouveau modeset=0" | sudo tee /etc/modprobe.d/blacklist-nouveau.conf
sudo update-initramfs -u
sudo reboot

Why update-initramfs is required: The initramfs is a compressed filesystem that the kernel loads during the earliest boot stage, before any disk is mounted. The blacklist file must be baked into this image. Without regenerating it, your blacklist instruction never reaches the boot process.

Problem 2: ubuntu-drivers install Installs Wrong Version

This is a confirmed bug reported in Ubuntu 26.04 Discourse where the tool installs nvidia-driver-580 instead of the recommended 595.

Fix: Force install the correct version explicitly:

sudo ubuntu-drivers install nvidia:595

Or with DKMS rebuild forced:

sudo ubuntu-drivers install --include-dkms nvidia:595

Problem 3: nvidia-smi Command Not Found After Install

The nvidia-smi tool comes from the nvidia-utils package, which is not always pulled in automatically on server installs.

Check what is installed:

dpkg-query -W -f='${db:Status-Abbrev} ${binary:Package}\n' 'nvidia-utils*' 2>/dev/null | grep '^ii'

Install the matching utilities package for your driver branch:

sudo apt install nvidia-utils-595 -y

For server deployments:

sudo apt install nvidia-utils-595-server -y

Problem 4: Wayland Session Not Available After Install

Some Nvidia driver configurations disable Wayland in GDM automatically. Re-enable it:

sudo nano /etc/gdm3/custom.conf

Change WaylandEnable=false to WaylandEnable=true, save the file, then neutralize the blocking udev rule:

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

Why this udev rule blocks Wayland: Older GDM behavior automatically switched to Xorg whenever a proprietary Nvidia driver was detected. This rule is a legacy safeguard that 26.04 no longer needs with driver 555 or newer. Symlinking it to /dev/null disables it permanently without removing the file.

Problem 5: DKMS Build Fails After a Kernel Update

Every time the Linux kernel updates, DKMS must recompile the Nvidia module against the new kernel headers. If headers are missing, the build fails.

Check the running kernel version:

uname -r

Install headers for that exact version:

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

Force a rebuild:

sudo dkms autoinstall
sudo update-initramfs -u
sudo reboot

Keep Nvidia Drivers Updated on Ubuntu 26.04

Nvidia releases driver updates that patch security vulnerabilities, fix GPU bugs, and improve Wayland stability. Falling more than one or two driver generations behind often causes regressions after kernel updates.

The standard APT upgrade handles all driver updates automatically when installed through the Ubuntu repository or ubuntu-drivers:

sudo apt update && sudo apt upgrade -y

After any kernel or driver upgrade, always confirm DKMS rebuilt the module correctly:

sudo dkms status

Reboot after any Nvidia package or kernel upgrade is applied.

Congratulations! You have successfully installed Nvidia Drivers. Thanks for using this tutorial for installing the Nvidia Drivers on the Ubuntu 26.04 LTS (Resolute Raccoon) system. For additional help or useful information, we recommend you check the Nvidia website.

VPS Manage Service Offer
If you don’t have time to do all of this stuff, or if this is not your area of expertise, we offer a service to do “VPS Manage Service Offer”, starting from $10 (Paypal payment). Please contact us to get the best deal!
r00t is a Linux Systems Administrator and open-source advocate with over ten years of hands-on experience in server infrastructure, system hardening, and performance tuning. Having worked across distributions such as Debian, Arch, RHEL, and Ubuntu, he brings real-world depth to every article published on this blog. r00t writes to bridge the gap between complex sysadmin concepts and practical, everyday application — whether you are configuring your first server or optimizing a production environment. Based in New York, US, he is a firm believer that knowledge, like open-source software, is best when shared freely.

Related Posts