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:

Note: I prefer to not use third party repositories. For Ubuntu 18.04 and Linux Mint 19 nvidia drivers 390 from the official repository works fine even for libraries like tensorflow and CUDA toolkit.

Install using standard Ubuntu Repository

This is easiest method and recommended for new users.

Linux Mint 19

  • Menu
  • Administration
  • Driver manager
  • NVIDIA Corporation
    • select nvidia-driver-390 (recommended) - and unselect xerver-xorg-vidieo-nouveau
  • Apply and restart

NVIDIA latest driver ubuntu

Linux Ubuntu 18.04

For Ubuntu and terminal lovers you can do:

ubuntu-drivers devices

the output should be:

== /sys/devices/pci0000:00/0000:00:03.1/0000:20:00.0 ==
modalias : pci:v000010DEd00001B80sv00001458sd00003702bc03sc00i00
vendor   : NVIDIA Corporation
model    : GP104 [GeForce GTX 1080]
driver   : nvidia-396 - third-party non-free
driver   : nvidia-driver-390 - distro non-free recommended
driver   : xserver-xorg-video-nouveau - distro free builtin

Now you can install drivers by:

sudo ubuntu-drivers autoinstall

Or you can install specific version by:

sudo apt install nvidia-390

Manual installation

Check what drivers are installed

dpkg --get-selections | grep nvidia

The output should be something like:

$ dpkg --get-selections | grep nvidia
libnvidia-cfg1-390:amd64			install
libnvidia-common-390				install
libnvidia-compute-390:amd64			install
libnvidia-compute-390:i386			install
libnvidia-decode-390:amd64			install
libnvidia-decode-390:i386			install
libnvidia-encode-390:amd64			install
...
nvidia-kernel-common-390			install
nvidia-kernel-source-390			install
nvidia-prime					install
nvidia-settings					install
nvidia-utils-390				install
xserver-xorg-video-nvidia-390			install

If you have mixed drivers like 3.90 and 3.96 this could cause a problem. It's better to remove older drivers in order to avoid conflicts. The nvidia drivers can be uninstalled by:

sudo apt-get purge nvidia*

Download latest driver or a version that you like:

Visit: NVIDIA Driver Downloads and select:

  • Product Type: GeForce
  • Product Series: GeForce 10 Series
  • Product GeForce GTX 1080
  • Operating System: Linux 64-bit
  • Language: English

Once donwloaded you can Install the driver by:

sudo sh NVIDIA-Linux-x86_64-390.48.run

you may need to run it without user interface only from terminal

The ouput will be something like:

LINUX X64 (AMD64/EM64T) DISPLAY DRIVER
 
Version:	390.77
Release Date:	2018.7.16
Operating System:	Linux 64-bit
Language:	English (US)
File Size:	78.89 MB

You can check also for all supported cards on SUPPORTED PRODUCTS tab:

NVIDIA TITAN Series:
NVIDIA TITAN V, NVIDIA TITAN Xp, NVIDIA TITAN X (Pascal), GeForce GTX TITAN X, GeForce GTX TITAN, GeForce GTX TITAN Black, GeForce GTX TITAN Z

GeForce MX100 Series (Notebook):
GeForce MX150, GeForce MX130, GeForce MX110

GeForce 10 Series:
GeForce GTX 1080 Ti, GeForce GTX 1080, GeForce GTX 1070 Ti, GeForce GTX 1070, GeForce GTX 1060, GeForce GTX 1050 Ti, GeForce GTX 1050, GeForce GT 1030

Verify if driver is installed

After the installation of nvidia driver you can reboot and check output of this command:

nvidia-smi 

Everything is OK if the output is something like:

Mon Aug 20 15:18:58 2018       
+-----------------------------------------------------------------------------+
| NVIDIA-SMI 390.48                 Driver Version: 390.48                    |
|-------------------------------+----------------------+----------------------+
| GPU  Name        Persistence-M| Bus-Id        Disp.A | Volatile Uncorr. ECC |
| Fan  Temp  Perf  Pwr:Usage/Cap|         Memory-Usage | GPU-Util  Compute M. |
|===============================+======================+======================|
|   0  GeForce GTX 1080    Off  | 00000000:20:00.0  On |                  N/A |
|  0%   46C    P8    15W / 200W |    528MiB /  8116MiB |      2%      Default |
+-------------------------------+----------------------+----------------------+
                                                                               
+-----------------------------------------------------------------------------+
| Processes:                                                       GPU Memory |
|  GPU       PID   Type   Process name                             Usage      |
|=============================================================================|
|    0      1291      G   /usr/lib/xorg/Xorg                           255MiB |
|    0      1826      G   cinnamon                                      93MiB |
|    0      2045      G   ...-token=0131A404F88EDFB69CFBE87FE27CF2B5     8MiB |
|    0      2776      G   ...-token=4213622D51C92E34E15CBCBCB028F7CA    60MiB |
|    0     25949      G   ...-token=81FD9A54DC3DB7C8FBAA2380BC4090AB    68MiB |
|    0     26937      G   ...-token=730AF28A86DCED16D77B4CD5AF0378A4    39MiB |
+-----------------------------------------------------------------------------+

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

Update and hold of drivers

Sometimes ou may want to prevent updating of the drivers this can be done by command:

sudo apt-mark hold nvidia-390

to unhold and revert previous command you can do:

sudo apt-mark unhold nvidia-390

Related Article