How to Install NVIDIA Drivers on Ubuntu
Learn how to install NVIDIA drivers on Ubuntu with GUI or command-line methods. This educational guide covers prerequisites, driver choices, secure boot considerations, verification, and troubleshooting for a CUDA-ready system.
Conquer Ubuntu GPU setup by installing NVIDIA drivers through the GUI or command line. This guide covers prerequisites, driver choice (proprietary vs open-source), and post-install verification to ensure CUDA-ready performance. By the end, you’ll have a stable NVIDIA driver installed on Ubuntu, with options explained for driver versions, and steps to verify your GPU is active. You will also know how to troubleshoot common issues like black screens and failed module loading.
Why installing NVIDIA drivers on Ubuntu matters
For homeowners and DIY enthusiasts, a properly configured NVIDIA driver on Ubuntu unlocks peak graphics performance, smoother gaming, and accelerated workloads like CUDA-based computing. Ubuntu users often contend with a choice between the open-source nouveau driver and NVIDIA's proprietary driver. While nouveau provides basic functionality, the proprietary NVIDIA driver delivers full CUDA support, better power management, and hardware-accelerated rendering. According to Install Manual, choosing the right driver version and maintaining it properly reduces driver crashes and kernel compatibility issues. This section explains why staying current with NVIDIA drivers matters for both daily tasks and advanced projects, and how a well-managed driver improves stability and performance across software updates. It also clarifies when you should switch between open-source and proprietary options for your hardware and use case.
In practice, most Ubuntu systems today benefit from installing the official NVIDIA driver, especially if you run graphic-intensive apps or CUDA workloads. The Install Manual team emphasizes that consistency between kernel modules and driver versions minimizes disruptions after system upgrades. With careful planning, you can keep your GPU ready for gaming, 3D rendering, ML development, and multimedia tasks without frequent reconfigurations. This quick overview sets the stage for a safe, repeatable installation process that won’t derail your day-to-day tasks. install nvidia drivers ubuntu
format-deployed-for-consumption
Tools & Materials
- Computer with Ubuntu 20.04+ installed(Prefer Ubuntu 22.04 LTS or newer for broad driver support)
- Internet connection(Needed to fetch packages, updates, and firmware)
- Administrative access (sudo)(Required to install or modify system drivers)
- linux-headers and build tools(Install linux-headers-$(uname -r), build-essential, and dkms)
- Secure Boot (optional handling)(If using DKMS, you may need to disable Secure Boot or enroll keys)
- CUDA toolkit (optional)(Only if you plan to develop CUDA applications)
Steps
Estimated time: 20-40 minutes
- 1
Identify GPU and current driver status
Open a terminal and run commands to identify your NVIDIA GPU model and current driver state. Use lspci -nnk | grep -i nvidia and, if possible, nvidia-smi to check active driver status. This helps you decide whether you need to install or upgrade drivers and avoids conflicts with the open-source nouveau driver.
Tip: If nvidia-smi returns a driver version, note it for later verification. - 2
Update system and install prerequisites
Update package lists and install essential build tools. Run sudo apt update && sudo apt upgrade -y, then sudo apt install build-essential dkms linux-headers-$(uname -r) to prepare DKMS modules for kernel compatibility.
Tip: Keeping headers aligned with your running kernel prevents module signing issues. - 3
Choose your installation method
Decide between the GUI route (Additional Drivers) or the CLI route (ubuntu-drivers autoinstall). The GUI is beginner-friendly; the CLI offers a hands-off, deterministic install. The choice affects how you manage driver versions and future updates.
Tip: If you’re unsure, start with the GUI and switch to CLI if you want automation. - 4
Install NVIDIA drivers (CLI method)
If you choose the CLI, install the driver with sudo ubuntu-drivers autoinstall or sudo apt install nvidia-driver. This step automatically selects a compatible, tested driver for your kernel and GPU. After installation, reboot the system to load the new kernel modules.
Tip: Autoinstall minimizes version conflicts and ensures DKMS integration. - 5
Install NVIDIA drivers (GUI method)
Open the Software & Updates tool, navigate to Additional Drivers, and select the recommended NVIDIA driver. Apply changes and reboot. This path is straightforward for users who prefer a visual installer and confirmed compatibility.
Tip: Reboot is required for the driver to load correctly after selection. - 6
Verify and troubleshoot
After reboot, run nvidia-smi to verify the driver is active and your GPU is visible. If issues arise (black screen, no GPU detected), check Secure Boot status, re-run installation, or revert to nouveau temporarily. Keep a backup plan in case of kernel- or driver-level conflicts.
Tip: If you encounter issues, consult journald logs (journalctl -k) for kernel messages related to nvidia.
Got Questions?
Do I need to disable Secure Boot to install NVIDIA drivers on Ubuntu?
Not always, but Secure Boot can block DKMS-installed modules. If you use DKMS, disable Secure Boot or enroll keys; for some systems, the GUI driver from Ubuntu repositories works without disabling. Always verify driver load after reboot.
Secure Boot can block unsigned DKMS modules. If you use DKMS, consider disabling Secure Boot or enrolling keys; otherwise, use the Ubuntu-provided driver and verify after reboot.
Which method is best for beginners—GUI or CLI?
For beginners, the GUI method via Additional Drivers is easiest and safer. Advanced users can use ubuntu-drivers autoinstall for a hands-off, repeatable process. In either case, verify with nvidia-smi after installation.
Beginners should start with the GUI, while more advanced users can use the autoinstall command for automation.
How can I verify that the NVIDIA driver is active?
Run nvidia-smi to check the driver version and GPU status. You can also use nvidia-settings if installed to view GPU details and compute capabilities.
Run nvidia-smi to confirm the driver is active and the GPU is detected; use nvidia-settings if available.
How do I revert to the Nouveau driver if something goes wrong?
Purge NVIDIA packages with sudo apt purge 'nvidia-*' and reboot. The Nouveau driver should reinitialize, but you may need to reconfigure xorg or display settings afterward.
If problems arise, purge NVIDIA drivers and reboot to revert to Nouveau.
Will CUDA work with the NVIDIA drivers installed this way?
CUDA requires both a supported driver and toolkit. After driver installation, install the CUDA toolkit if you plan to develop CUDA applications, ensuring compatibility with your driver version.
CUDA needs a compatible driver and toolkit; install CUDA if you plan CUDA development.
What should I do if I get a black screen after installing the driver?
Boot into a recovery or previous kernel, revert drivers if needed, and reattempt installation with secure boot disabled or using the GUI method. Check logs for module load errors.
If a black screen occurs, boot safely, revert drivers, and retry with Secure Boot considerations.
Watch Video
Main Points
- Identify GPU model and current driver status before changes
- Choose GUI or CLI method based on comfort level
- Verify installation with nvidia-smi and reboot after changes
- Secure Boot handling affects DKMS modules and stability

