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
- A RHEL for NVIDIA virtual guest system is deployed and running. See Install a guest system by using virt-install or Install a guest system by using an XML configuration for details.
- The NVIDIA open source driver is installed and functional. For details, see Install the NVIDIA open source driver manually.
- Commands that start with the
#command prompt require administrative privileges provided bysudoor root user access. For information on how to configuresudoaccess, see Enabling unprivileged users to run certain commands.
Procedure
Results
- Verify that the CUDA compiler is available:
$ nvcc --versionIf the output displays the CUDA compilation tools version, the toolkit is installed correctly.
- Run the
deviceQuerysample to verify that the GPU is accessible through CUDA:- Clone the CUDA samples repository:
$ git clone https://github.com/NVIDIA/cuda-samples --depth 1 - Build the
deviceQuerysample:$ cmake -S cuda-samples -B cuda-samples/build -DCMAKE_CUDA_ARCHITECTURES=native $ cmake --build cuda-samples/build --target deviceQuery - Run the sample:
$ cuda-samples/build/cpp/1_Utilities/deviceQuery/deviceQueryIf the output ends with
Result = PASS, the CUDA toolkit and GPU configuration are working correctly.
- Clone the CUDA samples repository: