Red Hat Enterprise Linux#
This section covers:
Red Hat Enterprise Linux 8
Red Hat Enterprise Linux 9
Red Hat Enterprise Linux 10
Rocky Linux 8
Rocky Linux 9
Rocky Linux 10
Oracle Linux 8
Oracle Linux 9
Preparation#
Perform the Pre-installation Actions.
Precompiled streams do not require kernel headers or DKMS. If precompiled kernel modules are not required, the kernel headers and development packages for the currently running kernel can be installed with:
Red Hat Enterprise Linux 9/10, Rocky Linux 9/10, Oracle Linux 9:
# dnf install kernel-devel-matched kernel-headers
Red Hat Enterprise Linux 9/10, Rocky Linux 9/10, using the 64k kernel variant on aarch64:
# dnf install kernel-64k-devel-matched kernel-headers
Red Hat Enterprise Linux 8, Rocky Linux 8, Oracle Linux 8:
# dnf install kernel-devel-$(uname -r) kernel-headers
Oracle Linux 8/9 using the UEK kernel variant:
# dnf install kernel-uek-devel-$(uname -r) kernel-headers
If the kernel has been compiled with a different compiler than the default system one, the different compiler must be configured to build all the DKMS modules that need to be used with the UEK kernel.
The system compiler:
$ gcc --version | grep GCC gcc (GCC) 11.5.0 20240719 (Red Hat 11.5.0-5.0.1)
With a UEK 8 kernel, we can clearly see that the kernel package is built with a different compiler
$ cat /usr/src/kernels/6.12.0-100.28.2.2.el9uek.x86_64/.config | grep CONFIG_CC_VERSION_TEXT CONFIG_CC_VERSION_TEXT="gcc (GCC) 14.2.1 20250110 (Red Hat 14.2.1-7)" $ . /opt/rh/gcc-toolset-14/enable $ gcc --version | grep GCC gcc (GCC) 14.2.1 20250110 (Red Hat 14.2.1-7)
DKMS must be configured to use the same compiler to build the modules. For DKMS up to 3.2.2:
# cat /usr/src/nvidia-*/dkms.conf | grep MAKE | sed -e 's|=\"|=\"source /opt/rh/gcc-toolset-14/enable; |g' > /etc/dkms/nvidia.conf
From DKMS 3.3.0:
# echo build_environment=/opt/rh/gcc-toolset-14/enable > /etc/dkms/framework.conf.d/uek.conf
After this, the modules can be built like any other DKMS module.
Satisfy third-party package dependencies:
The NVIDIA driver
rpm
packages depend on other external packages. Those packages are only available on third-party repositories, such as EPEL. Any such third-party repositories must be added to the package manager repository database before installing the NVIDIA driverrpm
packages, or missing dependencies will prevent the installation from proceeding.Red Hat Enterprise Linux 10:
# subscription-manager repos --enable=rhel-10-for-$arch-appstream-rpms # subscription-manager repos --enable=rhel-10-for-$arch-baseos-rpms # subscription-manager repos --enable=codeready-builder-for-rhel-10-$arch-rpms # dnf install https://dl.fedoraproject.org/pub/epel/epel-release-latest-10.noarch.rpm
Red Hat Enterprise Linux 9:
# subscription-manager repos --enable=rhel-9-for-$arch-appstream-rpms # subscription-manager repos --enable=rhel-9-for-$arch-baseos-rpms # subscription-manager repos --enable=codeready-builder-for-rhel-9-$arch-rpms # dnf install https://dl.fedoraproject.org/pub/epel/epel-release-latest-9.noarch.rpm
Red Hat Enterprise Linux 8:
# subscription-manager repos --enable=rhel-8-for-$arch-appstream-rpms # subscription-manager repos --enable=rhel-8-for-$arch-baseos-rpms # subscription-manager repos --enable=codeready-builder-for-rhel-8-$arch-rpms # dnf install https://dl.fedoraproject.org/pub/epel/epel-release-latest-8.noarch.rpm
Rocky Linux 9/10:
# dnf config-manager --set-enabled crb # dnf install epel-release
Rocky Linux 8:
# dnf config-manager --set-enabled powertools # dnf install epel-release
Oracle Linux 9:
# dnf config-manager --set-enabled ol9_codeready_builder # dnf install oracle-epel-release-el9
Oracle Linux 8:
# dnf config-manager --set-enabled ol8_codeready_builder # dnf install oracle-epel-release-el8
Choose an installation method: Local Repository Installation or Network Repository Installation.
Local Repository Installation#
Download the NVIDIA driver:
$ wget https://developer.download.nvidia.com/compute/nvidia-driver/$version/local_installers/nvidia-driver-local-repo-$distro.$version.$arch.rpm
where
$version
is the NVIDIA driver versionInstall local repository on file system:
# rpm --install nvidia-driver-local-repo-$distro.$version*.$arch.rpm
Network Repository Installation#
Enable the network repository. For
x86_64
:# dnf config-manager --add-repo https://developer.download.nvidia.com/compute/cuda/repos/$distro/$arch/cuda-$distro.repo
For
aarch64
:# dnf config-manager --add-repo https://developer.download.nvidia.com/compute/cuda/repos/$distro/sbsa/cuda-$distro.repo
Clean DNF repository cache:
# dnf clean expire-cache
DNF module enablement#
This is required for distributions where content is not distributed as a flat repository but as a repository containing DNF module streams.
These instructions apply to both local and network installations and only for the following distributions:q
Red Hat Enterprise Linux 8
Red Hat Enterprise Linux 9
Rocky Linux 8
Rocky Linux 9
Oracle Linux 8
Oracle Linux 9
Open Kernel Modules
# dnf module enable nvidia-driver:open-dkms
Example DKMS streams:
580-open
oropen-dkms
Proprietary Kernel Modules
# dnf module enable nvidia-driver:latest-dkms
Example DKMS streams:
580-dkms
orlatest-dkms
Example precompiled streams:
580
orlatest
Driver Installation#
These instructions apply to both local and network installations.
Open Kernel Modules
# dnf install nvidia-open
Proprietary Kernel Modules
# dnf install cuda-drivers
Compute-only (Headless) and Desktop-only (no Compute) Installation#
It’s possible to install the driver without all the desktop components (GL, EGL, Vulkan, X drivers, and so on) to limit the footprint and dependencies on the system. With the same logic it’s possible to install a desktop system without any compute component.
Note
The components excluded at installation time can always be added at a later stage. This will pull in all the additional dependencies required.
Compute-only System#
Open Kernel Modules
# dnf install nvidia-driver-cuda kmod-nvidia-open-dkms
Proprietary Kernel Modules
# dnf install nvidia-driver-cuda kmod-nvidia-latest-dkms
Desktop-only System#
Open Kernel Modules
# dnf install nvidia-driver kmod-nvidia-open-dkms
Proprietary Kernel Modules
# dnf install nvidia-driver kmod-nvidia-latest-dkms
Reboot the System#
# reboot
Perform the Post-installation Actions.