Two ways to install NVIDIA GPU driver [Ubuntu 18.04]

2019/7/12

Starting with Ubuntu 18.04, you can install the Nvidia GPU driver in two ways:

  • Install by GUI operation from the setting screen
  • Install by command line operation

Either way, it's easy to do.

Through the GUI, you can select a "recommended driver" that has been verified to work stably.On the command line, you can select verified drivers as well as the latest drivers if you specify them.The same recommended driver is installed for both.

Environment I tried
-Ubuntu 18.04 LTS
・ Nvidia Geforce GTX 1080

How to insert Nvidia driver by GUI operation

Open the application menu and
Select [Software and Updates] → [Additional Drivers].

Install NVIDIA GPU driver from Ubuntu software and updates

By default, the default installed xserver-xorg-video-nouveau – is used as an alternative driver.

The recommended Nvidia driver for the user's GPU is automatically selected, soSimply select "Use NVIDIA driver meta package from nividia-driver-xxx" and apply your changes to complete the setupis.After the installation is complete, it will restart without permission.

You can check whether it was installed normally from [Settings] → [Details].

How to install from the command line of the terminal

(XNUMX) Check your GPU and driver

$ ubuntu-drivers devices

== / sys / devices / pci0000 00: 0000/00: 01.0: 0000 / 01: 00.0: XNUMX ==
modalias: pci: v000010DEd00001B80sv00003842sd00006288bc03sc00i00
vendor: NVIDIA Corporation
model: GP104 [GeForce GTX 1080]
driver: nvidia-driver-390 - distro non-free recommended
driver: xserver-xorg-video-nouveau - distro free builtin

"Nvidia-driver-390 –" is recommended.

I think that distro non-free is not "not free" but "not free", that is, it is a driver of nvidia's unpublished code, so linux developers can not freely tamper with it.

(XNUMX) Install with the following command

$ sudo ubuntu-drivers autoinstall

That's how to install the NVIDIA GPU driver on Ubuntu 18.04.

reference:2 Ways to Install Nvidia Drivers on Ubuntu 18.04