This tutorial will help users that want to install drivers for their NVIDIA GPU on Ubuntu 18.04 LTS OS.
Step 1 – Clean the system of other Nvidia drivers
Before we start installing the correct driver, we need to clean the system of any previously installed driver that might create software issues.
We can do that by using the following command:
sudo apt-get purge nvidia*
Step 2 – Check the latest driver version for our Nvidia GPU
We need to check what version of the latest drivers is our graphic card capable of running.
We can check this by visiting the following page and see what is the correct driver version for our graphic card.
Afterwards, we will visit the graphic driver PPA homepage here and see if our graphic card is compatible with the drivers present in the repository.
Step 3 – Add the Nvidia graphic card PPA
We can add the graphic-driver PPA using the following command:
sudo add-apt-repository ppa:graphics-drivers
Step 4- Prepare the system for the installation
To retrieve information about the latest version of the packages listed in the repository we run:
sudo apt-get update
Before we proceed to the next step, we need to install screen to make sure that our installation is not interrupted by network fluctuations that might close our SSH session.
sudo apt-get install screen
We login into screen using the command:
screen
Step 5 – Install the Nvidia GPU driver
Using the previously aquired information from step 2, we download and install the latest Nvidia driver supported by our GPU. Please note that the command is different for each graphic card, depending on the driver available for it:
sudo apt-get install nvidia-XYXYX
( Ex. nvidia-390 is the latest driver version for the GTX 1xxx series).
After the installation is done, we need to reboot the computer:
sudo reboot
Step 6 – Verify Nvidia Driver installation
After the system has resumed, we can check if the driver has been installed correctly:
lsmod | grep nvidia
or
nvidia-smi
If there is no output, most likely your your driver install process has failed. It is also possible that the GPU driver is not available in your system driver database. You can check if your system is running on the open source driver nouveau. If there is no output for nouveau, then your installation has succeded.
lsmod | grep nouveau
Step 7 – Help Files
You can find more commands on how to use the driver by accessing the help files:
dpkg -L nvidia-driver-390
I hope this tutorial has helped you install the latest driver for your Nvidia graphic card on Ubuntu 18.04 LTS Bionic Beaver Linux.