mirror of
https://github.com/masonr/yet-another-bench-script.git
synced 2026-11-07 00:22:52 +08:00
add experimental RISC-V support (#97)
This commit is contained in:
@@ -10,6 +10,7 @@ This script automates the execution of the best benchmarking tools in the indust
|
|||||||
View Daily and Historical 📊 **[YABS Usage Stats Here](https://stats.yabs.sh/)** 📈 ([source](https://github.com/masonr/yabs-stats)).
|
View Daily and Historical 📊 **[YABS Usage Stats Here](https://stats.yabs.sh/)** 📈 ([source](https://github.com/masonr/yabs-stats)).
|
||||||
|
|
||||||
### **What's New With YABS?**
|
### **What's New With YABS?**
|
||||||
|
* [31 Oct 2026](https://github.com/masonr/yet-another-bench-script/issues/97) - Experimental RISC-V (riscv64) support added - fio/iperf3 static binaries and Geekbench 5/6/7 RISC-V preview builds are now supported.
|
||||||
* [19 Sep 2026](https://github.com/masonr/yet-another-bench-script/actions) - fio/iperf3 portable binary builds now automated via GitHub workflows.
|
* [19 Sep 2026](https://github.com/masonr/yet-another-bench-script/actions) - fio/iperf3 portable binary builds now automated via GitHub workflows.
|
||||||
* [24 Jul 2026](https://github.com/masonr/yet-another-bench-script) - [Geekbench 7](https://www.geekbench.com/) is now available via the `-7` flag (Geekbench 6 remains the default).
|
* [24 Jul 2026](https://github.com/masonr/yet-another-bench-script) - [Geekbench 7](https://www.geekbench.com/) is now available via the `-7` flag (Geekbench 6 remains the default).
|
||||||
* [04 Jul 2026](https://stats.yabs.sh/) - Check out YABS usage stats here -> https://stats.yabs.sh/
|
* [04 Jul 2026](https://stats.yabs.sh/) - Check out YABS usage stats here -> https://stats.yabs.sh/
|
||||||
@@ -28,7 +29,7 @@ wget -qO- yabs.sh | bash
|
|||||||
|
|
||||||
**Local fio/iperf3 Packages**: If the tested system has fio and/or iperf3 already installed, the local package will take precedence over the precompiled binary.
|
**Local fio/iperf3 Packages**: If the tested system has fio and/or iperf3 already installed, the local package will take precedence over the precompiled binary.
|
||||||
|
|
||||||
**Experimental ARM Compatibility**: Initial ARM compatibility has been introduced, however, is not considered entirely stable due to limited testing on distinct ARM devices. Report any errors or issues.
|
**Experimental RISC-V Compatibility**: Initial RISC-V (riscv64) compatibility has been introduced, however, is not considered entirely stable due to limited testing on distinct RISC-V devices. Report any errors or issues.
|
||||||
|
|
||||||
**High Bandwidth Usage Notice**: By default, this script will perform many iperf network tests, which will try to max out the network port for ~20s per location (10s in each direction). Low-bandwidth servers (such as a NAT VPS) should consider running this script with the `-r` flag (for reduced iperf locations) or the `-i` flag (to disable network tests entirely).
|
**High Bandwidth Usage Notice**: By default, this script will perform many iperf network tests, which will try to max out the network port for ~20s per location (10s in each direction). Low-bandwidth servers (such as a NAT VPS) should consider running this script with the `-r` flag (for reduced iperf locations) or the `-i` flag (to disable network tests entirely).
|
||||||
|
|
||||||
|
|||||||
@@ -33,7 +33,7 @@ issue if the binaries are out of date and lacking any security-related and/or
|
|||||||
performance updates - the daily scheduled workflows should pick up new upstream
|
performance updates - the daily scheduled workflows should pick up new upstream
|
||||||
releases automatically.
|
releases automatically.
|
||||||
|
|
||||||
Note: ARM and RISC-V compatibility is considered experimental.
|
Note: RISC-V compatibility is considered experimental.
|
||||||
|
|
||||||
### Compile Notes (manual builds)
|
### Compile Notes (manual builds)
|
||||||
|
|
||||||
|
|||||||
69
yabs.sh
69
yabs.sh
@@ -12,7 +12,7 @@
|
|||||||
# performance via fio. The script is designed to not require any dependencies
|
# performance via fio. The script is designed to not require any dependencies
|
||||||
# - either compiled or installed - nor admin privileges to run.
|
# - either compiled or installed - nor admin privileges to run.
|
||||||
|
|
||||||
YABS_VERSION="v2026-10-30"
|
YABS_VERSION="v2026-10-31"
|
||||||
|
|
||||||
echo -e '# ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## #'
|
echo -e '# ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## #'
|
||||||
echo -e '# Yet-Another-Bench-Script #'
|
echo -e '# Yet-Another-Bench-Script #'
|
||||||
@@ -51,7 +51,10 @@ elif [[ $ARCH = *aarch* || $ARCH = *arm* ]]; then
|
|||||||
# host is running an ARM 32-bit kernel
|
# host is running an ARM 32-bit kernel
|
||||||
ARCH="arm"
|
ARCH="arm"
|
||||||
fi
|
fi
|
||||||
echo -e "\nARM compatibility is considered *experimental*"
|
elif [[ $ARCH = *riscv64* ]]; then
|
||||||
|
# host is running a RISC-V 64-bit kernel
|
||||||
|
ARCH="riscv64"
|
||||||
|
echo -e "\nRISC-V compatibility is considered *experimental*"
|
||||||
else
|
else
|
||||||
# host is running a non-supported kernel
|
# host is running a non-supported kernel
|
||||||
echo -e "Architecture not supported by YABS."
|
echo -e "Architecture not supported by YABS."
|
||||||
@@ -268,13 +271,28 @@ if command -v lscpu >/dev/null 2>&1; then
|
|||||||
else
|
else
|
||||||
unset LOCAL_LSCPU
|
unset LOCAL_LSCPU
|
||||||
fi
|
fi
|
||||||
if [[ $ARCH = *aarch64* || $ARCH = *arm* ]] && [[ -n $LOCAL_LSCPU ]]; then
|
if [[ $ARCH = *riscv64* ]]; then
|
||||||
|
# RISC-V /proc/cpuinfo lacks "model name"; try lscpu, the uarch field, the device tree, then fall back to the base ISA string
|
||||||
|
[[ -n $LOCAL_LSCPU ]] && CPU_PROC=$(lscpu | grep "Model name" | sed 's/Model name: *//g')
|
||||||
|
[[ -z $CPU_PROC ]] && CPU_PROC=$(awk -F: '/^uarch/ {print $2; exit}' /proc/cpuinfo | sed 's/^[ \t]*//;s/[ \t]*$//')
|
||||||
|
[[ -z $CPU_PROC && -r /proc/device-tree/model ]] && CPU_PROC=$(tr -d '\0' < /proc/device-tree/model)
|
||||||
|
[[ -z $CPU_PROC ]] && CPU_PROC="RISC-V"
|
||||||
|
CPU_ISA=$(awk -F: '/^isa/ {print $2; exit}' /proc/cpuinfo | sed 's/^[ \t]*//;s/[ \t]*$//')
|
||||||
|
[[ -n $CPU_ISA ]] && CPU_PROC="$CPU_PROC (${CPU_ISA%%_*})"
|
||||||
|
elif [[ $ARCH = *aarch64* || $ARCH = *arm* ]] && [[ -n $LOCAL_LSCPU ]]; then
|
||||||
CPU_PROC=$(lscpu | grep "Model name" | sed 's/Model name: *//g')
|
CPU_PROC=$(lscpu | grep "Model name" | sed 's/Model name: *//g')
|
||||||
else
|
else
|
||||||
CPU_PROC=$(awk -F: '/model name/ {name=$2} END {print name}' /proc/cpuinfo | sed 's/^[ \t]*//;s/[ \t]*$//')
|
CPU_PROC=$(awk -F: '/model name/ {name=$2} END {print name}' /proc/cpuinfo | sed 's/^[ \t]*//;s/[ \t]*$//')
|
||||||
fi
|
fi
|
||||||
echo -e "Processor : $CPU_PROC"
|
echo -e "Processor : $CPU_PROC"
|
||||||
if [[ $ARCH = *aarch64* || $ARCH = *arm* ]] && [[ -n $LOCAL_LSCPU ]]; then
|
if [[ $ARCH = *riscv64* ]]; then
|
||||||
|
# RISC-V /proc/cpuinfo lacks "cpu MHz"; try lscpu then cpufreq sysfs
|
||||||
|
CPU_CORES=$(grep -c '^processor' /proc/cpuinfo)
|
||||||
|
[[ -n $LOCAL_LSCPU ]] && CPU_FREQ=$(lscpu | grep "CPU max MHz" | sed 's/CPU max MHz: *//g')
|
||||||
|
[[ -z $CPU_FREQ && -r /sys/devices/system/cpu/cpu0/cpufreq/cpuinfo_max_freq ]] && CPU_FREQ=$(awk '{ printf "%d", $1 / 1000 }' /sys/devices/system/cpu/cpu0/cpufreq/cpuinfo_max_freq)
|
||||||
|
[[ -z "$CPU_FREQ" ]] && CPU_FREQ="???"
|
||||||
|
CPU_FREQ="${CPU_FREQ} MHz"
|
||||||
|
elif [[ $ARCH = *aarch64* || $ARCH = *arm* ]] && [[ -n $LOCAL_LSCPU ]]; then
|
||||||
CPU_CORES=$(lscpu | grep "^[[:blank:]]*CPU(s):" | sed 's/CPU(s): *//g')
|
CPU_CORES=$(lscpu | grep "^[[:blank:]]*CPU(s):" | sed 's/CPU(s): *//g')
|
||||||
CPU_FREQ=$(lscpu | grep "CPU max MHz" | sed 's/CPU max MHz: *//g')
|
CPU_FREQ=$(lscpu | grep "CPU max MHz" | sed 's/CPU max MHz: *//g')
|
||||||
[[ -z "$CPU_FREQ" ]] && CPU_FREQ="???"
|
[[ -z "$CPU_FREQ" ]] && CPU_FREQ="???"
|
||||||
@@ -284,10 +302,20 @@ else
|
|||||||
CPU_FREQ=$(awk -F: ' /cpu MHz/ {freq=$2} END {print freq " MHz"}' /proc/cpuinfo | sed 's/^[ \t]*//;s/[ \t]*$//')
|
CPU_FREQ=$(awk -F: ' /cpu MHz/ {freq=$2} END {print freq " MHz"}' /proc/cpuinfo | sed 's/^[ \t]*//;s/[ \t]*$//')
|
||||||
fi
|
fi
|
||||||
echo -e "CPU cores : $CPU_CORES @ $CPU_FREQ"
|
echo -e "CPU cores : $CPU_CORES @ $CPU_FREQ"
|
||||||
CPU_AES=$(grep aes /proc/cpuinfo)
|
if [[ $ARCH = *riscv64* ]]; then
|
||||||
|
# RISC-V advertises capabilities in the ISA string: Zkn/Zknd/Zkne = scalar AES crypto extensions
|
||||||
|
CPU_AES=$(echo "$CPU_ISA" | grep -o -E '_zkn[de]?(_|$)')
|
||||||
|
else
|
||||||
|
CPU_AES=$(grep aes /proc/cpuinfo)
|
||||||
|
fi
|
||||||
[[ -z "$CPU_AES" ]] && CPU_AES="\xE2\x9D\x8C Disabled" || CPU_AES="\xE2\x9C\x94 Enabled"
|
[[ -z "$CPU_AES" ]] && CPU_AES="\xE2\x9D\x8C Disabled" || CPU_AES="\xE2\x9C\x94 Enabled"
|
||||||
echo -e "AES-NI : $CPU_AES"
|
echo -e "AES-NI : $CPU_AES"
|
||||||
CPU_VIRT=$(grep 'vmx\|svm' /proc/cpuinfo)
|
if [[ $ARCH = *riscv64* ]]; then
|
||||||
|
# RISC-V: "h" in the base ISA letters = hypervisor extension
|
||||||
|
CPU_VIRT=$(echo "${CPU_ISA%%_*}" | grep 'h')
|
||||||
|
else
|
||||||
|
CPU_VIRT=$(grep 'vmx\|svm' /proc/cpuinfo)
|
||||||
|
fi
|
||||||
[[ -z "$CPU_VIRT" ]] && CPU_VIRT="\xE2\x9D\x8C Disabled" || CPU_VIRT="\xE2\x9C\x94 Enabled"
|
[[ -z "$CPU_VIRT" ]] && CPU_VIRT="\xE2\x9D\x8C Disabled" || CPU_VIRT="\xE2\x9C\x94 Enabled"
|
||||||
echo -e "VM-x/AMD-V : $CPU_VIRT"
|
echo -e "VM-x/AMD-V : $CPU_VIRT"
|
||||||
TOTAL_RAM_RAW=$(free | awk 'NR==2 {print $2}')
|
TOTAL_RAM_RAW=$(free | awk 'NR==2 {print $2}')
|
||||||
@@ -492,7 +520,7 @@ function format_iops {
|
|||||||
# Parameters:
|
# Parameters:
|
||||||
# - (none)
|
# - (none)
|
||||||
function disk_test {
|
function disk_test {
|
||||||
if [[ "$ARCH" = "aarch64" || "$ARCH" = "arm" ]]; then
|
if [[ "$ARCH" = "aarch64" || "$ARCH" = "arm" || "$ARCH" = "riscv64" ]]; then
|
||||||
FIO_SIZE=512M
|
FIO_SIZE=512M
|
||||||
else
|
else
|
||||||
FIO_SIZE=2G
|
FIO_SIZE=2G
|
||||||
@@ -569,9 +597,9 @@ function dd_test {
|
|||||||
|
|
||||||
# check if disk performance is being tested and the host has required space (2G)
|
# check if disk performance is being tested and the host has required space (2G)
|
||||||
AVAIL_SPACE=$(df -k . | awk 'NR==2{print $4}')
|
AVAIL_SPACE=$(df -k . | awk 'NR==2{print $4}')
|
||||||
if [[ -z "$SKIP_FIO" && "$AVAIL_SPACE" -lt 2097152 && "$ARCH" != "aarch64" && "$ARCH" != "arm" ]]; then # 2GB = 2097152KB
|
if [[ -z "$SKIP_FIO" && "$AVAIL_SPACE" -lt 2097152 && "$ARCH" != "aarch64" && "$ARCH" != "arm" && "$ARCH" != "riscv64" ]]; then # 2GB = 2097152KB
|
||||||
echo -e "\nLess than 2GB of space available. Skipping disk test..."
|
echo -e "\nLess than 2GB of space available. Skipping disk test..."
|
||||||
elif [[ -z "$SKIP_FIO" && "$AVAIL_SPACE" -lt 524288 && ("$ARCH" = "aarch64" || "$ARCH" = "arm") ]]; then # 512MB = 524288KB
|
elif [[ -z "$SKIP_FIO" && "$AVAIL_SPACE" -lt 524288 && ("$ARCH" = "aarch64" || "$ARCH" = "arm" || "$ARCH" = "riscv64") ]]; then # 512MB = 524288KB
|
||||||
echo -e "\nLess than 512MB of space available. Skipping disk test..."
|
echo -e "\nLess than 512MB of space available. Skipping disk test..."
|
||||||
# if the skip disk flag was set, skip the disk performance test, otherwise test disk performance
|
# if the skip disk flag was set, skip the disk performance test, otherwise test disk performance
|
||||||
elif [ -z "$SKIP_FIO" ]; then
|
elif [ -z "$SKIP_FIO" ]; then
|
||||||
@@ -992,9 +1020,9 @@ function launch_geekbench {
|
|||||||
# check for curl vs wget
|
# check for curl vs wget
|
||||||
[[ -n $LOCAL_CURL ]] && DL_CMD="curl -s" || DL_CMD="wget -qO-"
|
[[ -n $LOCAL_CURL ]] && DL_CMD="curl -s" || DL_CMD="wget -qO-"
|
||||||
|
|
||||||
if [[ $VERSION == *4* && ($ARCH = *aarch64* || $ARCH = *arm*) ]]; then
|
if [[ $VERSION == *4* && ($ARCH = *aarch64* || $ARCH = *arm* || $ARCH = *riscv64*) ]]; then
|
||||||
echo -e "\nARM architecture not supported by Geekbench 4, use Geekbench 5 or 6."
|
echo -e "\nARM/RISC-V architectures not supported by Geekbench 4, use Geekbench 5 or 6."
|
||||||
elif [[ $VERSION == *4* && $ARCH != *aarch64* && $ARCH != *arm* ]]; then # Geekbench v4
|
elif [[ $VERSION == *4* && $ARCH != *aarch64* && $ARCH != *arm* && $ARCH != *riscv64* ]]; then # Geekbench v4
|
||||||
GB_URL="https://cdn.geekbench.com/Geekbench-4.4.4-Linux.tar.gz"
|
GB_URL="https://cdn.geekbench.com/Geekbench-4.4.4-Linux.tar.gz"
|
||||||
[[ "$ARCH" == *"x86"* ]] && GB_CMD="geekbench_x86_32" || GB_CMD="geekbench4"
|
[[ "$ARCH" == *"x86"* ]] && GB_CMD="geekbench_x86_32" || GB_CMD="geekbench4"
|
||||||
GB_RUN="True"
|
GB_RUN="True"
|
||||||
@@ -1006,18 +1034,23 @@ function launch_geekbench {
|
|||||||
echo -e "\nGeekbench $VERSION cannot run on 32-bit architectures. Skipping test."
|
echo -e "\nGeekbench $VERSION cannot run on 32-bit architectures. Skipping test."
|
||||||
else
|
else
|
||||||
if [[ $VERSION == *5* ]]; then # Geekbench v5
|
if [[ $VERSION == *5* ]]; then # Geekbench v5
|
||||||
[[ $ARCH = *aarch64* || $ARCH = *arm* ]] && GB_URL="https://cdn.geekbench.com/Geekbench-5.5.1-LinuxARMPreview.tar.gz" \
|
GB_VER="5.5.1"
|
||||||
|| GB_URL="https://cdn.geekbench.com/Geekbench-5.5.1-Linux.tar.gz"
|
|
||||||
GB_CMD="geekbench5"
|
GB_CMD="geekbench5"
|
||||||
elif [[ $VERSION == *6* ]]; then # Geekbench v6
|
elif [[ $VERSION == *6* ]]; then # Geekbench v6
|
||||||
[[ $ARCH = *aarch64* || $ARCH = *arm* ]] && GB_URL="https://cdn.geekbench.com/Geekbench-6.7.2-LinuxARMPreview.tar.gz" \
|
GB_VER="6.7.2"
|
||||||
|| GB_URL="https://cdn.geekbench.com/Geekbench-6.7.2-Linux.tar.gz"
|
|
||||||
GB_CMD="geekbench6"
|
GB_CMD="geekbench6"
|
||||||
else # Geekbench v7
|
else # Geekbench v7
|
||||||
[[ $ARCH = *aarch64* || $ARCH = *arm* ]] && GB_URL="https://cdn.geekbench.com/Geekbench-7.1.0-LinuxARMPreview.tar.gz" \
|
GB_VER="7.1.0"
|
||||||
|| GB_URL="https://cdn.geekbench.com/Geekbench-7.1.0-Linux.tar.gz"
|
|
||||||
GB_CMD="geekbench7"
|
GB_CMD="geekbench7"
|
||||||
fi
|
fi
|
||||||
|
# select the Geekbench build for the host architecture (ARM and RISC-V builds are "Preview" releases)
|
||||||
|
if [[ $ARCH = *aarch64* || $ARCH = *arm* ]]; then
|
||||||
|
GB_URL="https://cdn.geekbench.com/Geekbench-$GB_VER-LinuxARMPreview.tar.gz"
|
||||||
|
elif [[ $ARCH = *riscv64* ]]; then
|
||||||
|
GB_URL="https://cdn.geekbench.com/Geekbench-$GB_VER-LinuxRISCVPreview.tar.gz"
|
||||||
|
else
|
||||||
|
GB_URL="https://cdn.geekbench.com/Geekbench-$GB_VER-Linux.tar.gz"
|
||||||
|
fi
|
||||||
GB_RUN="True"
|
GB_RUN="True"
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|||||||
Reference in New Issue
Block a user