From 766ff5362897e231e25e790ec253b1938a469994 Mon Sep 17 00:00:00 2001 From: RyanH-STFC Date: Fri, 20 Feb 2026 13:54:31 +0000 Subject: [PATCH] Fix driver script and get working for both rhel8 and 9 - removed the old way of getting the drivers and changed it for the new way by using modules. Also made it work for both rocky 8 and rocky 9 by using the version in the link for the repo download Add set to stop further commands if error occurs - if one of the lines error and the script doesnt stop, you probably dont want the script to continue running. Use driver assistant to install drivers - instead of installing the module, now it uses the assistant to install the drivers as using the old way would break on rocky8, also made it reboot everytime even if nvidia-smi seems to be working because sometimes it wont see all of the cards until it reboots so rebooting everytime is the better solution --- gpu_benchmark/gpu_setup.sh | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/gpu_benchmark/gpu_setup.sh b/gpu_benchmark/gpu_setup.sh index 8b3289a8..1d4a9390 100755 --- a/gpu_benchmark/gpu_setup.sh +++ b/gpu_benchmark/gpu_setup.sh @@ -1,6 +1,7 @@ #!/bin/bash # SPDX-License-Identifier: Apache-2.0 # Copyright (c) 2023 United Kingdom Research and Innovation +set -ex sudo dnf update -y @@ -13,6 +14,11 @@ sudo dracut --force sudo dnf install tar bzip2 make automake gcc gcc-c++ pciutils elfutils-libelf-devel libglvnd-devel -y sudo dnf install -y kernel-devel kernel-headers -y -wget -nc https://developer.download.nvidia.com/compute/cuda/12.1.0/local_installers/cuda_12.1.0_530.30.02_linux.run -nvidia-smi || sudo sh cuda_12.1.0_530.30.02_linux.run --silent -nvidia-smi || (echo "Rebooting machine to load Nvidia Driver" && sudo reboot) \ No newline at end of file + +VERSION=$(awk -F= '/^VERSION_ID=/ {gsub("\"","",$2); print $2}' /etc/os-release 2>/dev/null || true) + +sudo dnf config-manager --add-repo http://developer.download.nvidia.com/compute/cuda/repos/rhel"${VERSION%%.*}"/"$(uname -m)"/cuda-rhel"${VERSION%%.*}".repo +sudo dnf install nvidia-driver-assistant -y + +nvidia-smi || nvidia-driver-assistant --install --branch 590 --module-flavor closed +(echo "Rebooting machine to load Nvidia Driver" && sudo reboot)