Install latest NVIDIA drivers for Linux Mint 19/Ubuntu 18.04

If you have NVIDIA graphic card like GTX 1080 and you want to do something cool with the card you will need latest drivers. In order to install latest driver you have two ways: using Ubuntu default repository or download drivers from Ubuntu site. You can check both ways here:

Otherwise you will need to repeat previous steps by cleaning the drivers and install them again.

Command 'nvidia-smi' not found, but can be installed with:

sudo apt install nvidia-340
sudo apt install nvidia-utils-390

Broken drivers and GUI

Reasons

The drivers could be broken due to update of the Kernels. Recently update of the kernel broke my nvidia drivers. The update was for kernel: 4.15.0-46-generic

You can check your kernel version by:

uname -r

And check the driver by:

nvidia-smi

If you get an error message from nvidia-smi:

NVIDIA-SMI has failed because it couldn't communicate with the NVIDIA driver. Make sure that the latest NVIDIA driver is installed and running.

Then you need to reinstall the drivers. Or even completely uninstall them and install them as a fresh installation.

You can try to repair the old driver - but usually this is not working for me:

sudo apt-get -f install

or

sudo apt install aptitude
sudo aptitude install (package name)

or to reload the driver:

sudo apt install --reinstall nvidia-390

So the best option here is purge and reinstall.

Another possible indication for problematic drivers are:

Software Rendering Mode

nouveau driver is loaded instead of the nvidia

This indicates a problem with graphic drivers. And it's always a good idea to check the Linux Mint logs for problems related to your GPU or system:

Menu

Administration

Logs

What to do

If the drivers are mixed, incomplete or broken and the drivers UI is not working as expected and cause crash for the Linux Mint (Ubuntu), which enter in special rendered mode. Then you can follow the next steps:

Menu

Administration

Driver Manager

Check what driver you have installed

If you have mixed drivers they will look like:

Your system still may work fine and you to not have problems. But a change of the drivers will cause a disaster and you may need to apply the steps here: