Introduction: Nvidia graphics processing units (GPUs) used for gaming and professional use in offices. Nvidia GPUs used in data centers, visualization, automobile industry, and artificial intelligence. By default X.org X server use nouveau free/libre software drivers for nVidia cards. The nouveau driver generally provides the inferior performance to Nvidia’s proprietary graphics device drivers for gaming and other professional use. This page shows how to install Nvidia GPU drivers on an Ubuntu Linux desktop.
Ubuntu Linux Install Nvidia Driver
The procedure to install proprietary Nvidia GPU Drivers on Ubuntu 16.04 / 17.10 / 18.04 / 18.10 / 20.04 LTS is as follows:
- Update your system running apt-get command
- You can install Nvidia drivers either using GUI or CLI method
- Open “Software and Updates” app to install install Nvidia driver using GUI
- OR type “sudo apt install nvidia-driver-455” at the CLI
- Reboot the computer/laptop to load the drivers
- Verify drivers are working
Let us see all commands in details.
Find out information about your GPU
Naturally, you can only install Nvidia driver if you have Nvidia GPU in your system. Type the hwinfo command/lshw command to find out info about your GPU:
$ hwinfo --gfxcard --short
OR
$ sudo lshw -C display
See “Linux Find Out Graphics Card Installed In My System” for more info.
Install Nvidia driver using GUI method # 1 on Ubuntu Linux
Press the Super key (Windows key) and type the following in search box:
update manager
Click on the Settings button:
Click on the Additional drivers tab:
Choose nvidia-driver-460 (proprietary, tested) and click on the Apply Changes button. You must authenticate yourself to install Nvidia driver on Ubuntu Linux. You must wait for some time as Nvidia driver downloaded and installed from the internet:
Click on the Close button when done. You must reboot Ubuntu Linux computer to use the driver by typing the following shutdown command:
$ sudo shutdown -r now
OR
$ sudo reboot
Now skip to the driver verification step.
Ubuntu Install Nvidia driver using the CLI method # 2
Open the termial application and search for nvidia drivers using the apt command or apt-get command:
$ apt search nvidia-driver
OR use the apt-cache command to search package:
$ apt-cache search nvidia-driver
Updating and installing all security and important updates on Ubuntu
Do not skip the following two commands as you must apply all pending security updates:
$ sudo apt update
$ sudo apt upgrade
Installing NVIDIA drivers on Ubuntu
Let us install the nvidia-driver-390 package:
$ sudo apt install nvidia-driver-390
At this time, the latest tested proprietary drive version is 460. We can install that one as follows on Ubuntu Linux 20.04 LTS:
$ sudo apt install nvidia-driver-460
Reboot the Linux with help of either reboot or shutdown command:
$ sudo reboot
Now go to the driver verification step.
Verification
Open the terminal application and type nvidia-smi to see GPU info and process that are using Nvidia GPU:
$ nvidia-smi
The nvidia-smi command line utility provides monitoring and management capabilities for each of NVIDIA’s Tesla, Quadro, GRID and GeForce devices from Fermi and higher architecture families. You can see running apps on your GPU and GPU temperature.
How do I configure the NVIDIA graphics driver?
The nvidia-settings command start a GUI tool for configuring the NVIDIA graphics driver. This is useful to see all GPU info or configure multiple external screen/monitors connected to your system. Open the terminal and type the following commands:
$ nvidia-settings
If you wish to save settings start it as follows:
$ sudo nvidia-settings
Related: Top 7 Linux GPU Monitoring and Diagnostic Commands Line Tools
A note about ubuntu-drivers command-line method # 3
We can also change drivers without the use of the X GUI/Windows desktop. For these purposes, Ubuntu comes with a unique command called ubuntu-drivers to manage binary drivers for NVidia and other devices. This is an alternative to the apt command/apt-get command we used earlier.
Show all driver packages which apply to the current system
$ sudo ubuntu-drivers list
Outputs from my Thinkpad X1E laptop:
Display all OEM enablement packages which apply to this system
$ sudo ubuntu-drivers list-oem
View all hardware NVidia devices which need drivers, and which packages
$ sudo ubuntu-drivers devices
Here is what we see:
== /sys/devices/pci0000:00/0000:00:01.0/0000:01:00.0 == modalias : pci:v000010DEd00001F91sv000017AAsd0000229Fbc03sc00i00 vendor : NVIDIA Corporation model : TU117M [GeForce GTX 1650 Mobile / Max-Q] driver : nvidia-driver-440-server - distro non-free driver : nvidia-driver-455 - distro non-free recommended driver : nvidia-driver-418-server - distro non-free driver : nvidia-driver-450 - distro non-free driver : nvidia-driver-450-server - distro non-free driver : xserver-xorg-video-nouveau - distro free builtin
Ubuntu command to install a driver NVidia version 455
Warning: You can use only one method. If you use an earlier GUI or apt CLI method, do not try the following command. I have observed broken systems if you mixed various methods on the same system. Stick with one method.
Let us install recommended driver automatically:
sudo ubuntu-drivers install
Conclusion
You learned three different ways to install Nvidia Driver on Ubuntu 18.04 and 20.04 LTS Linux desktop or server. Unmistakably, the GUI method is simple and easy to use. The CLI method is useful for server installation, and the ubuntu-drivers command-line method is recommended for a fresh installation or OEM system like Dell XPS 13 and others. The For more info, see the official Nvidia Unix/Linux driver page online.
- Ubuntu Linux Install Nvidia Driver (Latest Proprietary Driver)
- How to install Nvidia driver on CentOS 7 Linux
🐧 Get the latest tutorials on Linux, Open Source & DevOps via:
- RSS feed or Weekly email newsletter
- Share on Twitter • Facebook • 11 comments... add one ↓
Category | List of Unix and Linux commands |
---|---|
File Management | cat |
Firewall | Alpine Awall • CentOS 8 • OpenSUSE • RHEL 8 • Ubuntu 16.04 • Ubuntu 18.04 • Ubuntu 20.04 |
Network Utilities | dig • host • ip • nmap |
OpenVPN | CentOS 7 • CentOS 8 • Debian 10 • Debian 8/9 • Ubuntu 18.04 • Ubuntu 20.04 |
Package Manager | apk • apt |
Processes Management | bg • chroot • cron • disown • fg • jobs • killall • kill • pidof • pstree • pwdx • time |
Searching | grep • whereis • which |
User Information | groups • id • lastcomm • last • lid/libuser-lid • logname • members • users • whoami • who • w |
WireGuard VPN | Alpine • CentOS 8 • Debian 10 • Firewall • Ubuntu 20.04 |
when you inevitably run into an error at reboot following the cli explanation at the top of this guide do the following:
use the magic trouble shooter
ctrl + F1 through F7
then:
sudo apt-get purge nvidia*
when you’ve logged in:
sudo ubuntu-drivers autoinstall
autoinstall will inspect your hardware for the recommended drivers, install and set up user and group permissions.
NONE OF THIS WORKS. The options on the “Additional Drivers” tab are all greyed. None of the command line options will get past a message saying:
“Media change: please insert the disc labeled
“‘Ubuntu 20.10 _Groovy Gorilla_ – Release amd64 (20201022)’
“in the drive ‘/cdrom/’ and press [Enter]”
The machine does not have a disc drive and there is no such disk. I installed from a USB stick. How the hell do I get my second screen back? When I first installed Kubuntu a few months ago it just found the screen without effort.
You need to remove CDROM as package source. Open GUI app app “Software & Update”. Make sure you enable “Downloadable from the Internet”. Do not put CDROM. Then go to “Other Software” and disable all “CDrom with” options. Then save everything and you can now install them from the Internet. See:
Choose nvidia-driver-390 (proprietary, tested) and click on the Apple Changes button
I think there is no APPLE button…..
Fixed it.
Just install nvidia drivers for my linux using apt command. worked perfectly on HP laptop.
I can’t believe it was that simple
Me too. It was very easy. I always click nixCraft tutorial. I am visiting this site since last 10 years or more.
I have an error after installing drivers with the second method (CLI).
My NVIDIA graphic card is a GeForce GT 630, and I have installed the following driver: nvidia-driver-460
When I try to do the verification step, I receive the following error;
egonzalez@pc-despacho:~$ 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.
i do not know how to solve this :(
Reboot the system to load and get updated NVIDIA driver.
Bull. You saved my ass. Worked a treat.
This post is really awesome. You save my time. I have trouble installing the 3090 driver. However, I solved my problem by following your post. Thank you so much!!