From 5876c104e4193e6c991b78051498fa755b3b4472 Mon Sep 17 00:00:00 2001 From: RyanH-STFC Date: Wed, 25 Feb 2026 13:32:28 +0000 Subject: [PATCH] Get benchmarks working on ubuntu - Change the script to get for what OS youre using and then use the correct package manager, and install the benchmarks the correct way. --- gpu_benchmark/benchmark.sh | 3 +-- gpu_benchmark/benchmark_setup.sh | 21 ++++++++++++++++ gpu_benchmark/gpu_setup.sh | 42 +++++++++++++++++++++----------- 3 files changed, 50 insertions(+), 16 deletions(-) create mode 100755 gpu_benchmark/benchmark_setup.sh diff --git a/gpu_benchmark/benchmark.sh b/gpu_benchmark/benchmark.sh index cdbe7318..75af537c 100755 --- a/gpu_benchmark/benchmark.sh +++ b/gpu_benchmark/benchmark.sh @@ -1,6 +1,6 @@ #!/bin/bash # SPDX-License-Identifier: Apache-2.0 -# Copyright (c) 2023 United Kingdom Research and Innovation +# Copyright (c) 2026 United Kingdom Research and Innovation set -e @@ -22,7 +22,6 @@ DIR="$(cd "$(dirname "$0")" && pwd)" nvidia-smi || bash "$DIR/gpu_setup.sh" -sudo dnf install phoronix-test-suite xorg-x11-server-Xvfb -y echo ' diff --git a/gpu_benchmark/benchmark_setup.sh b/gpu_benchmark/benchmark_setup.sh new file mode 100755 index 00000000..0e831bea --- /dev/null +++ b/gpu_benchmark/benchmark_setup.sh @@ -0,0 +1,21 @@ +#!/bin/bash +# SPDX-License-Identifier: Apache-2.0 +# Copyright (c) 2026 United Kingdom Research and Innovation +set -ex + +OS_NAME=$(awk -F= '/^NAME=/{gsub("\"","",$2); print $2}' /etc/os-release) + +case "$OS_NAME" in + "Ubuntu"*) + git clone https://github.com/phoronix-test-suite/phoronix-test-suite.git + cd phoronix-test-suite/ + sudo ./install-sh + sudo apt install xvfb -y + sudo apt-get install php-cli php-xml -y + sudo reboot now + ;; + "Rocky Linux"*) + sudo dnf install phoronix-test-suite xorg-x11-server-Xvfb -y + ;; +esac + diff --git a/gpu_benchmark/gpu_setup.sh b/gpu_benchmark/gpu_setup.sh index 1d4a9390..4ecab814 100755 --- a/gpu_benchmark/gpu_setup.sh +++ b/gpu_benchmark/gpu_setup.sh @@ -1,24 +1,38 @@ #!/bin/bash # SPDX-License-Identifier: Apache-2.0 -# Copyright (c) 2023 United Kingdom Research and Innovation +# Copyright (c) 2026 United Kingdom Research and Innovation set -ex -sudo dnf update -y +DRIVER_VER="590" +OS_NAME=$(awk -F= '/^NAME=/{gsub("\"","",$2); print $2}' /etc/os-release) -# # Nvidia drivers - centos8 -echo 'blacklist nouveau -options nouveau modeset=0' > /usr/lib/modprobe.d/blacklist-nouveau.conf -echo "Updating dracut" -sudo dracut --force -(lsmod | grep -wq nouveau && echo "Rebooting to disable nouveau" && sudo reboot) || true +case "$OS_NAME" in + "Ubuntu"*) + sudo apt update -y + sudo apt install nvidia-driver-"$DRIVER_VER" -y + ;; -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 +"Rocky Linux"*) + sudo dnf update -y -VERSION=$(awk -F= '/^VERSION_ID=/ {gsub("\"","",$2); print $2}' /etc/os-release 2>/dev/null || true) + echo 'blacklist nouveau + options nouveau modeset=0' > /usr/lib/modprobe.d/blacklist-nouveau.conf + echo "Updating dracut" + sudo dracut --force + (lsmod | grep -wq nouveau && echo "Rebooting to disable nouveau" && sudo reboot) || 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 + 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 -nvidia-smi || nvidia-driver-assistant --install --branch 590 --module-flavor closed + 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 "$DRIVER_VER" --module-flavor closed + ;; + *) + echo "Please run on a Rocky or Ubuntu system" >&2 + exit 1 + ;; +esac (echo "Rebooting machine to load Nvidia Driver" && sudo reboot)