Install the CUDA toolkit on a RHEL for NVIDIA guest

To run GPU-accelerated applications on Grace-Hopper and Grace-Blackwell systems on a RHEL for NVIDIA guest operating system, configure the NVIDIA CUDA repository and install the CUDA toolkit.

Before you begin

Procedure

  1. Add the NVIDIA CUDA repository for the RHEL 10 ARM64 (SBSA) architecture:
    # dnf config-manager --add-repo https://developer.download.nvidia.com/compute/cuda/repos/rhel10/sbsa/cuda-rhel10.repo
  2. Determine the latest available CUDA toolkit version:
    # dnf list cuda-toolkit-*
  3. Install the CUDA toolkit:
    # dnf -y install cuda-toolkit-<version>
  4. Add the CUDA binaries and libraries to your environment:
    $ export PATH=$PATH:/usr/local/cuda/bin/
    $ export LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:/usr/local/cuda/lib64

Results

  1. Verify that the CUDA compiler is available:
    $ nvcc --version

    If the output displays the CUDA compilation tools version, the toolkit is installed correctly.

  2. Run the deviceQuery sample to verify that the GPU is accessible through CUDA:
    1. Clone the CUDA samples repository:
      $ git clone https://github.com/NVIDIA/cuda-samples --depth 1
    2. Build the deviceQuery sample:
      $ cmake -S cuda-samples -B cuda-samples/build -DCMAKE_CUDA_ARCHITECTURES=native
      $ cmake --build cuda-samples/build --target deviceQuery
    3. Run the sample:
      $ cuda-samples/build/cpp/1_Utilities/deviceQuery/deviceQuery

      If the output ends with Result = PASS, the CUDA toolkit and GPU configuration are working correctly.