If you are planning to install Nvidia Drivers on Rocky Linux 8.5, you may want to use DNF to install. For a detailed explanation Streamlining NVIDIA Driver Deployment on RHEL 8 with Modularity Streams
# dnf config-manager --add-repo=https://developer.download.nvidia.com/compute/cuda/repos/rhel8/x86_64/cuda-rhel8.repo
# dnf module install nvidia-driver:latest
cuda-rhel8-x86_64 18 MB/s | 1.4 MB 00:00
Dependencies resolved.
============================================================================================================================================================
Package Architecture Version Repository Size
============================================================================================================================================================
Installing group/module packages:
cuda-drivers x86_64 510.47.03-1 cuda-rhel8-x86_64 7.0 k
nvidia-driver x86_64 3:510.47.03-1.el8 cuda-rhel8-x86_64 22 M
nvidia-driver-NVML x86_64 3:510.47.03-1.el8 cuda-rhel8-x86_64 516 k
nvidia-driver-NvFBCOpenGL x86_64 3:510.47.03-1.el8 cuda-rhel8-x86_64 52 k
nvidia-driver-cuda x86_64 3:510.47.03-1.el8 cuda-rhel8-x86_64 591 k
nvidia-driver-cuda-libs x86_64 3:510.47.03-1.el8 cuda-rhel8-x86_64 63 M
nvidia-driver-devel x86_64 3:510.47.03-1.el8 cuda-rhel8-x86_64 12 k
nvidia-driver-libs x86_64 3:510.47.03-1.el8 cuda-rhel8-x86_64 168 M
nvidia-kmod-common noarch 3:510.47.03-1.el8 cuda-rhel8-x86_64 12 k
.....
.....
.....
Total download size: 292 M
Installed size: 697 M
Is this ok [y/N]:
Once done, do a reboot,
# reboot
If after a reboot and if you do a “nvidia-smi” and receive an error like the one
# 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.
You may want to take a look at https://gist.github.com/espoirMur/65cec3d67e0a96e270860c9c276ab9fa. It could be coming Secure Boot Option in your BIOS.