From 23a042e817951d6b2c1657a685777f8046aaa54f Mon Sep 17 00:00:00 2001 From: Thomas Kaiser Date: Wed, 21 Sep 2022 20:40:03 +0200 Subject: [PATCH] Report status of performance relevant governors --- README.md | 2 +- Results.md | 4 ++-- sbc-bench.sh | 42 ++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 45 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 9467585..50cc7b6 100644 --- a/README.md +++ b/README.md @@ -95,7 +95,7 @@ Provides some insights about cache sizes/speed and memory latency/bandwidth. Stu ### [cpuminer](https://github.com/tkinjo1985/cpuminer-multi.git) -This is the most demanding benchmark of the four and pretty efficient to check for appropriate heat dissipation and even instabilities under load. It makes heavy use of [SIMD optimizations](https://en.wikipedia.org/wiki/SIMD) (NEON on ARM and SSE on x86) therefore generating more heat than unoptimized 'standard' code. +This is the most demanding benchmark of the five and pretty efficient to check for appropriate heat dissipation and even instabilities under load. It makes heavy use of [SIMD optimizations](https://en.wikipedia.org/wiki/SIMD) (NEON on ARM and SSE on x86) therefore generating more heat than unoptimized 'standard' code. Heavy SIMD optimizations aren't really common and therefore this test is optional. Unless you execute `sbc-bench -c` it will be skipped since results can be misleading. So consider this being a load generator to check whether your board will start to throttle or becomes unstable but take the benchmark numbers with a grain of salt unless you're a programmer and know what [NEON](https://en.wikipedia.org/wiki/ARM_architecture#Advanced_SIMD_(NEON)) or [SSE](https://en.wikipedia.org/wiki/Streaming_SIMD_Extensions) really are and whether your application can make use of. diff --git a/Results.md b/Results.md index e1f092a..28ed813 100644 --- a/Results.md +++ b/Results.md @@ -35,8 +35,8 @@ So do **not** rely on collected numbers unless you carefully read through all th | [Jetson Nano](http://ix.io/3Ufc) | 2000 MHz | 4.9 | Bionic arm64 | 6260 | 376900 | 717500 | 4100 | 11760 | 8.72 | | [Jetson Xavier NX](http://ix.io/3YWp) | 1890 MHz | 4.9 | Bionic arm64 | 13230 | 992690 | 706280 | 9190 | 18480 | - | | [Kendryte K510](http://ix.io/41Qa) | 790 MHz | 4.17 | Sid riscv64 | 690 | 6750 | 7410 | 280 | 440 | - | -| [Khadas Edge/Captain](http://ix.io/1rYm) | 2000/1500 MHz | 4.4 | Bionic arm64 | 6550 | 402150 | 1130400 | 2810 | 4860 | 10.50 | -| [Khadas Edge/Captain](http://ix.io/1uar) | 2000/1500 MHz | 4.4 | Stretch arm64 | 6600 | 269485 | 1127780 | 2860 | 4880 | 8.85 | +| [Khadas Edge](http://ix.io/1rYm) | 2000/1500 MHz | 4.4 | Bionic arm64 | 6550 | 402150 | 1130400 | 2810 | 4860 | 10.50 | +| [Khadas Edge](http://ix.io/1uar) | 2000/1500 MHz | 4.4 | Stretch arm64 | 6600 | 269485 | 1127780 | 2860 | 4880 | 8.85 | | [Khadas Edge2](http://ix.io/4a5U) | 2260/1800 MHz | 5.10 | Jammy arm64 | 16470 | 641550 | 1287490 | 10860 | 29110 | - | | [Khadas VIM1](http://ix.io/3QLN) | 1415 MHz | 5.1 | Buster arm64 | 3860 | 90160 | 659460 | 1930 | 5900 | - | | [Khadas VIM1S](http://ix.io/4a2b) | 2000 MHz | 5.4 | Jammy arm64 | 3840 | 103430 | 436670 | 1320 | 4240 | - | diff --git a/sbc-bench.sh b/sbc-bench.sh index 74c5a9d..8177f64 100755 --- a/sbc-bench.sh +++ b/sbc-bench.sh @@ -149,6 +149,7 @@ Main() { [ -f /sys/devices/system/cpu/cpufreq/policy0/scaling_governor ] && \ read OriginalCPUFreqGovernor /dev/null BasicSetup performance >/dev/null 2>&1 + CheckGovernors GetTempSensor [ "X${MODE}" = "Xpts" ] && CheckPTS InstallPrerequisits @@ -438,6 +439,47 @@ BashBench(){ esac } # BashBench +CheckGovernors() { + # check and report governors that directly affect performance behaviour. Stuff like + # memory/GPU/NPU governors. On RK3588 for example: + # + # Status of performance relevant governors: + # dmc: dmc_ondemand (dmc_ondemand userspace powersave performance simple_ondemand) + # fb000000.gpu: simple_ondemand (dmc_ondemand userspace powersave performance simple_ondemand) + # fdab0000.npu: userspace (dmc_ondemand userspace powersave performance simple_ondemand) + + Governors="$(find /sys -name "*governor" | grep -E -v '/sys/module|cpuidle|cpufreq/')" + if [ "X${Governors}" = "X" ]; then + return + fi + echo -e "Status of performance relevant governors:" + echo "${Governors}" | while read ; do + read Governor <"${REPLY}" + if [ "X${Governor}" != "X" ]; then + SysFSNode="$(sed 's/cpufreq\//cpufreq-/' <<<"${REPLY%/*}")" + AvailableGovernorsSysFSNode="$(ls -d "${REPLY%/*}"/*available_governors)" + if [ -f "${AvailableGovernorsSysFSNode}" ]; then + read AvailableGovernors <"${AvailableGovernorsSysFSNode}" + if [ "X${AvailableGovernors}" != "X${Governor}" ]; then + printf "%19s: %s" "${SysFSNode##*/}" + grep -q "performance" <<<"${AvailableGovernors}" + GovStatus=$? + if [ ${GovStatus} -eq 0 -a "X${Governor}" = "Xperformance" ]; then + echo -e "${LGREEN}performance${NC}" + elif [ ${GovStatus} -eq 0 -a "X${Governor}" != "Xperformance" ]; then + echo -e "${LRED}${Governor}${NC} (${AvailableGovernors})" + else + echo "${Governor} (${AvailableGovernors})" + fi + fi + else + printf "%19s: %s\n" "${SysFSNode##*/}" "${Governor}" + fi + fi + done | sort -n + echo "" +} # CheckGovernors + PlotPerformanceGraph() { # function that walks through all cpufreq OPP and plots a performance graph using # 7-ZIP MIPS. Needs gnuplot and htmldoc (Debian/Ubuntu: gnuplot-nox htmldoc packages)