Here is how to install the official Nvidia drivers on Rocky Linux and it works flawlessly.
This works best on the default kernel that ships with Rocky Linux, if you have a custom Kernel or modified setup, there might be a need for extra steps. The extra steps are out of the scope of this article.
Update: In order for the driver to install and work correctly you need to disable secure boot, this is by design.
Let’s get straight into it. (The step speed may vary depending on your internet connection)
Step 1. We need to get Epel.
sudo dnf install epel-release
Step 2. Adding the official Nvidia drivers repository to our package managers repository list.
Step 2. Installing the kernel-devel and headers used by the drivers.
Step 3. Installing Nvidia drivers and settings applications.
The command below will download the latest stable driver available.
sudo dnf install nvidia-driver nvidia-settings
Step 4. Installing CUDA drivers. (This is optional but recommended)
sudo dnf install cuda-driver
Step 5. Reboot your system.
Step 6. Verify that it is working by running
The nvidia-smi command should display information about your graphics card, if this command fails to show the details or throws an error after the command is entered, it means that the driver did not install correctly.
To remove the drivers completely.
Run the command below.
Continue the discussion on Reddit.
Thank you for reading, leave a comment, and let me know what you think about this article.
I compiled a list of software and services that I use to improve my workflow, here is the link to the list.
Hi Darryl, thanks for your post.
I have a fresh Rocky Linux install on a Dell desktop with Quadro P2000 GPU. Output of lspci:
0000:65:00.0 VGA compatible controller: NVIDIA Corporation GP106GL [Quadro P2000] (rev a1)
0000:65:00.1 Audio device: NVIDIA Corporation GP106 High Definition Audio Controller (rev a1)
I followed the instructions above. After the reboot the output of 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.
Also on the system settings ->details->About shows Graphics llvmpipe (LLVM 12.0.1, 256bits)
Any help is greatly appreciated.
Thanks in advance.
Hi, Allon, That’s strange, I will have to check and see how I could solve this issue. I don’t have a Quadro P2000 so I cannot replicate the exact issue. What version of Rocky Linux are you running? 8.5?
Thanks for the prompt reply. The version is 8.5.
The error message in the log file (/var/log/nvidia-installer.log):
Kernel module load error: Required key not available
Following the discussion: https://askubuntu.com/questions/762254/why-do-i-get-required-key-not-available-when-install-3rd-party-kernel-modules
I have disable secure boot. On reboot stop for boot settings (F2 on my system) boot settings-> secure boot->disable.
With this change repeating the installation instructions in the post was successful. Is there a way to allow installation without compromising security?
Hi Allon, Nvidia drivers require secure boot to be disabled in order for it to work, this is by design. I don’t know why they do it this way. Happy to know you got it working. Have a great day 🙂
Great guide. Any way to install driver version 520.56.06 specifically (and it matching cuda driver)? When I install from repo with the command above, it will install version 520.61. Thanks
Leave a comment