How to Install Nvidia Drivers on Ubuntu 20.04

Introduction

Installing Nvidia drivers on Ubuntu 20.04 is a relatively straightforward process. This guide will walk you through the steps necessary to get your Nvidia graphics card up and running on your Ubuntu system. We will cover the installation of the proprietary Nvidia drivers, as well as the open source Nouveau drivers. We will also discuss how to configure your system to use the drivers, and how to troubleshoot any issues that may arise. By the end of this guide, you should have a fully functioning Nvidia graphics card on your Ubuntu system.

How to Install Nvidia Drivers on Ubuntu 20.04

1. Open the Terminal by pressing Ctrl+Alt+T.

2. Update the package list by typing the following command:

sudo apt update

3. Install the latest Nvidia drivers by typing the following command:

sudo apt install nvidia-driver-450

4. Reboot your system to apply the changes.

5. After the reboot, open the Terminal again and type the following command to check if the Nvidia drivers are installed correctly:

nvidia-smi

6. If the command returns the details of your Nvidia GPU, then the installation was successful.

Introduction

Nvidia GPUs (graphics processing units) have exceptional parallel computing potential, much higher than that of CPUs. That is why GPUs are becoming the main choice for high-performance workloads.

Aside from gaming, Nvidia GPUs are also used for 3D rendering, mining, visualization, machine learning, AI, and in data centers. For example, phoenixNAP GPU dedicated servers use Nvidia Tesla GPUs.

In this tutorial, you will learn how to install the latest proprietary Nvidia drivers on Ubuntu 20.04.

How to install Nvidia drivers on Ubuntu 20.04

Prerequisites

  • A machine running Ubuntu 20.04
  • An account with sudo/root permissions
  • An Nvidia GPU

Note: Learn why and how GPUs are used for machine learning and AI in our article on GPU Machine Learning.

Install Nvidia Driver Using GUI

Ubuntu comes with open-source Nouveau drivers for Nvidia GPUs out of the box. The Nouveau driver does not harness the GPU’s full power and sometimes performs worse or even causes system instability. Nvidia proprietary drivers are much more reliable and stable.

The first way to install Nvidia drivers is by using the GUI Software & Updates app.

Step 1: Open Software and Updates From the App Menu

1. Open the Applications menu and type “software and updates.”

2. Select the Software and Updates app.

Step 2: Click the Additional Drivers Tab

Wait for the app to download a list of additional drivers available for your GPU.

Install proprietary Nvidia drivers via a GUI app.

The driver installed on your machine is selected by default. It is usually an open-source Nouveau display driver.

Step 3: Choose a Driver

1. From the list, select the latest Nvidia driver labeled proprietary, tested. This is the latest stable driver published by Nvidia for your GPU.

Choose a proprietary Nvidia driver to install on Ubuntu 20.04

2. Click Apply Changes.

3. Enter your password and wait for the installation to finish.

Step 4: Restart

Restart the machine for the changes to take effect.

Install Nvidia Driver via Command Line

The second way to install Nvidia drivers is by using the terminal.

Step 1: Search for Nvidia Drivers

1. Open the terminal by pressing Ctrl+Alt+T or search for “terminal” in the Applications menu.

2. Run the following command:

apt search nvidia-driver
Search for available Nvidia drivers using the terminal in Ubuntu 20.04.

The output shows a list of available drivers for your GPU.

Step 2: Update the System Package Repository

Before installing the driver, make sure to update the package repository. Run the following commands:

sudo apt update
sudo apt upgrade

Step 3: Install the Right Driver for Your GPU

1. Choose a driver to install from the list of available GPU drivers. The best fit is the latest tested proprietary version.

2. The syntax for installing the driver is:

sudo apt install [driver_name]
Install Nvidia drivers by using the terminal in Ubuntu 20.04

For this tutorial, we installed nvidia-driver-340, the latest tested proprietary driver for this GPU.

Step 4: Reboot

Reboot your machine with the following command:

sudo reboot

Install Nvidia Beta Drivers via PPA Repository

The PPA repository allows developers to distribute software that is not available in the official Ubuntu repositories. This means that you can install the latest beta drivers, however, at the risk of an unstable system.

To install the latest Nvidia drivers via the PPA repository, follow these steps:

Step 1: Add PPA GPU Drivers Repository to the System

1. Add the graphics drivers repository to the system with the following command:

sudo add-apt-repository ppa:graphics-drivers/ppa
Add the GPU PPA repository to Ubuntu 20.04.

2. Enter your password and hit Enter when asked if you want to add the repository.

Step 2: Identify GPU Model and Available Drivers

To verify which GPU model you are using and to see a list of available drivers, run the following command:

ubuntu-drivers devices
Identify GPU and available Nvidia drivers in Ubuntu 20.04.

The output shows your GPU model as well as any available drivers for that specific GPU.

Step 3: Install Nvidia Driver

1. To install a specific driver, use the following syntax:

sudo apt install [driver_name]
Install Nvidia drivers by using the terminal in Ubuntu 20.04

For example, we installed the nvidia-340 driver version.

2. Alternatively, install the recommended driver automatically by running:

sudo ubuntu-drivers autoinstall
Install the recommended Nvidia driver automatically in Ubuntu 20.04.

In this example, no changes were made as the recommended driver is already installed.

Step 4: Restart the System

Reboot the machine for the changes to take effect.

How to Uninstall Nvidia Driver

If you want to uninstall the proprietary Nvidia driver, the best option is to remove --purge the driver.

Step 1: See Installed Packages

To check which Nvidia packages are installed on the system, run the following command:

dpkg -l | grep -i nvidia
See installed Nvidia packages on Ubuntu 20.04.

The output returns a list of all Nvidia packages on the system.

See also our article on how to list installed packages on Ubuntu.

Note: The ubuntu-desktop package could also be purged because it is a dependency of the nvidia-common package, so you may need to reinstall it if it gets removed.

Step 2: Purge Nvidia Packages

1. Run the following command:

sudo apt-get remove --purge '^nvidia-.*'
Remove all Nvidia packages from Ubuntu 20.04.

The command purges every Nvidia package from the system.

2. If the ubuntu-desktop package is removed, reinstall it with the following command:

sudo apt-get install ubuntu-desktop

Step 4: Reboot the System

Reboot your system by running sudo reboot. By default, the system loads the open-source Nouveau driver during boot.

Note: Check out our other Nvidia installation guides:

Conclusion

You now know how to install proprietary Nvidia drivers on your system using the GUI app, official Ubuntu repository, or the PPA repository if you want the beta versions.

You also know how to uninstall Nvidia drivers if you want to go back to using the open-source Nouveau driver.

How to Install Nvidia Drivers on Ubuntu 20.04

Installing Nvidia drivers on Ubuntu 20.04 is a relatively straightforward process. This guide will walk you through the steps necessary to get your Nvidia graphics card up and running.

Step 1: Download the Latest Nvidia Drivers

The first step is to download the latest Nvidia drivers for your graphics card. You can find the drivers on the Nvidia website. Make sure to select the correct version for your system.

Step 2: Install the Drivers

Once you have downloaded the drivers, you can install them by running the following command in a terminal window:

sudo apt install ./nvidia-driver-version.run

Replace “nvidia-driver-version.run” with the name of the driver file you downloaded.

Step 3: Reboot Your System

Once the drivers have been installed, you will need to reboot your system for the changes to take effect. After the reboot, your Nvidia graphics card should be up and running.

Conclusion

Installing Nvidia drivers on Ubuntu 20.04 is a relatively straightforward process. This guide has walked you through the steps necessary to get your Nvidia graphics card up and running. If you have any questions or comments, please feel free to leave them in the comments section below.

Jaspreet Singh Ghuman

Jaspreet Singh Ghuman

Jassweb.com/

Passionate Professional Blogger, Freelancer, WordPress Enthusiast, Digital Marketer, Web Developer, Server Operator, Networking Expert. Empowering online presence with diverse skills.

jassweb logo

Jassweb always keeps its services up-to-date with the latest trends in the market, providing its customers all over the world with high-end and easily extensible internet, intranet, and extranet products.

Contact
San Vito Al Tagliamento 33078
Pordenone Italy
Item added to cart.
0 items - 0.00
Open chat
Scan the code
Hello 👋
Can we help you?