Skip to content

Commit ac7652c

Browse files
committed
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.
1 parent 924d9d0 commit ac7652c

3 files changed

Lines changed: 50 additions & 14 deletions

File tree

gpu_benchmark/benchmark.sh

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -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) 2023 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: 29 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -3,22 +3,38 @@
33
# Copyright (c) 2023 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+
sudo dnf install phoronix-test-suite xorg-x11-server-Xvfb -y
32+
33+
nvidia-smi || nvidia-driver-assistant --install --branch "$DRIVER_VER" --module-flavor closed
34+
;;
35+
*)
36+
echo "Please run on a Rocky or Ubuntu system" >&2
37+
exit 1
38+
;;
39+
esac
2440
(echo "Rebooting machine to load Nvidia Driver" && sudo reboot)

0 commit comments

Comments
 (0)