Skip to content

Commit

Permalink
Report status of performance relevant governors
Browse files Browse the repository at this point in the history
  • Loading branch information
ThomasKaiser committed Sep 21, 2022
1 parent c0df407 commit 23a042e
Show file tree
Hide file tree
Showing 3 changed files with 45 additions and 3 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand Down
4 changes: 2 additions & 2 deletions Results.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 | - |
Expand Down
42 changes: 42 additions & 0 deletions sbc-bench.sh
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,7 @@ Main() {
[ -f /sys/devices/system/cpu/cpufreq/policy0/scaling_governor ] && \
read OriginalCPUFreqGovernor </sys/devices/system/cpu/cpufreq/policy0/scaling_governor 2>/dev/null
BasicSetup performance >/dev/null 2>&1
CheckGovernors
GetTempSensor
[ "X${MODE}" = "Xpts" ] && CheckPTS
InstallPrerequisits
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit 23a042e

Please sign in to comment.