Jun 30, 2023 6 min read

Install the NVIDIA Drivers on Ubuntu 22.04

Install the NVIDIA Drivers on Ubuntu 22.04 with our step-by-step tutorial. NVIDIA Drivers ensure smooth communication with graphics cards.

Install the NVIDIA Drivers on Ubuntu 22.04
Table of Contents

Choose a different version or distribution

Introduction

Before we begin talking about how to install the NVIDIA Drivers on Ubuntu 22.04, let's briefly understand – What are NVIDIA Drivers?

NVIDIA Drivers are software components that enable smooth communication between your computer's operating system and NVIDIA graphics cards. These drivers optimize performance, enhance graphics quality, and provide compatibility with various software applications.

By installing the latest NVIDIA Drivers, users can unlock the full potential of their NVIDIA GPUs, ensuring a seamless and immersive gaming, video editing, or graphics-intensive experience. Regular updates from NVIDIA ensure ongoing support and improvements, keeping your system up to date and capable of handling the latest technologies and games.

In this tutorial, you will install the NVIDIA Drivers on Ubuntu 22.04. We will also address a few FAQs on how to install Nvidia Drivers on Ubuntu 22.04.

Advantages of NVIDIA Drivers

  1. Enhanced Performance: NVIDIA Drivers optimize graphics card performance, delivering smooth gameplay and improved frame rates.
  2. Superior Graphics Quality: These drivers enhance visual fidelity, offering stunning graphics and lifelike details in games and multimedia applications.
  3. Software Compatibility: NVIDIA Drivers ensure seamless compatibility with a wide range of software, maximizing system stability and preventing compatibility issues.
  4. Regular Updates: NVIDIA releases frequent driver updates, providing ongoing support, bug fixes, and performance optimizations for the latest games and applications.
  5. Future-Proofing: By keeping your NVIDIA Drivers up to date, you ensure your system is ready to handle future technologies and advancements in graphics, enabling you to stay ahead in the gaming and creative industries.

Software Requirements and Conventions Used

Category Requirements, Conventions or Software Version Used
System updated to Ubuntu 22.04 Jammy Jellyfish or installed it
Software N/A
Other privileged access with the sudo command or as root to your Linux machine.
Conventions # – requires the use of the sudo command or running the supplied linux commands as the root user with root capabilities. $ – required that the specified linux commands be run as an ordinary, non-privileged user.

Install Nvidia Drivers Using Default Ubuntu Repository

The first technique is the simplest to use and is generally the suggested course of action.

GNOME GUI Nvidia Installation Method

Activate the Software & Updates program window. Choose any exclusive NVIDIA driver by selecting TAB Additional Drivers. The most recent version is indicated by a higher driver number.

Command Line Nvidia Installation Method

Step 1: Find the recommended driver for your NVIDIA graphic card first, then identify its model. Use the following command to achieve that. Please be aware that your output and the suggested driver will probably differ:

ubuntu-drivers devices
== /sys/devices/pci0000:00/0000:00:01.0/0000:01:00.0 ==
modalias : pci:v000010DEd00002206sv00001458sd0000403Fbc03sc00i00
vendor : NVIDIA Corporation
model : GA102 [GeForce RTX 3080]
driver : nvidia-driver-470 - distro non-free recommended
driver : nvidia-driver-470-server - distro non-free
driver : nvidia-driver-495 - distro non-free
driver : nvidia-driver-460-server - distro non-free
driver : xserver-xorg-video-nouveau - distro free builtin
💡
If the ubuntu-drivers package is not installed in your system using the command sudo apt install ubuntu-drivers-common to install it.

We may infer from the output above that the NVIDIA GeForce RTX 3080 graphics card is already installed on the system, and that the recommended driver to install is nvidia-driver-470.

Step 2: Set up the driver. Use the ubuntu-drivers command once more to install all recommended drivers if you agree with the recommendation:

sudo ubuntu-drivers autoinstall

You can also use the apt command to selectively install the necessary driver. For instance:

sudo apt install nvidia-driver-470

Step 3: Reboot your computer after the installation is finished, and you're done.

sudo reboot

Nvidia Beta drivers are Automatically Installed Via the PPA repository

Step 1: Using graphics-drivers PPA repositories let us install the most recent beta Nvidia drivers at the cost of a system that is unstable. Add the ppa:graphics-drivers/ppa repository to your system first before continuing.

sudo add-apt-repository ppa:graphics-drivers/ppa

Step 2: Next, determine the proper driver for your graphic card:

ubuntu-drivers devices
== /sys/devices/pci0000:00/0000:00:01.0/0000:01:00.0 ==
modalias : pci:v000010DEd00002206sv00001458sd0000403Fbc03sc00i00
vendor : NVIDIA Corporation
model : GA102 [GeForce RTX 3080]
driver : nvidia-driver-470 - third-party non-free recommended
driver : nvidia-driver-460-server - distro non-free
driver : nvidia-driver-470-server - distro non-free
driver : nvidia-driver-495 - distro non-free
driver : xserver-xorg-video-nouveau - distro free builtin

Step 3: Install the Nvidia DriveSame with the standard Ubuntu repository example above, either install all recommended drivers automatically:

sudo ubuntu-drivers autoinstall

or by running the apt command selectively. For example:

sudo apt install nvidia-driver-470

Step 4: That's it. Restart your device:

sudo reboot

Manual Installation Using the Official Nvidia.com Driver

Step 1: locate the NVIDIA VGA card. You may determine the model of your Nvidia card by using the commands listed below:

lshw -numeric -C display
or
$ lspci -vnn | grep VGA
or
$ ubuntu-drivers devices

Step 2: Get the Nvidia Official Driver. Go to the official Nvidia website using your web browser, then download the correct driver for your Nvidia graphics card. A direct download of the driver from the Nvidia Linux driver list is also an option if you are experienced. After completed, you should have a file similar to the one shown below:

ls
NVIDIA-Linux-x86_64-470.94.run

Step 3: Set up the prerequisites The ability to compile and install the Nvidia driver requires the following prerequisites:

sudo apt install build-essential libglvnd-dev pkg-config

Step 1: Deactivate the Nouveau Nvidia driver. The next action is to turn off the built-in nouveau Nvidia driver. To disable the default Nouveau Nvidia driver, refer to this guide.

⚠️
Your system can act improperly depending on the Nvidia VGA model you have. Be prepared to get your hands dirty at this point. You can find yourself with no GUI at all after the reboot. To be able to log in remotely, make sure SSH is enabled on your machine. Instead, use CTRL+ALT+F2 to switch to the TTY console and finish the installation.

Before moving on to the following step, make sure your computer has been rebooted.

Step 2: Deactivate Desktop Manager. We must turn off the present display in order to install the latest Nvidia driver. Using the telinit command to switch to runlevel 3 is the simplest way to accomplish this. The display server will shut down once you run the following linux command, so save all of your current work (if any) before continuing:

sudo telinit 3

Open a new TTY1 session by pressing CTRL+ALT+F1, then enter your username and password to connect in over SSH or TTY1.

Step3: Activate the Nvidia driver. Use the following linux command to launch the Nvidia driver installation, then follow the wizard's instructions:

sudo bash NVIDIA-Linux-x86_64-470.94.run

Step4: Currently, the Nvidia driver is installed. Restart your computer:

sudo reboot

Step 5: NVIDIA X Server Settings configuration. You should be able to launch the NVIDIA X Server Settings app from the Activities menu after the reboot.

How to Uninstall Nvidia Driver

To go back to the Nouveau opensource driver, use our instructions on how to uninstall the Nvidia driver.

FAQs to Install the NVIDIA Drivers on Ubuntu 22.04

Are there any prerequisites for installing NVIDIA Drivers on Ubuntu 22.04?

Yes, it is recommended to disable the open-source Nouveau driver before installing NVIDIA drivers. You can do this by modifying the boot configuration file and adding the nomodeset parameter.

What should I do if I encounter issues after installing NVIDIA Drivers on Ubuntu 22.04?

If you face issues, such as a black screen or graphical glitches, you can try switching to a different NVIDIA driver version or reinstalling the drivers using the command sudo apt purge nvidia-driver-XXX followed by a fresh installation.

How can I update the installed NVIDIA Drivers on Ubuntu 22.04?

To update the NVIDIA drivers on Ubuntu 22.04, you can open the Software & Updates application, go to the Additional Drivers tab, and choose a newer version if available.

Can I install beta or experimental NVIDIA Drivers on Ubuntu 22.04?

Yes, you can install beta or experimental NVIDIA drivers on Ubuntu 22.04 by enabling the corresponding repository and then installing the drivers using the package manager or command line.

How can I remove NVIDIA Drivers from Ubuntu 22.04?

You can remove NVIDIA drivers from Ubuntu 22.04 by opening a terminal and running the command sudo apt remove nvidia-driver-XXX (replace XXX with the installed driver version).

Is a system reboot required after installing NVIDIA Drivers on Ubuntu 22.04?

Yes, it is recommended to reboot your system after installing NVIDIA drivers to ensure the changes take effect and the driver is properly loaded.

Conclusion

In this tutorial, we have discussed a step-by-step process to install NVIDIA Drivers on Ubuntu 22.04.

If you have any suggestions or queries, kindly leave them in the comments section.

Great! You’ve successfully signed up.
Welcome back! You've successfully signed in.
You've successfully subscribed to DevOps Tutorials - VegaStack.
Your link has expired.
Success! Check your email for magic link to sign-in.
Success! Your billing info has been updated.
Your billing was not updated.