How to Install the Correct NVIDIA Driver on Ubuntu and Fix a Black Screen (October 2026)?

You install the NVIDIA driver on Ubuntu, reboot, and the screen stays black. That is the single most common NVIDIA-on-Ubuntu problem, and you can recover from it. The fix usually boils down to purging the driver, regenerating or deleting a stale /etc/X11/xorg.conf, picking the right version with ubuntu-drivers autoinstall, and only adding nomodeset when nothing else works.

I have walked through this exact sequence on laptops with Optimus, on RTX 30-series desktops, and on a freshly built RTX 5090 box that refused to boot. The same four-method recovery path works for all of them, in the same order. In this guide, I will show you that path, starting with prerequisites so you do not waste time guessing, then moving into four ranked fix methods, and finally a recovery section for when the system is fully locked.

Prerequisites Before You Install the NVIDIA Driver on Ubuntu

Before you touch a single package, gather a few facts about your machine. Most failed installs are caused by picking the wrong driver version for the kernel, leaving Secure Boot half-configured, or stacking a manual xorg.conf on top of an already-working one.

Identify your GPU and current driver. Open a terminal and run these commands:

lspci -nn | grep -i nvidia
uname -r
lsb_release -a
dpkg -l | grep -i nvidia

Note the kernel version and the Ubuntu release. Newer NVIDIA driver branches (550+) support recent kernels, while older LTS releases (Ubuntu 22.04) cap out around the 535 or 550 branches without the HWE kernel. Confirm you have the linux-headers package matching your running kernel, because the NVIDIA driver rebuilds against it on every kernel update.

Check Secure Boot status with mokutil --sb-state. If it returns SecureBoot enabled, plan to enroll the MOK key during the install or disable Secure Boot in your BIOS. The driver will simply fail to load silently otherwise.

How to Choose and Install the Correct NVIDIA Driver on Ubuntu

The official, recommended path is the ubuntu-drivers tool. It scans your hardware and picks the driver version Ubuntu has tested for your release, which avoids 90% of black-screen issues at the source.

List available drivers for your card:

sudo apt update
sudo ubuntu-drivers list

For a clean, supported install run sudo ubuntu-drivers autoinstall. If you prefer a specific version, use sudo apt install nvidia-driver-535 for the 535 branch or sudo apt install nvidia-driver-570 for newer RTX 40/50 cards.

Reboot with sudo reboot and verify the install landed by running nvidia-smi. A working install returns a table that includes your driver version and GPU name, like:

+-----------------------------------------------------+
| NVIDIA-SMI 550.54.15    Driver Version: 550.54.15  |
| GPU  Name                 Persistence-M | Bus-Id   |
| 0   NVIDIA GeForce RTX 4070        Off | 0000:01:00.0 |
+-----------------------------------------------------+

If nvidia-smi works but the desktop is black, you have a partial-success state. Skip straight to Method 1. If it errors out, move to Method 4 and boot with nomodeset first to get a usable terminal.

Method 1: Purge and Reinstall the NVIDIA Driver to Clear Conflicts

A clean purge fixes the majority of “black screen after driver install” cases. Half-installed packages, leftover blacklist entries, and an old initramfs image are usually the culprits, and the purge wipes all three.

Drop to a TTY first. Press Ctrl + Alt + F2 when the screen is black to reach a text login. Sign in with your username and password, then run:

sudo apt purge nvidia-* -y
sudo apt autoremove -y
sudo update-initramfs -u
sudo reboot

After the reboot, you will boot back into the open-source nouveau driver. Confirm it is working by reaching the desktop and running lsmod | grep nouveau. If you see output, your display is back.

Reinstall the recommended driver with sudo ubuntu-drivers autoinstall. This single recovery path is what I use on every friend’s laptop after a failed upgrade, and it solves the problem about 70% of the time.

Method 2: Fix xorg.conf Conflicts Causing a Black Screen

Stale or manually edited /etc/X11/xorg.conf files are the second most common cause of an install NVIDIA driver Ubuntu black screen. The NVIDIA installer often drops a custom section here that conflicts with the open-source one GDM or LightDM expects.

The quickest test is to remove it. From a TTY:

sudo mv /etc/X11/xorg.conf /etc/X11/xorg.conf.bak
sudo reboot

If the desktop returns after reboot, you have found the cause. Do not let any tool regenerate xorg.conf with nvidia-xconfig unless you specifically need a multi-monitor or EDID override. On modern Ubuntu, the driver auto-configures without it.

For Optimus laptops, also check /etc/X11/xorg.conf.d/ for any leftover 20-nvidia.conf or 10-nvidia.conf snippet you may have added in an older Ubuntu release. Removing the entire directory then rebooting is a safe reset:

sudo rm -rf /etc/X11/xorg.conf.d/
sudo reboot

Method 3: Configure nvidia-prime for Optimus and Dual-GPU Systems

If you have an Optimus laptop with Intel integrated graphics plus an NVIDIA GPU, you need nvidia-prime to switch between them. A common cause of black screens is having nvidia-prime installed without running prime-select, or vice versa. Pick one mode and stick with it.

Check your current profile:

prime-select query

Switch to NVIDIA on-demand for battery life, or full NVIDIA for performance:

sudo prime-select nvidia
sudo reboot

If the screen stays black after switching, the gdm-prime switching helper may be missing. Reinstall both packages together and reboot:

sudo apt install --reinstall nvidia-prime nvidia-prime-applet
sudo prime-select nvidia
sudo reboot

On Ubuntu 24.04 and newer, Wayland is now stable with NVIDIA 550+. If you do not need legacy X11 features, log out and pick the “Ubuntu (Wayland)” session from the gear icon on the login screen. Wayland avoids most of the xorg.conf headaches above.

Method 4: Adjust Kernel Parameters Like nomodeset and modeset

nomodeset is a last-resort boot parameter that tells the kernel not to load any display driver. Add it only when nothing else gets you a usable screen, because it disables your NVIDIA GPU entirely. Boot into the GRUB menu by holding Shift (BIOS) or tapping Esc (UEFI). Press e on the first entry, find the line starting with linux, and append nomodeset before quiet splash.

If your screen comes back after editing the GRUB line, the driver itself is at fault. Press Ctrl + X to boot, then once you reach the desktop, make the change permanent:

sudo nano /etc/default/grub
# Add nomodeset to GRUB_CMDLINE_LINUX_DEFAULT, save, then:
sudo update-grub

For NVIDIA’s newer modeset driver (the default on the 470+ branches), the reverse trick may be required: add nvidia-drm.modeset=1 instead of nomodeset. Newer GPUs need kernel mode setting enabled so they initialize properly at boot.

After the changes, always run sudo update-grub and reboot. If you still see only a black screen after editing GRUB, restart and remove the parameter you added instead.

Recovery: How to Undo a Bad Driver Install on Ubuntu

Sometimes the system is fully locked, not just black-screened. If Ctrl + Alt + F2 does nothing, the display server itself has crashed. Boot from a live USB and chroot into your installation to clean up.

From the live environment, mount your root and chroot in:

sudo mount /dev/sda2 /mnt
sudo mount /dev/sda1 /mnt/boot/efi
sudo mount --bind /dev /mnt/dev
sudo mount --bind /proc /mnt/proc
sudo mount --bind /sys /mnt/sys
sudo chroot /mnt

Replace /dev/sda2 with your actual root partition. Inside the chroot, run the same purge commands from Method 1 to fully reset the driver state. When you exit and reboot, the open-source driver should take over.

An easier recovery path is to boot a previous kernel from the GRUB “Advanced options” menu. Ubuntu keeps at least one older kernel installed. The old kernel almost always has a working NVIDIA driver, and from there you can purge and reinstall cleanly.

Secure Boot, BIOS Settings, and Other Easy-to-Miss Causes

Secure Boot silently blocks NVIDIA driver modules that are not signed by a key enrolled in your firmware. After running ubuntu-drivers autoinstall, the installer offers to enroll a Machine Owner Key (MOK) on the next reboot. Accept it, pick “Enroll MOK”, and confirm with the temporary password you set during install. Skipping this step leaves the module unsigned and the screen black.

BIOS settings trip up a lot of people too. On newer motherboards disable “Above 4G Decoding” and “Resizable BAR” if your system was stable with the open-source driver but black-screens with NVIDIA. Both features sometimes confuse the NVIDIA kernel module.

Do not ignore Wayland. Ubuntu 22.04 and 24.04 default to Xorg for NVIDIA installs, but Wayland is fully supported on the 545+ drivers. If you hit a black screen on Xorg, switch the session at the login screen and try again before purging anything. Switching sessions takes 10 seconds and often resolves the issue with zero driver changes.

Choosing the Right Driver Version for Your GPU and Ubuntu Release

Different Ubuntu releases support different driver branches out of the box. Ubuntu 22.04 LTS supports up to nvidia-driver-535 fully and nvidia-driver-550 with the HWE kernel. Ubuntu 24.04 LTS supports nvidia-driver-535, 550, and 570 out of the box, with the 570 branch preferred for RTX 40 and 50 series cards.

RTX 50 series (5090, 5080, 5070) cards require the 570 branch at minimum, and only on Ubuntu 24.04 with the 6.8+ kernel. Older Ubuntu releases cannot boot these cards. RTX 40 series cards work great on the 550 branch, which is what Ubuntu recommends by default on 24.04.

GTX 10 and 16 series cards are fine on the 535 branch. Older Kepler cards (GTX 600/700 series) need the 470 legacy branch and the kernel module nvidia may not load on kernels newer than 6.5. Use the latest LTS the card supports to avoid surprises.

Frequently Asked Questions

How to fix black screen after installing NVIDIA drivers?

The fastest fix is to switch to a TTY with Ctrl + Alt + F2, then run sudo apt purge nvidia-* -y u0026amp;u0026amp; sudo apt autoremove -y u0026amp;u0026amp; sudo update-initramfs -u u0026amp;u0026amp; sudo reboot. This wipes the broken driver and lets you boot back into nouveau so you can reinstall the correct version cleanly.

How to repair NVIDIA drivers in Ubuntu?

Run ubuntu-drivers list to see tested options, then sudo ubuntu-drivers autoinstall to let Ubuntu pick the correct driver branch for your GPU and release. Reboot and confirm with nvidia-smi that the driver loaded.

How to fix a corrupted NVIDIA driver?

Purge all nvidia-* packages, autoremove leftovers, regenerate the initramfs with update-initramfs -u, then reinstall with ubuntu-drivers autoinstall. If your xorg.conf is stale, move it to xorg.conf.bak before rebooting.

Why is my screen black when I install NVIDIA drivers?

Common causes are a stale /etc/X11/xorg.conf, Secure Boot not enrolling the MOK key, kernel mode setting conflicts with nomodeset, and picking a driver branch that does not match your kernel version. Each cause has a dedicated section in this guide.

How to remove the NVIDIA driver on Ubuntu?

From a TTY run sudo apt purge nvidia-* and sudo apt autoremove, then sudo update-initramfs -u and sudo reboot. This restores the open-source nouveau driver and your GUI.

Does Ubuntu have problems with NVIDIA?

Older releases did, but Ubuntu 24.04 with the 550+ driver branch is very stable on NVIDIA hardware, including RTX cards. Most remaining issues are Secure Boot misconfigurations or leftover xorg.conf files from earlier installs.

Final Thoughts: Getting Your NVIDIA Driver Working on Ubuntu

The order in this guide matters: prerequisites first, then a clean ubuntu-drivers autoinstall, and only when that fails do you purge, fix xorg.conf, or touch kernel parameters. Most installs succeed without ever needing nomodeset. When you do get stuck, the nvidia-bug-report.sh log file gives you everything a forum helper needs. Generate it from a working TTY and post it to your thread.

I hope this guide helps you install the correct NVIDIA driver on Ubuntu and fix your black screen fast. Drop your hardware and driver version in the comments if you are still stuck, and we can work through the log together.

Leave a Comment