Gaming on Linux? This is Learn how to Set up Nvidia Drivers on Ubuntu

If you want to run AAA games on Linux, you need to make sure you are using the latest graphics drivers. But does Nvidia produce a driver for Linux?

Fortunately yes. But how do you install the latest drivers on Ubuntu? Whether you want to use the desktop environment or the command line, installing and updating the Nvidia graphics driver on Ubuntu is straightforward.

Check if you are using an Nvidia GPU

You can install graphics card drivers in the terminal or through the desktop environment (or the graphical user interface for the graphical user interface). However, the best way to check the specifics of your current graphics card is to use the terminal.

Open the terminal from the menu or use Ctrl + Alt + T..

sudo apt install hwinfo

After the installation, use hwinfo to check your graphics card with the –gfxcard Possibility.

sudo hwinfo –gfxcard –short

Once you've identified an Nvidia GPU, use the lshw (List Hardware) command to view more details of the card.

sudo lshw -c display | grep NVIDIA

Alternatively, you can use lspci (list PCI) and grep for more detailed information

sudo lspci | grep -i –color & # 39; vga | 3d | 2d & # 39;

For all the relevant details on using your Ubuntu system's Nvidia card

sudo inxi -Gx

With this information, you have everything you need to know about installing the correct Nvidia driver in Ubuntu.

Related: AMD vs. NVIDIA GPUs on Linux: Which Should You Use?

Update your system

Before you proceed, however, you should upgrade your Ubuntu system. The steps in this guide are for Ubuntu 20.04 LTS (Focal Fossa). At the time of writing, this is the current version of the LTS. So make sure you are using this version or higher.

Note that with Ubuntu 19.10 and later, Nvidia's proprietary drivers are included in the installation media. Therefore, the Nvidia drivers may already be installed. Otherwise, update to the latest Ubuntu version.

Update and update Ubuntu with

sudo apt update && sudo apt upgrade -y

Alternatively, you can open the Software Update Manager and wait for it to check for updates. Install any highlighted system updates.

Related: How to Update Ubuntu from the Command Line

Install Nvidia drivers on Ubuntu on the desktop GUI

The Ubuntu Software Updater can help you find and install the correct driver for your Nvidia graphics card.

  1. Open the Ubuntu app menu and scroll to Software updater

  2. Alternatively, open the menu and enter "Software Updater" to search for the tool

  3. Select the Software Updater to open it and wait for it to check for updates

  4. Once you're done (you should have updated before starting) click on Settings & Livepatch

  5. Press the Additional drivers tab

  6. Select an Nvidia driver metapackage to append to (proprietary, tested)

  7. click Apply changes and wait while the new driver is installed

The X.Org X server is usually the default option. It's open source too, so you may prefer this from a philosophical point of view. However, if you want the best gaming performance, the Nvidia driver is required.

You should pay attention to a list of drivers like the one pictured above. You can use any of these versions, but it is safer to start with a tested version. After restarting Ubuntu, the Nvidia driver will be used.

How to install Nvidia drivers on Ubuntu in Terminal

To install an Nvidia graphics driver on Ubuntu from the command line, open Terminal and enter

sudo ubuntu driver devices

This will list all of the drivers currently available for your graphics card. You will find that the pre-installed option is listed as "distro free builtin".

Use to select the driver listed as "Recommended"

Sudo Ubuntu drivers will be installed automatically

You can also install a specific, named driver

sudo apt install nvidia-driver- (version_number)

For example, use to install nvidia-driver-450

sudo apt install nvidia-driver-450

Confirm the command and follow the instructions in the terminal. When you're done, restart Ubuntu.

restart sudo

In some cases, you may need to make sure that the Nvidia graphics card is active. This might be preferable to leaving the operating system to decide to use Intel graphics. Use to check which graphics card is selected

Prime Select query

Use to select the Intel card

sudo prime-select intel

Force the Nvidia card with

sudo prime-select nvidia

You may need to reboot for the alternate graphics card selection to take effect. Note that with laptops, the Nvidia card places higher demands on the battery of your device than the Intel option.

Configure and manage the Nvidia drivers on Ubuntu

Enter to quickly find out which GPU is active, which driver is installed, and which resources are in use

nvidia-smi

This should give you all the information you need and is a useful reference for configuring graphics in the game. For more detailed management, open the settings screen with

sudo nvidia settings

This screen offers far more data than the nvidia-smi tool. Here you will find the X server and OpenGL settings. that will be of particular interest Thermal settings GPU temperature review screen.

You can also choose advanced performance modes in the PowerMizer Screen, create and manage Application profilesand switch PRIME profiles.

This last option is similar to the Prime Select command, but offers three options:

  • NVIDIA (performance mode)

  • NVIDIA on-demand

  • Intel (energy saving mode)

For the best graphics performance, of course, choose the performance mode.

How to update Nvidia graphics card drivers in Ubuntu

Updating your Nvidia graphics card driver should be done whenever an update is available. Nvidia drivers have been included in the LTS repository since Ubuntu 19.10.

So updating the drivers is as easy as updating other software in Ubuntu. Either run, update and update the Terminal, or use the Software Updater on the desktop.

Uninstalling Nvidia drivers in Ubuntu

You may prefer to remove the Nvidia drivers. This can happen if the driver does not meet your expectations. Alternatively, you may have decided to ditch Nvidia and go for an AMD card.

Uninstall the Nvidia GPU drivers from the desktop

Open the Software Updater again. From here:

  1. Wait for the update check to complete

  2. click Settings & Livepatch

  3. click Additional drivers

  4. Select the Nouveau Display Driver option

  5. click Apply changes

A short wait is required; Once the change is made, you should see a message informing you that "No proprietary drivers are in use".

Uninstall Nvidia drivers in the terminal

To uninstall the Nvidia graphics driver in the terminal:

sudo apt purge nvidia- *
sudo apt autoremove

Reboot your system before proceeding. By default, the system switches to the Nouveau open source driver.

Playing Linux: Use the best drivers for your distribution

With the Nvidia drivers installed on your Ubuntu system, you should be able to improve the graphics performance of your GPU. This is a huge benefit for Linux gaming, but Ubuntu may not be the best distribution for gaming. If you want to get the most out of gaming on Linux, you should use the best Linux game distro.

5 best Linux operating systems for gaming

Linux isn't ideal for gaming, but it is absolutely possible! Here are five Linux distributions made specifically for gaming.

Continue reading

About the author

Christian Cawley
(1458 articles published)

Deputy Editor for Security, Linux, DIY, Programming and Technology explains. He also produces The Really Useful Podcast and has extensive desktop and software support experience.

Christian writes articles for Linux Format magazine and is a Raspberry Pi hobbyist, Lego lover and retro gaming fan.

More
By Christian Cawley

Subscribe to our newsletter

Subscribe to our newsletter for tech tips, reviews, free e-books, and exclusive deals!

One more step …!

Please confirm your email address in the email we just sent you.

Leave a Reply

Your email address will not be published. Required fields are marked *