Red Hat Enterprise Linux#

_images/logo-redhat.png

This section covers:

  • Red Hat Enterprise Linux 8

  • Red Hat Enterprise Linux 9

  • Red Hat Enterprise Linux 10

Preparation#

  1. Perform the Pre-installation Actions.

  2. Precompiled streams do not require kernel headers or DKMS. For information on precompiled streams, plese refer to the section Precompiled Kernel Modules.

    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:

      # dnf install kernel-devel-matched kernel-headers
      

      If using the 64k kernel variant on aarch64:

      # dnf install kernel-64k-devel-matched kernel-headers
      
    • Red Hat Enterprise Linux 8:

      # dnf install kernel-devel-$(uname -r) kernel-headers
      
  3. 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 driver rpm 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
      
  4. Choose an installation method: Local Repository Installation or Network Repository Installation.

Local Repository Installation#

  1. 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 version

  2. Install local repository on file system:

    # rpm --install nvidia-driver-local-repo-$distro.$version*.$arch.rpm
    

Network Repository Installation#

  1. 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
    
  2. 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:

  • Red Hat Enterprise Linux 8

  • Red Hat Enterprise Linux 9

Open Kernel Modules

# dnf module enable nvidia-driver:open-dkms
  • Example DKMS streams: 580-open or open-dkms

Proprietary Kernel Modules

# dnf module enable nvidia-driver:latest-dkms
  • Example DKMS streams: 580-dkms or latest-dkms

  • Example precompiled streams: 580 or latest

For information on precompiled streams, plese refer to the section Precompiled Kernel Modules.

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.

Package Upgrades#

When a new version is available, a normal package update command specific for the distribution should suffice in upgrading the driver. The various differences in distributions would take care of obsolency and package switching when performing upgrades to a different branch.

Red Hat Enterprise Linux 8/9#

When upgrading the driver to the same stream:

# dnf update

When upgrading the driver to a different stream:

# dnf module reset nvidia-driver
# dnf module enable nvidia-driver:<stream>
# dnf update --allowerasing

Or when switching from proprietary kernel modules to open kernel modules:

# dnf module reset nvidia-driver
# dnf module enable nvidia-driver:<stream>
# dnf install nvidia-open --allowerasing

Red Hat Enterprise Linux 10#

If DNF locking is configured on the sytem, please adjust the configuration or remove the lock entirely. Please refer to the DNF 4 section of the Version locking chapter for more information.

When upgrading the driver, whether configured to a version locked branch or the latest available, the command to execute is always the same; what matters is the DNF version lock configuration:

# dnf update

When switching from proprietary kernel modules to open kernel modules:

# dnf install nvidia-open --allowerasing

This will remove any package which would have dependencies removed.

Precompiled Kernel Modules#

Open kernel modules#

This section applies to:

  • Red Hat Enterprise Linux 10

Precompiled streams of open source modules offer an optional method of streamlining the installation process using Red Hat signed kernel modules. The advantages of precompiled streams:

  • UEFI Secure Boot works out of the box via trusted keys already installed in the kernel keyring by Red Hat.

  • Simpler dependencies: removes kernel-devel, kernel-headers, DKMS and GCC compiler requirements.

  • Fewer repositories: the EPEL repository is no longer needed for DKMS or for the extra EGL libraries.

When using precompiled drivers, a plugin for the DNF package manager is enabled that prevents system breakages by preventing upgrades to a kernel for which no precompiled driver yet exists. This can delay the application of kernel updates, but ensures that a tested kernel and driver combination is always used. A warning is displayed by dnf during that upgrade situation:

NVIDIA driver: some kernel packages have been filtered due to missing precompiled modules.
Please run "dnf nvidia-plugin" as a command to see a report on the filter being applied.

Additional information is shown for all kernels and precompiled modules that are available for the system by running the plugin as a standlone command. For example:

# dnf nvidia-plugin

To use the precompiled kernel module packages provided by Red Hat (examples for x86_64):

  1. Enable the Extensions repository:

    # subscription-manager repos --enable rhel-10-for-x86_64-extensions-rpms
    Repository 'rhel-10-for-x86_64-extensions-rpms' is enabled for this system.
    
  2. Install the preferred driver combination, selecting the precompiled kernel module packages as part of the transaction:

    # dnf install kmod-nvidia-open nvidia-driver nvidia-driver-cuda
    Updating Subscription Management repositories.
    Dependencies resolved.
    ============================================================================================================================================
     Package                                          Architecture Version                       Repository                                Size
    ============================================================================================================================================
    Installing:
     kmod-nvidia-open-590.48.01-6.12.0-124.31.1       x86_64       3:590.48.01-3.el10_1          rhel-10-for-x86_64-extensions-rpms        22 M
     nvidia-driver                                    x86_64       3:590.48.01-1.el10            cuda-rhel10-x86_64                       4.7 M
     nvidia-driver-cuda                               x86_64       3:590.48.01-1.el10            cuda-rhel10-x86_64                       534 k
    Installing dependencies:
     egl-gbm                                          x86_64       2:1.1.2.1-1.el10_1            rhel-10-for-x86_64-extensions-rpms        21 k
     egl-wayland                                      x86_64       1.1.20-1.el10_1               rhel-10-for-x86_64-extensions-rpms        45 k
     egl-x11                                          x86_64       1.0.3-1.el10_1                rhel-10-for-x86_64-extensions-rpms        55 k
     libnvidia-cfg                                    x86_64       3:590.48.01-1.el10            cuda-rhel10-x86_64                       151 k
     libnvidia-gpucomp                                x86_64       3:590.48.01-1.el10            cuda-rhel10-x86_64                        24 M
     libnvidia-ml                                     x86_64       3:590.48.01-1.el10            cuda-rhel10-x86_64                       676 k
     libvdpau                                         x86_64       1.5-8.el10                    rhel-10-for-x86_64-appstream-rpms         20 k
     nvidia-driver-cuda-libs                          x86_64       3:590.48.01-1.el10            cuda-rhel10-x86_64                        85 M
     nvidia-driver-libs                               x86_64       3:590.48.01-1.el10            cuda-rhel10-x86_64                       104 M
     nvidia-kmod-common                               noarch       3:590.48.01-1.el10            cuda-rhel10-x86_64                        72 M
     nvidia-modprobe                                  x86_64       3:590.48.01-1.el10            cuda-rhel10-x86_64                        30 k
     nvidia-persistenced                              x86_64       3:590.48.01-1.el10            cuda-rhel10-x86_64                        34 k
     ocl-icd                                          x86_64       2.3.2-8.el10                  rhel-10-for-x86_64-baseos-rpms            69 k
     opencl-filesystem                                noarch       1.0-22.el10                   rhel-10-for-x86_64-appstream-rpms        9.0 k
    Installing weak dependencies:
     dnf-plugin-nvidia                                noarch       2.3-1.el10                    cuda-rhel10-x86_64                        17 k
    
    Transaction Summary
    ============================================================================================================================================
    Install  18 Packages
    
    Total download size: 313 M
    Installed size: 1.0 G
    Is this ok [y/N]:
    

Proprietary kernel modules#

This section applies to:

  • Red Hat Enterprise Linux 8 on x86_64

  • Red Hat Enterprise Linux 9 on x86_64

Precompiled streams of proprietary modules offer an optional method of streamlining the installation process. The advantages of precompiled streams:

  • UEFI Secure Boot can be enabled by importing trusted keys from NVIDIA.

  • Simpler dependencies: removes kernel-devel, kernel-headers, DKMS and GCC compiler requirements.

  • Fewer repositories: the EPEL repository is no longer needed for DKMS.

When using precompiled drivers, a plugin for the DNF package manager is enabled that prevents system breakages by preventing upgrades to a kernel for which no precompiled driver yet exists. This can delay the application of kernel updates, but ensures that a tested kernel and driver combination is always used. A warning is displayed by dnf during that upgrade situation:

NVIDIA driver: some kernel packages have been filtered due to missing precompiled modules.
Please run "dnf nvidia-plugin" as a command to see a report on the filter being applied.

Additional information is shown for all kernels and precompiled modules that are available for the system by running the plugin as a standlone command. For example:

# dnf nvidia-plugin

Packaging templates and instructions are provided on GitHub to allow you to maintain your own precompiled kernel module packages for custom kernels and derivative Linux distros: NVIDIA/yum-packaging-precompiled-kmod

To use the precompiled kernel module packages:

  1. Choose one of the options below depending on the desired driver:

    • latest always updates to the highest versioned driver (precompiled):

      # dnf module enable nvidia-driver:latest
      
    • Locks the driver updates to the specified driver branch (precompiled). Replace <id> with the appropriate driver branch streams, for example 570, 560, 550, etc.:

      # dnf module enable nvidia-driver:<id>
      
  2. Install the preferred driver combination, for example:

    # dnf install nvidia-open
    # dnf install nvidia-driver-cuda
    # dnf install nvidia-driver nvidia-settings
    # dnf install nvidia-driver nvidia-driver-cuda
    

    Please refer to the precompiled folder in the driver repositories for more information.

Importing the MOK key for Secure Boot#

If running on an UEFI system with Secure Boot enabled, import the Machine Owner Key in the firmware.

First of all, download the appropriate key:

  • Red Hat Enterprise Linux 9

$ wget https://developer.download.nvidia.com/compute/cuda/repos/rhel9/x86_64/NVIDIA2019-public_key.der
  • Red Hat Enterprise Linux 8

$ wget https://developer.download.nvidia.com/compute/cuda/repos/rhel8/x86_64/NVIDIA2019-public_key.der

Then import the key into the firmware, selecting a temporary password:

# mokutil --import *-public_key.der
input password: <hidden>
input password again: <hidden>
# mokutil --list-new --short
d56f7e6ace NVIDIA
# systemctl reboot

During the reboot you’ll be presented with the mokutil tool:

  1. Press any key to begin.

    _images/mok-util-01.png
  2. Select Enroll MOK:

    _images/mok-util-02.png
  3. Select Continue to proceed:

    _images/mok-util-03.png
  4. Select Yes to enroll the key.

    _images/mok-util-04.png
  5. Type the MOK password you created for the key during installation.

    Note

    Please note that there will be no feedback on the screen as you type the characters.

    _images/mok-util-05.png
  6. Select Reboot to reboot into the operating system with the NVIDIA drivers and Secure Boot enabled.

    _images/mok-util-06.png

Precompiled Streams Support Matrix#

This table shows an example of the supported precompiled, legacy, and open DKMS streams for each driver.

Table 7 Streams Support Matrix#

NVIDIA Driver

Precompiled Stream

Legacy DKMS Stream

Open DKMS Stream

Highest version

latest

latest-dkms

open-dkms

Locked at 590.x

590

590-dkms

590-open

Locked at 580.x

580

580-dkms

580-open

Locked at 570.x

570

570-dkms

570-open

Prior to switching between module streams, first reset the DNF module:

# dnf module reset nvidia-driver

Or as an alternative:

# dnf module switch-to nvidia-driver:<stream>