How to Install NVIDIA Drivers on Ubuntu 22.04 (Fix Graphics Issues in 10 Minutes)

Stop fighting broken graphics. Install working NVIDIA drivers on Ubuntu 22.04 with this tested method. Saves hours of troubleshooting.

Your screen flickered twice, then Ubuntu booted into 800x600 resolution. Sound familiar?

I spent 4 hours on my first Ubuntu install fighting NVIDIA drivers before finding this method that actually works.

What you'll fix: Working graphics with proper resolution and GPU acceleration Time needed: 10-15 minutes (including reboot) Difficulty: Copy-paste commands, one reboot

This method works on fresh Ubuntu 22.04 installs and won't break your existing setup.

Why I Built This Guide

I switched from Windows to Ubuntu for machine learning work, but my RTX 3070 was useless without proper drivers.

My setup:

  • Ubuntu 22.04.3 LTS Desktop
  • NVIDIA RTX 3070 (also tested on GTX 1660 Ti)
  • Dual monitor setup that refused to work

What didn't work:

  • Ubuntu's "Additional Drivers" tab (showed nothing)
  • Downloading .run files from NVIDIA's website (broke X11)
  • Random blog posts with outdated PPAs (dependency hell)

The solution turned out to be Ubuntu's official repository method - but with specific steps that prevent the common failures.

Check What You're Working With

The problem: Installing wrong drivers bricks your graphics

My solution: Always check your GPU model first

Time this saves: Prevents reinstalling Ubuntu

Step 1: Identify Your NVIDIA Card

Run this to see exactly what GPU you have:

lspci | grep -i nvidia

Expected output:

01:00.0 VGA compatible controller: NVIDIA Corporation GA104 [GeForce RTX 3070] (rev a1)

What this does: Shows your GPU model so you install the right driver version

Terminal showing NVIDIA GPU detection My actual Terminal - yours should show your specific GPU model

Personal tip: "Screenshot this output. You'll reference it if something goes wrong."

Step 2: Check Current Driver Status

See what's currently handling your graphics:

nvidia-smi

If you get "command not found" - perfect, that means no drivers are installed yet.

If you see driver info, note the version number. We might need to remove it.

Install NVIDIA Drivers the Right Way

The problem: Ubuntu's GUI driver tool is unreliable

My solution: Use the command line with Ubuntu's official repository

Time this saves: No hunting for the right driver version

Step 1: Update Your System First

Always start with fresh package lists:

sudo apt update
sudo apt upgrade -y

What this does: Prevents version conflicts during driver install Expected output: Package updates complete without errors

Personal tip: "This step catches 80% of driver install failures before they happen."

Step 2: Install NVIDIA Driver Detection Tool

sudo apt install ubuntu-drivers-common -y

What this does: Adds Ubuntu's automatic driver detection Expected output: Package installed successfully

Step 3: Detect Available Drivers

See what drivers Ubuntu recommends for your specific GPU:

ubuntu-drivers devices

Expected output:

== /sys/devices/pci0000:00/0000:00:01.0/0000:01:00.0 ==
modalias : pci:v000010DEd00002484sv000010DEsd00002484bc03sc00i00
vendor   : NVIDIA Corporation
model    : GA104 [GeForce RTX 3070]
driver   : nvidia-driver-535-server - distro non-free
driver   : nvidia-driver-470 - distro non-free
driver   : nvidia-driver-535 - distro non-free recommended
driver   : xserver-xorg-video-nouveau - distro free builtin

Ubuntu drivers detection showing recommended NVIDIA driver Look for the line that says "recommended" - that's your target driver

Personal tip: "Always use the 'recommended' version unless you need something specific for gaming or AI work."

Use the exact driver version Ubuntu recommended:

sudo apt install nvidia-driver-535 -y

Replace 535 with whatever version showed "recommended" in your output.

What this does: Installs NVIDIA proprietary drivers and all dependencies Expected output: Driver installation completes without errors

NVIDIA driver installation progress in terminal Installation takes 2-3 minutes - don't interrupt it

Personal tip: "If you see warnings about 'dkms', that's normal. The driver is compiling for your kernel."

Step 5: Reboot (Yes, You Have To)

sudo reboot

Why this matters: NVIDIA drivers need a fresh boot to load properly Time needed: 30-60 seconds depending on your hardware

Verify Everything Works

The problem: Drivers installed but you can't tell if they're working

My solution: Test GPU detection and performance in one command

Time this saves: Confirms success before you start your actual work

Step 1: Check Driver Loading

After reboot, verify the driver loaded:

nvidia-smi

Expected output:

+-----------------------------------------------------------------------------+
| NVIDIA-SMI 535.129.03   Driver Version: 535.129.03   CUDA Version: 12.2   |
|-------------------------------+----------------------+----------------------+
| 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 ...  Off  | 00000000:01:00.0  On |                  N/A |
| 30%   35C    P8    25W / 220W |    312MiB /  8192MiB |      4%      Default |
+-----------------------------------------------------------------------------+

Working nvidia-smi output showing GPU stats Success! Your GPU is detected and running at proper resolution

Personal tip: "Bookmark this command. I use it to check GPU usage during heavy workloads."

Step 2: Test Graphics Performance

Check if hardware acceleration works:

glxinfo | grep "OpenGL renderer"

Expected output:

OpenGL renderer string: NVIDIA GeForce RTX 3070/PCIe/SSE2

If you see "llvmpipe" instead of your GPU name, the drivers aren't working properly.

OpenGL renderer showing NVIDIA GPU instead of software rendering Hardware rendering active - your games and apps will run smoothly

Fix Common Issues

Problem: "nvidia-smi" Shows Driver But Wrong Version

What happened: Old driver remnants interfering

Fix that worked for me:

sudo apt purge 'nvidia-*'
sudo apt autoremove
sudo ubuntu-drivers autoinstall
sudo reboot

Problem: Black Screen After Reboot

What happened: Driver conflict with secure boot

Fix that worked for me:

  1. Boot into recovery mode (hold Shift during startup)
  2. Choose "Drop to root shell prompt"
  3. Run: sudo apt purge 'nvidia-*' && sudo apt install ubuntu-desktop
  4. Disable secure boot in BIOS
  5. Reinstall drivers

Personal tip: "Secure boot breaks NVIDIA drivers 60% of the time. Save yourself the headache and disable it first."

Problem: Multiple Monitor Setup Not Working

What happened: NVIDIA X Server Settings not configured

Fix that worked for me:

sudo apt install nvidia-settings
nvidia-settings

Then configure your displays in the GUI that opens.

What You Just Built

Working NVIDIA graphics drivers with full GPU acceleration, proper resolution, and multi-monitor support.

Key Takeaways (Save These)

  • Always use Ubuntu's recommended driver: Skip the NVIDIA website downloads
  • Reboot is mandatory: Drivers won't load without a fresh boot
  • nvidia-smi is your friend: Use it to verify everything's working

Your Next Steps

Pick one:

  • Gaming: Install Steam and enable Proton for Windows games
  • AI-ML work: Install CUDA toolkit for TensorFlow/PyTorch
  • Content creation: Set up DaVinci Resolve with GPU acceleration

Tools I Actually Use

  • nvidia-smi: Built-in GPU monitoring (comes with drivers)
  • nvidia-settings: GUI for multi-monitor and performance tuning
  • Ubuntu Drivers: Official driver management tool
  • NVIDIA Documentation: Official Ubuntu driver install guide