Introduction
When installing official NVIDIA proprietary drivers on Linux, you'll encounter an error if the Nouveau kernel driver is currently in use. Nouveau is the open-source driver for NVIDIA graphics cards that comes pre-installed with most Linux distributions.
In this comprehensive guide, we'll explain how to blacklist the Nouveau driver on Ubuntu, Debian, Fedora, and other Linux distributions to successfully install NVIDIA proprietary drivers.
⚠️ WARNING: This tutorial involves modifying system files and could potentially break your system. Always backup your system before proceeding and ensure you have a way to access your system via recovery mode or TTY.
The Error Message
When attempting to install NVIDIA drivers, you may see this error:
ERROR: The Nouveau kernel driver is currently in use by your system.
This driver is incompatible with the NVIDIA driver, and must be disabled
before proceeding. Please consult the NVIDIA driver README and your Linux
distribution's documentation for details on how to correctly disable the
Nouveau kernel driver.
Why Blacklist Nouveau?
The Nouveau driver and NVIDIA proprietary driver cannot coexist. You need to blacklist Nouveau because:
- Driver Conflict: Both drivers try to control the same hardware
- Installation Blocker: NVIDIA installer refuses to continue while Nouveau is loaded
- Performance: NVIDIA proprietary drivers typically offer better performance
- CUDA Support: Nouveau doesn't support CUDA for machine learning and GPU computing
Method 1: Blacklist Nouveau on Ubuntu/Debian
Step 1: Remove Existing NVIDIA Packages
First, clean up any existing NVIDIA installations:
sudo apt-get remove --purge nvidia*
sudo apt-get autoremove
If you see "no matches found," that's okay—it means no NVIDIA packages were installed.
Step 2: Install Required Dependencies
Install the necessary packages for building kernel modules:
sudo apt-get update
sudo apt-get install build-essential dkms linux-headers-$(uname -r)
Step 3: Create Blacklist Configuration File
Create a new blacklist file for Nouveau:
sudo nano /etc/modprobe.d/blacklist-nouveau.conf
Add the following content:
blacklist nouveau
blacklist lbm-nouveau
options nouveau modeset=0
alias nouveau off
alias lbm-nouveau off
Save and exit (Ctrl+X, then Y, then Enter).
Step 4: Update Initramfs
Regenerate the initial ramdisk to apply the blacklist:
sudo update-initramfs -u
Step 5: Reboot
Restart your system:
sudo reboot
Step 6: Verify Nouveau is Disabled
After rebooting, confirm Nouveau is no longer loaded:
lsmod | grep nouveau
If no output appears, Nouveau is successfully disabled.
Method 2: Blacklist Nouveau on Fedora/RHEL/CentOS
Step 1: Create Blacklist File
sudo nano /etc/modprobe.d/blacklist-nouveau.conf
Add the following:
blacklist nouveau
options nouveau modeset=0
Step 2: Regenerate Initramfs
On Fedora/RHEL systems, use dracut:
sudo dracut --force
Step 3: Reboot
sudo reboot
Step 4: Verify
lsmod | grep nouveau
Method 3: Blacklist Nouveau on Arch Linux
Step 1: Create Blacklist File
sudo nano /etc/modprobe.d/blacklist-nouveau.conf
Add:
blacklist nouveau
Step 2: Regenerate Initramfs
sudo mkinitcpio -P
Step 3: Reboot and Verify
sudo reboot
# After reboot:
lsmod | grep nouveau
Method 4: GRUB Kernel Parameter Method
An alternative method is to disable Nouveau via GRUB kernel parameters:
Step 1: Edit GRUB Configuration
sudo nano /etc/default/grub
Find the line starting with GRUB_CMDLINE_LINUX_DEFAULT and add nouveau.modeset=0:
GRUB_CMDLINE_LINUX_DEFAULT="quiet splash nouveau.modeset=0"
Step 2: Update GRUB
On Ubuntu/Debian:
sudo update-grub
On Fedora/RHEL:
sudo grub2-mkconfig -o /boot/grub2/grub.cfg
On Arch:
sudo grub-mkconfig -o /boot/grub/grub.cfg
Step 3: Reboot
sudo reboot
Installing NVIDIA Drivers After Blacklisting
Once Nouveau is blacklisted, you can install NVIDIA drivers:
Ubuntu (Recommended Method)
# Check available drivers
ubuntu-drivers devices
# Install recommended driver
sudo ubuntu-drivers autoinstall
# Or install specific version
sudo apt install nvidia-driver-535
Using NVIDIA's Official Installer
- Download the driver from NVIDIA's website
- Switch to text mode (TTY): Press Ctrl+Alt+F3
- Stop the display manager:
bash sudo systemctl stop gdm # GNOME sudo systemctl stop sddm # KDE sudo systemctl stop lightdm # Other - Run the installer:
bash chmod +x NVIDIA-Linux-x86_64-*.run sudo ./NVIDIA-Linux-x86_64-*.run - Follow the on-screen prompts
- Reboot
Troubleshooting
Problem: Black Screen After Reboot
If you get a black screen after blacklisting Nouveau:
- Press Ctrl+Alt+F2 to access TTY
- Login with your credentials
- Install NVIDIA drivers from command line
- Reboot
Problem: Can't Access TTY
Boot into recovery mode:
- Hold Shift during boot to access GRUB
- Select "Advanced options"
- Choose recovery mode
- Select "root" to get a shell
- Make necessary changes
Problem: Nouveau Still Loading
If lsmod | grep nouveau still shows the module:
- Check all blacklist files:
bash grep -r nouveau /etc/modprobe.d/ - Ensure initramfs was regenerated
- Try adding to
/etc/modprobe.d/nvidia-installer-disable-nouveau.conf
Reverting Changes
To re-enable Nouveau (if needed):
# Remove the blacklist file
sudo rm /etc/modprobe.d/blacklist-nouveau.conf
# Regenerate initramfs
sudo update-initramfs -u # Ubuntu/Debian
sudo dracut --force # Fedora
# Reboot
sudo reboot
Verifying NVIDIA Driver Installation
After installing NVIDIA drivers, verify the installation:
# Check NVIDIA driver version
nvidia-smi
# Check loaded kernel modules
lsmod | grep nvidia
# Check OpenGL renderer
glxinfo | grep "OpenGL renderer"
Expected nvidia-smi output:
+-----------------------------------------------------------------------------+
| NVIDIA-SMI 535.154.05 Driver Version: 535.154.05 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% 45C P8 10W / 200W | 500MiB / 8192MiB | 2% Default |
+-------------------------------+----------------------+----------------------+
Summary
To blacklist the Nouveau driver in Linux:
- Create
/etc/modprobe.d/blacklist-nouveau.confwith blacklist rules - Regenerate initramfs (
update-initramfs -uordracut --force) - Reboot and verify with
lsmod | grep nouveau - Install NVIDIA proprietary drivers
This process works on Ubuntu, Debian, Fedora, CentOS, RHEL, Arch Linux, and most other distributions with minor variations in commands.