Skip to content

Commit e6bd6cf

Browse files
Merge pull request #269 from stfc/work-on-ubuntu
Get benchmarks working on ubuntu
2 parents 924d9d0 + 5876c10 commit e6bd6cf

File tree

3 files changed

+50
-16
lines changed

3 files changed

+50
-16
lines changed

gpu_benchmark/benchmark.sh

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/bin/bash
22
# SPDX-License-Identifier: Apache-2.0
3-
# Copyright (c) 2023 United Kingdom Research and Innovation
3+
# Copyright (c) 2026 United Kingdom Research and Innovation
44

55
set -e
66

@@ -22,7 +22,6 @@ DIR="$(cd "$(dirname "$0")" && pwd)"
2222
nvidia-smi || bash "$DIR/gpu_setup.sh"
2323

2424

25-
sudo dnf install phoronix-test-suite xorg-x11-server-Xvfb -y
2625

2726
echo '<?xml version="1.0"?>
2827
<!--Phoronix Test Suite v10.8.4-->

gpu_benchmark/benchmark_setup.sh

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
#!/bin/bash
2+
# SPDX-License-Identifier: Apache-2.0
3+
# Copyright (c) 2026 United Kingdom Research and Innovation
4+
set -ex
5+
6+
OS_NAME=$(awk -F= '/^NAME=/{gsub("\"","",$2); print $2}' /etc/os-release)
7+
8+
case "$OS_NAME" in
9+
"Ubuntu"*)
10+
git clone https://github.com/phoronix-test-suite/phoronix-test-suite.git
11+
cd phoronix-test-suite/
12+
sudo ./install-sh
13+
sudo apt install xvfb -y
14+
sudo apt-get install php-cli php-xml -y
15+
sudo reboot now
16+
;;
17+
"Rocky Linux"*)
18+
sudo dnf install phoronix-test-suite xorg-x11-server-Xvfb -y
19+
;;
20+
esac
21+

gpu_benchmark/gpu_setup.sh

Lines changed: 28 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,38 @@
11
#!/bin/bash
22
# SPDX-License-Identifier: Apache-2.0
3-
# Copyright (c) 2023 United Kingdom Research and Innovation
3+
# Copyright (c) 2026 United Kingdom Research and Innovation
44
set -ex
55

6-
sudo dnf update -y
6+
DRIVER_VER="590"
7+
OS_NAME=$(awk -F= '/^NAME=/{gsub("\"","",$2); print $2}' /etc/os-release)
78

8-
# # Nvidia drivers - centos8
9-
echo 'blacklist nouveau
10-
options nouveau modeset=0' > /usr/lib/modprobe.d/blacklist-nouveau.conf
11-
echo "Updating dracut"
12-
sudo dracut --force
13-
(lsmod | grep -wq nouveau && echo "Rebooting to disable nouveau" && sudo reboot) || true
9+
case "$OS_NAME" in
10+
"Ubuntu"*)
11+
sudo apt update -y
12+
sudo apt install nvidia-driver-"$DRIVER_VER" -y
13+
;;
1414

15-
sudo dnf install tar bzip2 make automake gcc gcc-c++ pciutils elfutils-libelf-devel libglvnd-devel -y
16-
sudo dnf install -y kernel-devel kernel-headers -y
15+
"Rocky Linux"*)
16+
sudo dnf update -y
1717

18-
VERSION=$(awk -F= '/^VERSION_ID=/ {gsub("\"","",$2); print $2}' /etc/os-release 2>/dev/null || true)
18+
echo 'blacklist nouveau
19+
options nouveau modeset=0' > /usr/lib/modprobe.d/blacklist-nouveau.conf
20+
echo "Updating dracut"
21+
sudo dracut --force
22+
(lsmod | grep -wq nouveau && echo "Rebooting to disable nouveau" && sudo reboot) || true
1923

20-
sudo dnf config-manager --add-repo http://developer.download.nvidia.com/compute/cuda/repos/rhel"${VERSION%%.*}"/"$(uname -m)"/cuda-rhel"${VERSION%%.*}".repo
21-
sudo dnf install nvidia-driver-assistant -y
24+
sudo dnf install tar bzip2 make automake gcc gcc-c++ pciutils elfutils-libelf-devel libglvnd-devel -y
25+
sudo dnf install -y kernel-devel kernel-headers -y
2226

23-
nvidia-smi || nvidia-driver-assistant --install --branch 590 --module-flavor closed
27+
VERSION=$(awk -F= '/^VERSION_ID=/ {gsub("\"","",$2); print $2}' /etc/os-release 2>/dev/null || true)
28+
29+
sudo dnf config-manager --add-repo http://developer.download.nvidia.com/compute/cuda/repos/rhel"${VERSION%%.*}"/"$(uname -m)"/cuda-rhel"${VERSION%%.*}".repo
30+
sudo dnf install nvidia-driver-assistant -y
31+
nvidia-smi || nvidia-driver-assistant --install --branch "$DRIVER_VER" --module-flavor closed
32+
;;
33+
*)
34+
echo "Please run on a Rocky or Ubuntu system" >&2
35+
exit 1
36+
;;
37+
esac
2438
(echo "Rebooting machine to load Nvidia Driver" && sudo reboot)

0 commit comments

Comments
 (0)