Skip to main content

Welcome to a Grasp lesson

Create a free account to keep studying and create your own study path.

Lesson 3

NVIDIA Driver Installation & Verification

Recommended resources

Welcome back. In our last session, we prepared your Rocky Linux system by performing essential updates and confirming your user account has the necessary sudo privileges. With that groundwork laid, we can now focus on configuring the hardware that will be the powerhouse for your gesture recognition system: the NVIDIA GTX 1650 Super.

Today's lesson is dedicated to installing the proprietary NVIDIA drivers. This is a critical step because the default open-source drivers (nouveau) that come with Rocky Linux do not provide the level of performance or feature support (like CUDA) needed for real-time video processing and machine learning tasks. Successfully installing these drivers will unlock the full potential of your GPU, which is essential for the MediaPipe-based gesture detection we'll implement later.

This process involves several precise command-line steps, from adding the correct software repositories to ensuring the system loads the new driver correctly. Let's get started.

1. System Preparation and Driver Selection

Before we install anything, we need to make a few checks and decisions. The process is similar to setting up a new development environment, where you first configure your sources and dependencies. Your GTX 1650 Super is based on NVIDIA's "Turing" architecture. For this architecture, you have a choice between proprietary drivers and open-source kernel modules. For maximum compatibility and performance, especially for a project involving CUDA and video processing, the proprietary drivers are the recommended choice.

The following guide from LinuxCapable provides an excellent, detailed walkthrough of the entire process. We will be using it as our primary reference.

How to Install NVIDIA Drivers on Rocky Linux (10, 9, 8) - LinuxCapable

This guide covers the entire installation process, from preparation to verification. We'll start with the initial preparatory steps.

First, read the section Choose Your Driver Option to understand the difference between the proprietary and open kernel modules. Next, in the section "Prepare Your System for NVIDIA Driver Installation," read the subsection Identify Your Graphics Card. Although you know you have a GTX 1650 Super, run the lspci -nn | grep -E "VGA|3D" command to see how the system identifies it. This is a good diagnostic habit. Finally, read the subsection Check Secure Boot Status. Run the mokutil --sb-state command. If Secure Boot is enabled, you may need to enroll a key after installation. For now, just take note of the status.


2. Configuring Software Repositories

Rocky Linux, like other enterprise distributions, uses a system of repositories to manage software. To get the NVIDIA drivers, we need to add two crucial sources: EPEL and NVIDIA's own CUDA repository.

  • EPEL (Extra Packages for Enterprise Linux): This repository provides important packages that are not included in the default Rocky Linux repositories, such as dkms.
  • NVIDIA CUDA Repository: This is the official source for the drivers and related tools.

The LinuxCapable guide provides the precise commands for this.

How to Install NVIDIA Drivers on Rocky Linux (10, 9, 8) - LinuxCapable

Now we'll add the necessary software repositories to your system.

Follow the instructions under the heading Install EPEL. Since you are on a recent version of Rocky Linux, use the commands for Rocky Linux 9. Next, add the official NVIDIA repository by following the instructions under the heading Add the NVIDIA CUDA Repository, again using the command for Rocky Linux 9.


3. Disabling Nouveau and Installing the Driver

With our repositories configured, there are three final steps: install build dependencies, disable the conflicting nouveau driver, and finally, install the NVIDIA driver itself.

The dkms package we are about to install is particularly important. It stands for Dynamic Kernel Module Support. Its function is to automatically recompile the NVIDIA kernel module whenever you update your system's Linux kernel. This prevents a common issue where a kernel update breaks your graphics drivers, which is a mechanism you'll appreciate for maintaining a stable system, similar to how a package manager handles dependency resolution in your app development projects.

It is crucial to disable the default nouveau driver before rebooting with the new driver. If both are active, they will conflict, and your graphical environment may fail to load.

How to Install NVIDIA Drivers on Rocky Linux (10, 9, 8) - LinuxCapable

This is the core installation phase. We'll proceed in a specific order: install dependencies, disable the old driver, then install the new one.

First, read and execute the commands in the section Install Build Dependencies. This will install dkms, kernel-devel, and other necessary tools. If the command fails, the guide mentions enabling the crb repository, which you should do. Next, skip ahead to the "Troubleshoot" section and follow the instructions under Nouveau Driver Conflicts. This will proactively prevent issues by blacklisting the nouveau driver. You will need to reboot after this step as instructed in the guide. After rebooting, return to the main installation flow. In the section Install NVIDIA Drivers, follow the instructions for Rocky Linux 9 and 8: Module Installation. Execute the command to install the latest-dkms module. This is the one that installs the proprietary driver with DKMS support.


4. Reboot and Verification

Once the installation command finishes, the final step is to reboot your machine to load the newly installed kernel module.

sudo reboot

After your system boots back up and you log in, open a terminal. The moment of truth has arrived. To verify that the driver is installed and functioning correctly, use the NVIDIA System Management Interface (nvidia-smi) command.

nvidia-smi

If the installation was successful, you will see a detailed table with information about your GPU.

A successful nvidia-smi command will produce output similar to this, showing the driver version, your GPU model (NVIDIA GeForce GTX 1650), and other stats. The exact driver version may differ.

This output confirms that the proprietary driver has successfully taken control of the GPU. You can see the driver version, the name of your GPU, and its current temperature and power usage.

The following video provides a visual walkthrough of a similar process. Watching the final verification step can be helpful to see it in action.

YOUR ULTIMATE Rocky Linux 9.3 Install Guide with NVIDIA Drivers! | Pro Tips and Tricks Included! 🏔️

This video by The Linux IT Guy demonstrates a full Rocky Linux 9.3 installation, including the NVIDIA drivers. We're interested in the final verification step.

Watch the short segment from verifying the driver, where the presenter runs the nvidia-smi command after installation and rebooting. This shows you exactly what a successful outcome looks like in a terminal.

You can also install a graphical tool to inspect the GPU settings.

sudo dnf install nvidia-settings -y

You can then launch it by typing nvidia-settings in the terminal or finding it in your applications menu. This tool provides a comprehensive GUI for managing your graphics card.

This image shows a more complex development environment after a successful NVIDIA driver installation, with nvidia-smi running in a terminal alongside graphical test applications like vkcube and glxgears, confirming that 3D acceleration is working.


Conclusion

Congratulations! You have successfully installed the proprietary NVIDIA drivers on your Rocky Linux system. This was the most complex hardware-specific configuration task for our project setup. By following a methodical process of preparing the system, adding the right repositories, managing kernel modules with dkms, and resolving potential driver conflicts ahead of time, you've ensured your GPU is ready for the demands of real-time gesture recognition.

Key Takeaways:

  • Always use the official NVIDIA repository for the most stable and up-to-date drivers.
  • The proprietary drivers are essential for accessing the full capabilities of your GPU for tasks like machine learning.
  • Packages like dkms are vital for system stability, as they automatically handle driver updates when the Linux kernel changes.
  • Proactively blacklisting the default nouveau driver is a critical step to prevent conflicts.
  • The nvidia-smi command is the definitive tool for verifying that your NVIDIA drivers are installed and functioning correctly.

In our next lesson, we will shift our focus from system hardware to the software environment. We'll set up a dedicated Python virtual environment and install the core libraries for our project: OpenCV for camera access, MediaPipe for hand tracking, and paho-mqtt for IoT communication.