~ Moon Tzu
In the art of installing NVIDIA drivers, one must first identify the graphics card, choose the right the driver, and be prepared for the reboot, lest your screen go dark and your spirit falter.
Hello everyone! Today, I’m going to guide you through the process of installing NVIDIA drivers on Ubuntu 20.04 Focal Fossa. We’ll cover several methods to switch from the open-source Nouveau driver to the proprietary NVIDIA driver. This guide will help you enhance the performance of your graphics card, particularly useful for gaming, video editing, and other graphic-intensive tasks.
Why Choose the NVIDIA Driver?
The Nouveau driver, which is open-source and comes installed by default, works well for basic tasks. However, for high-end gaming or video editing, the proprietary NVIDIA driver can offer better performance and stability. You can install the NVIDIA driver from the Ubuntu repository, the NVIDIA PPA repository, or directly from the official NVIDIA website. Let’s dive into each method.
Method 1: Installing NVIDIA Drivers from the Ubuntu Repository
This method is straightforward and recommended for most users. You can use either the GNOME GUI or the command line.
GNOME GUI Method
- Open the Software & Updates application.
- Select the “Additional Drivers” tab. Here, you will see a list of available NVIDIA drivers. Choose the latest proprietary driver.
- Apply the changes and wait for the installation to complete.
- Reboot your system.
Command Line Method
Detect your NVIDIA graphic card model and the recommended driver:
bash
$ ubuntu-drivers devices
Install the recommended driver:
bash$ sudo ubuntu-drivers autoinstall
Reboot your system:
$ sudo reboot
Method 2: Installing NVIDIA Drivers from the PPA Repository
Using the PPA repository can provide you with bleeding-edge NVIDIA beta drivers. Note that these may be less stable.
Add the PPA repository:
$ sudo add-apt-repository ppa:graphics-drivers/ppa
$ sudo apt update
Detect your NVIDIA graphic card model and the recommended driver:
$ ubuntu-drivers devices
Install the recommended driver:
$ sudo ubuntu-drivers autoinstall
Or, install a specific driver version:
bash
$ sudo apt install nvidia-driver-535
Reboot your system:
$ sudo reboot
Method 3: Installing NVIDIA Drivers from the Official Website
This method involves more steps and might require troubleshooting, but it ensures you have the latest driver version.
Identify your NVIDIA VGA card:
$ lshw -numeric -C display
Download the official NVIDIA driver from their website.
Install the necessary prerequisites:
$ sudo apt install build-essential libglvnd-dev pkg-config
Disable the Nouveau driver and reboot your system:
$ sudo nano /etc/modprobe.d/blacklist-nouveau.conf
Add the following lines:
blacklist nouveau
options nouveau modeset=0
Then, update the initramfs:
$ sudo update-initramfs -u
$ sudo reboot
Stop the current display server:
$ sudo telinit 3
Install the NVIDIA driver:
$ sudo bash <Name-Of-Your-Installed-File>.run
Reboot Your System
$ sudo reboot
If your screen goes black after rebooting , you can access the console using Ctrl+Alt+{F1-F6} . After pressing Ctrl+Alt+F1 you can use prime-select to change you default graphics driver to intel , or proceed with reinstalling driver if you feel it was broken .
How to Uninstall NVIDIA Drivers
If you ever need to switch back to the Nouveau driver, follow these steps:
Uninstall the NVIDIA driver:
$ sudo apt-get purge '^nvidia.*'
Reinstall the Nouveau driver:
$ sudo apt-get install xserver-xorg-video-nouveau
Reboot your system:
$ sudo reboot
Related Tutorials: