How to Install Nvidia Driver on Ubuntu 20.04

install nvidia drivers on ubuntu 20.04

As Linux getting more user friendly, game developers are adding more support thanks to Steam. The performance of graphics processing units (GPUs) mainly depends on drivers. Ubuntu by default use open source video driver Nouveau which has limited support and features when compared with proprietary Nvidia drivers.

The proprietary Nvidia driver is essential to Ubuntu users looking to play games. However, if you are a basic user, there is no need to have this driver installed, as the open-source one works just fine.

In this tutorial, we are going to learn different ways to install Nvidia drivers on Ubuntu 20.04 LTS.

Check hardware Information of GPU

Before installing Nvidia drivers on Ubuntu, ensure that you have Nvidia GPU in your system. There are lots of commands available to get Linux hardware details.

To confirm this, simply run the following hwinfo command.

$ sudo hwinfo  --gfxcard --short

Install NVIDIA driver on Ubuntu 20.0420.04

You can check which card is being used by the prime-select command:

$ sudo prime-select query

prime-select query

The lshw command can display hardware and driver details of the currently used Nvidia card.

$ sudo lshw -c display | grep NVIDIA

Display NVIDIA driver only

The lspci command is another option to get the GPU hardware details.

$ sudo lspci -nnk | grep -iA3 vga
or
$ sudo lspci | grep -i --color 'vga\|3d\|2d'

If you have installed inxi tool, run the following command.

$ sudo inxi -Gx

Install Nvidia drivers using from GUI

Lets first check how to install Nvidia driver from the graphical user interface. On the main menu, type "software update manager" and click on it to open.

software and update manager

On the software updater pop-up, click on the 'Settings & Livepatch' button as shown.

software updater

This will launch the 'Software and Updates' window as shown below:

Install Nvidia driver on Ubuntu 20.04

At the top-most section of the  'Software and updates' windows, be sure to find a couple of options displayed which include Ubuntu software, other software, updates e.t.c. In this case,  click on Additional Drivers, you can see there, the 'Nvidia - driver -435' (proprietary, tested) is set up as default driver used for Nvidia card, along with some proprietary divers listed.

Both, 'Nvidia - drivers 430' (proprietary) and 'Nvidia - drivers 390' (proprietary) are available for GeForce GTX 1080 Ti card. Select the first option to install Nvidia driver 430.  When you are done, click on the Apply changes button to install the driver.

Then wait for the download to complete from the internet and click on the close button.

Reboot your computer for the changes to take effect. Run the following to reboot your PC.

$ sudo shutdown -r now

or

$ sudo reboot

Install Nvidia driver from the command line (CLI)

Then, run the following commands to check the list of driver devices available for the Nvidia card from the default Ubuntu repository.

$ sudo Ubuntu-drivers devices

sudo ubuntu-drivers devices

There are four Nvidia drivers available for the GeForce MX130 model. They include the Nvidia driver -440 non-free (which is recommended for Ubuntu system), Nvidia driver -435, and -390 distro non-free and the nouveau distro free builtin opensource video driver (default). Now you can run the following commands to install the specific driver you want.

$ sudo ubuntu-drivers autoinstall

Ubuntu drivers autoinstall

$ sudo apt install nvidia-driver-390

Install NVIDIA driver on Ubuntu 20.04

After the Nvidia diver has been installed, we have to reboot the computer in order to allow Nvidia prime (which is the technology) to switch in between the Intel Graphics and the Nvidia Graphics card.

$ sudo shutdown -r now

Verify using nvidia-smi

The nvidia-smi command line is a utility that is used for providing monitor and management capabilities for each and every devices i.e Nvidia Tesla, GRID, Quadro, and GeForce from Fermi and other higher architect families. Open the Terminal application and run the following command to see the Graphics Processing Unit and the process that is using the Nvidia GPU.

$ nvidia-smi

NVIDIA - smi

Configure the Nvidia Graphics driver

The Nvidia settings command starts a Graphics User Interface(GUI)  tool for configuration of Nvidia Graphics driver. This enables you to have a glance at all the GPU information and configure external monitors that are connected to your system.

Run the command below to launch the 'Nvidia and Server Settings' window.

$ sudo nvidia-settings

NVIDIA X server settings

How to uninstall the proprietary Nvidia driver

From open forums, I have noticed many users end up issues with removing Nvidia drivers and reinstalling. Let me share the steps I have followed to successfully uninstall the Nvidia driver and switch to the nouveau driver.

Step 1: Run the following command to confirm Nvidia drivers are installed in your system.

$ sudo dpkg -l | grep -i Nvidia

check if NVIDIA is installed

Step 2: Run the following commands to uninstall the proprietary Nvidia driver.

$ sudo dpkg -p $(dpkg -l | grep vidia-driver | awk '{print $2}')
$ sudo apt autoremove
or
$ sudo apt remove --purge '^nvidia-.*'

Remove Nvidia
Note that, the use of purge command will remove Nvidia diver together with all configurations that will be made. Run the flowing command to reinstall the Ubuntu desktop package.

$ sudo apt install ubuntu-desktop

Step 3: Run these commands to switch back to the nouveau driver.

$ sudo echo 'nouveau' | sudo tee -a /etc/modules
Add nouveau

Step 3: Remove the Xorg configuration file

Run the rm command to remove the Xorg configuration file

sudo rm /etc/X11/xorg.conf

Step 4: After that, reboot your system.

$ sudo shutdown -r now

Uninstall Nvidia Driver through GUI

Uninstalling the Nvidia driver using a GUI is quite easy. First, locate the 'software & Updates' app then click on it to open. Once it has opened, select on the Additional Drivers tab.

This will display all the Nvidia drivers that are available on Ubuntu. On the list under the 'Nvidia Corporation,' select " using X.Org X server - Nouveau display." This option will pass up the Nvidia graphics diver and it will install Nouveau display driver. For changes to take effect, click on the Apply changes button, and wait for some minutes.

install nouveau

Once Nvidia driver is uninstalled, a message will display saying, "No proprietary drivers are in use" Now close the Software & Updates application and then reboot your computer.

Conclusion

In this tutorial, we have covered two ways that you can use to install Nvidia drivers on Ubuntu 20.04 LTS.

With that said, Nvidia is bringing Vulkan which is intended to offer higher performance and more balanced CPU/GPU usage driver to Linux,  a replacement for OpenGL.

In recent years Redhat developers are adding extra code to Nouveau improve opensource code to make it much better, let's hope the near future we could use it for the modern game.

From Ubuntu 19.10, proprietary Nvidia drivers are available on install media (ie in ISO), which will bring a better fresh install experience for ubuntu users.

If you have any questions or feedback, feel free to leave a comment.

Nicole Ondara 1:35 am

Comments

Your email address will not be published. Required fields are marked *

All comments are subject to moderation.

1 Comment

  1. Nice tutorial. Do you know how I fix tearing on screen? My card is a hybrid too and I have this issue.