Install NVIDIA Drivers on CentOS 8 Stream

Most modern Linux Desktop systems have an NVIDIA driver pre-installed in the Nouveau open-source graphics device driver for NVIDIA video cards. For the most part, this is acceptable; however, if you are using your Linux system for graphical design or gaming, you may get better drivers.

Historically, the Nouveau drivers are slower than NVIDIA’s proprietary drivers, lacking the newest features, software technology, and support for the latest graphics card hardware, so installing the NVIDIA drivers directly can be desired from the user standpoint.

In the following tutorial, you will know how to install Nvidia drivers on your CentOS 8 Stream Workstation desktop.

Advertisement

Prerequisites

  • Recommended OS: Any current CentOS 8 Stream.
  • User account: root/sudo access
  • Internet Access
  • NVIDIA Graphics Card Hardware

The tutorial will utilize the terminal, which can be found in your show applications menu.

Example:

show terminal centos 8 stream | LinuxCapable

Updating Operating System

Update your CentOS Stream operating system to make sure all existing packages are up to date:

sudo dnf upgrade --refresh -y

The tutorial will be using the sudo command and assuming you have sudo status.

To verify sudo status on your account:

sudo whoami

Example output showing sudo status:

[joshua@centos-stream ~]$ sudo whoami
root

To set up an existing or new sudo account, visit our tutorial on adding a User to Sudoers on CentOS Stream.

To use the root account, use the following command with the root password to log in.

su

Import NVIDIA Repository

The following installation is designed for the default CentOS kernel; any modified Linux Kernel installations may not work.

The first step is to import the repository from EPEL (Extra Packages for Enterprise Linux) as follows:

sudo dnf install epel-release

Example output:

How to Install or Upgrade Nvidia Drivers on CentOS 8 Stream

Type Y, then press the ENTER KEY to proceed.

Next, add the Nvidia repository:

sudo dnf config-manager --add-repo https://developer.download.nvidia.com/compute/cuda/repos/rhel8/x86_64/cuda-rhel8.repo

Example output:

Adding repo from: https://developer.download.nvidia.com/compute/cuda/repos/rhel8/x86_64/cuda-rhel8.repo

The second step is to install the kernel-devel and headers that the Nvidia drivers will utilize:

sudo dnf install kernel-devel-$(uname -r) kernel-headers-$(uname -r)

Example output:

How to Install or Upgrade Nvidia Drivers on CentOS 8 Stream

Type Y, then press the ENTER KEY to proceed.

Advertisement

Install NVIDIA Drivers on CentOS 8 Stream

Now with the repository added, you can proceed to install the latest Nvidia stable driver as follows:

sudo dnf install nvidia-driver nvidia-settings

Example output:

How to Install or Upgrade Nvidia Drivers on CentOS 8 Stream

Type Y, then press the ENTER KEY to proceed.

During the installation, you will be prompted to import the GPG keys.

Optionally you can also install the CUDA drivers:

sudo dnf install cuda-driver

Example output:

How to Install or Upgrade Nvidia Drivers on CentOS 8 Stream

Type Y, then press the ENTER KEY to proceed.

Once installed, reboot your desktop:

sudo reboot

After the restart, verify the installation worked by running the following command:

nvidia-smi

Example output:

How to Install or Upgrade Nvidia Drivers on CentOS 8 Stream

As you can see, the information on the graphics card is now present. If you cannot see any information on your Nvidia card, it means the installation was not successful. You will need to repeat the steps or investigate why; typically, most issues occur with modified systems other than the default.

Advertisement

How to Update Nvidia Drivers CentOS 8 Stream

To check for updates and to apply, all you need to do is run the dnf update command as follows:

sudo dnf update

If an update is available for Nvidia drivers, use the following:

sudo dnf upgrade

Alternatively, use the new refresh method to recheck and upgrade all system packages instantly.

sudo dnf upgrade --refresh

How to Remove (Uninstall) Nvidia Drivers

To remove the Nvidia drivers with all dependencies and extras installed, run the following command:

sudo dnf remove nvidia-driver nvidia-settings cuda-driver kernel-devel-$(uname -r) kernel-headers-$(uname -r)

Example output:

How to Install or Upgrade Nvidia Drivers on CentOS 8 Stream

Type Y, then press the ENTER KEY to proceed.

Comments and Conclusion

In the tutorial, you have learned how to install Nvidia drivers on the AlmaLinux 8 desktop. Ideally, most hardcore gamers would probably not use AlmaLinux as their preferred gaming distribution; however, for systems that have Nvidia GPUs and work with graphics, this can be most excellent to install for better driver support.

Subscribe
Notify of
0 Comments
Inline Feedbacks
View all comments
adplus-dvertising
0
Would love your thoughts, please comment.x
()
x