Skip to content

Instantly share code, notes, and snippets.

@edwintorok
Created December 17, 2023 10:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save edwintorok/5625b7ae2d499a466ee48dc90992daa9 to your computer and use it in GitHub Desktop.
Save edwintorok/5625b7ae2d499a466ee48dc90992daa9 to your computer and use it in GitHub Desktop.
#!/bin/sh
# to be run as root
# See https://llvm.org/docs/Benchmarking.html and https://docs.kernel.org/admin-guide/pm/amd-pstate.html
# Disable ASLR
echo 0 > /proc/sys/kernel/randomize_va_space
# Need to disable turbo boost, only know how to do that if it is set to passive
echo passive >/sys/devices/system/cpu/amd_pstate/status
cpupower frequency-set -g performance
echo 0 >/sys/devices/system/cpu/cpufreq/boost
cpupower idle-set -D 0
cpupower monitor
#intel-rapl/intel-rapl:0
#0
#intel-rapl/intel-rapl:0/intel-rapl:0:0
#0
# | Mperf || RAPL || Idle_Stats
# CPU| C0 | Cx | Freq || pack | core || POLL | C1 | C2 | C3
# 0|100.00| 0.00| 4471||40216472|1569713|| 99.49| 0.00| 0.00| 0.00
# 16|100.00| 0.00| 4449||40216472|1569713|| 99.50| 0.00| 0.00| 0.00
# 1|100.00| 0.00| 4471||40216472|1569713|| 99.49| 0.00| 0.00| 0.00
# 17|100.00| 0.00| 4449||40216472|1569713|| 99.49| 0.00| 0.00| 0.00
# 2| 99.51| 0.49| 4471||40216472|1569713|| 98.60| 0.00| 0.00| 0.00
# 18|100.00| 0.00| 4449||40216472|1569713|| 99.49| 0.00| 0.00| 0.00
# 3|100.00| 0.00| 4449||40216472|1569713|| 99.50| 0.00| 0.00| 0.00
# 19|100.00| 0.00| 4449||40216472|1569713|| 99.50| 0.00| 0.00| 0.00
# 4|100.00| 0.00| 4449||40216472|1569713|| 99.48| 0.00| 0.00| 0.00
# 20|100.00| 0.00| 4449||40216472|1569713|| 99.50| 0.00| 0.00| 0.00
# 5|100.00| 0.00| 4449||40216472|1569713|| 99.50| 0.00| 0.00| 0.00
# 21|100.00| 0.00| 4449||40216472|1569713|| 99.46| 0.00| 0.00| 0.00
# 6|100.00| 0.00| 4449||40216472|1569713|| 99.45| 0.00| 0.00| 0.00
# 22|100.00| 0.00| 4449||40216472|1569713|| 98.32| 0.00| 0.00| 0.00
# 7|100.00| 0.00| 4449||40216472|1569713|| 99.51| 0.00| 0.00| 0.00
# 23|100.00| 0.00| 4449||40216472|1569713|| 99.49| 0.00| 0.00| 0.00
# 8|100.00| 0.00| 4448||40216472|1569713|| 99.50| 0.00| 0.00| 0.00
# 24|100.00| 0.00| 4448||40216472|1569713|| 99.49| 0.00| 0.00| 0.00
# 9|100.00| 0.00| 4448||40216472|1569713|| 99.50| 0.00| 0.00| 0.00
# 25|100.00| 0.00| 4448||40216472|1569713|| 99.50| 0.00| 0.00| 0.00
# 10|100.00| 0.00| 4448||40216472|1569713|| 99.50| 0.00| 0.00| 0.00
# 26|100.00| 0.00| 4447||40216472|1569713|| 99.39| 0.00| 0.00| 0.00
# 11|100.00| 0.00| 4448||40216472|1569713|| 99.49| 0.00| 0.00| 0.00
# 27|100.00| 0.00| 4447||40216472|1569713|| 99.48| 0.00| 0.00| 0.00
# 12|100.00| 0.00| 4448||40216472|1569713|| 99.49| 0.00| 0.00| 0.00
# 28|100.00| 0.00| 4447||40216472|1569713|| 99.49| 0.00| 0.00| 0.00
# 13|100.00| 0.00| 4448||40216472|1569713|| 99.50| 0.00| 0.00| 0.00
# 29|100.00| 0.00| 4447||40216472|1569713|| 99.47| 0.00| 0.00| 0.00
# 14|100.00| 0.00| 4448||40216472|1569713|| 99.50| 0.00| 0.00| 0.00
# 30|100.00| 0.00| 4447||40216472|1569713|| 99.48| 0.00| 0.00| 0.00
# 15|100.00| 0.00| 4448||40216472|1569713|| 99.49| 0.00| 0.00| 0.00
# 31|100.00| 0.00| 4447||40216472|1569713|| 99.37| 0.00| 0.00| 0.00
cpupower frequency-info
#analyzing CPU 13:
# driver: amd-pstate
# CPUs which run at the same hardware frequency: 13
# CPUs which need to have their frequency coordinated by software: 13
# maximum transition latency: 20.0 us
# hardware limits: 400 MHz - 4.50 GHz
# available cpufreq governors: conservative ondemand userspace powersave performance schedutil
# current policy: frequency should be within 400 MHz and 4.50 GHz.
# The governor "performance" may decide which speed to use
# within this range.
# current CPU frequency: Unable to call hardware
# current CPU frequency: 4.48 GHz (asserted by call to kernel)
# boost state support:
# Supported: yes
# Active: no
# AMD PSTATE Highest Performance: 166. Maximum Frequency: 5.88 GHz.
# AMD PSTATE Nominal Performance: 127. Nominal Frequency: 4.50 GHz.
# AMD PSTATE Lowest Non-linear Performance: 85. Lowest Non-linear Frequency: 3.01 GHz.
# AMD PSTATE Lowest Performance: 12. Lowest Frequency: 400 MHz.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment