Rocky Linux#

_images/logo-rocky.png

This section covers:

  • Rocky Linux 8

  • Rocky Linux 9

  • Rocky Linux 10

Preparation#

  1. Perform the Pre-installation Actions.

  2. The kernel headers and development packages for the currently running kernel can be installed with:

    • Rocky 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
      
    • Rocky 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.

    • 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
      
  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:

  • Rocky Linux 8

  • Rocky 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

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.

Rocky 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

Rocky 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.