This article covers the complete procedure of installing Nvidia Drivers on your Ubuntu 20.04 LTS Focal Fossa system. In fact, Nvidia GPUs (graphics processing units) have exceptional parallel computing potential, much higher than that of CPUs.
How to Install Nvidia Driver via Command Line on Ubuntu?
1. Search for Nvidia Drivers
Begin by Opening the terminal by pressing Ctrl+Alt+T or search for "terminal" in the Applications menu. Then, Run the following command:
$ apt search nvidia-driver
The output will display a list of available drivers for your GPU.
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
3. Install the Right Driver for Your GPU
First, Choose a driver to install from the list of available GPU drivers. The best fit is the latest tested proprietary version. The syntax for installing the driver is:
$ sudo apt install [driver_name]
Here, we installed nvidia-driver-340, the latest tested proprietary driver for this GPU, so the command to run would be:
$ sudo apt install nvidia-driver-340
4. Reboot the System
Reboot your machine with the following command:
$ sudo reboot