NVIDIA Graphics Card
This article has been initially checked against the Ubuntu 26.04 LTS April 2026 release notes. NVIDIA driver versions, Wayland behavior, and suspend/resume issues still need ongoing validation.
Check GPU Model
lspci | grep -i nvidiaDriver Installation Methods
Method 1: Using ubuntu-drivers (Recommended)
sudo ubuntu-drivers devices
sudo ubuntu-drivers autoinstallThis command will automatically detect and install the most suitable driver version for your GPU.
Method 2: Manual installation from APT
sudo apt update
# Use the version recommended by `ubuntu-drivers devices`, for example:
sudo apt install nvidia-driver-580Run ubuntu-drivers devices first to see the version recommended for your hardware, then replace the version number above with that value. The 26.04 repository currently ships several series, from 580 (the LTS branch) through 590/595. When unsure, prefer the version marked recommended. To view the versions available in the repository:
apt list nvidia-driver-*Method 3: Install from NVIDIA website (Not recommended)
Download the .run file from the NVIDIA website . This method may conflict with the system package manager and is not recommended for regular users.
Post-Installation Verification
nvidia-smiThis should display the driver version, GPU model, and VRAM usage.
CUDA Installation
Install CUDA Toolkit
Ubuntu 26.04 ships the NVIDIA CUDA Toolkit in its official repositories:
sudo apt install cuda-toolkitVerify installation:
nvcc --versionInstall a Specific CUDA Version
If you need a specific version (e.g., for deep learning frameworks), it is recommended to use the official NVIDIA repository:
wget 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
sudo apt update
sudo apt install cuda-toolkit-12-8Dual GPU Switching (PRIME)
Laptops typically have an integrated + discrete GPU configuration:
# Check current mode
prime-select query
# Switch to NVIDIA discrete GPU
sudo prime-select nvidia
# Switch to Intel integrated GPU (power saving)
sudo prime-select intel
# On-demand mode (recommended for laptop users)
sudo prime-select on-demandYou need to log out or reboot after switching.
Common Issues
Black screen after boot
- At the GRUB menu, press
eand addnomodesetat the end of thelinuxline - Once in the system, remove the problematic driver:
sudo apt purge 'nvidia-*'
sudo apt autoremove
sudo reboot- Reinstall the correct driver version
NVIDIA on Wayland
Ubuntu 26.04 uses Wayland by default. NVIDIA driver 535+ has good Wayland support. Confirm that the GBM backend is enabled:
echo $XDG_SESSION_TYPE
# Should output waylandThe 26.04 Ubuntu Desktop session is Wayland-only, so the login screen no longer offers a “GNOME on Xorg” option. If you hit compatibility issues under Wayland, install another desktop that provides an X.org session (such as kubuntu-desktop or xubuntu-desktop) and pick its X.org session at the login screen. See Wayland Compatibility Issues for details.
Secure Boot and Driver Signing
If Secure Boot is enabled, you will be prompted to set a MOK password during driver installation. After rebooting, select “Enroll MOK” in the blue MOK management screen and enter the password to complete registration.
# Check Secure Boot status
mokutil --sb-stateDriver Version Conflicts
# Completely remove NVIDIA drivers
sudo apt purge 'nvidia-*' 'libnvidia-*'
sudo apt autoremove
sudo rm -f /etc/X11/xorg.conf
# Ubuntu 26.04 generates the initramfs with Dracut by default:
sudo dracut -f
# If your system still uses the legacy initramfs-tools, use instead:
# sudo update-initramfs -u
sudo rebootRelated Articles
- NVIDIA / AMD Drivers (Gaming) — GPU driver installation and performance tuning for gaming scenarios
- Black Screen / Boot Hang — Troubleshooting and fixing black screen after NVIDIA driver installation
- Laptop Suspend & Hibernate — Suspend, hibernate, and power management issues for discrete GPU laptops