2013-09-10

Checking correct maximum CPU frequency

There are many tools in the world of Linux that allow checking the maximum CPU frequency. However, some of them may not tell you the correct one. I recently found out that cpufreq-aperf can give you the correct one. Other tools, such as cpufreq-info cannot get the information about Turbo Core for AMD CPUs.

Using cpufreq-aperf is very simple:

forrest@rootown:~/gits/mindboggle/mindboggle/utils$ cpufreq-aperf -o -i 10
You must be root
forrest@rootown:~/gits/mindboggle/mindboggle/utils$ sudo cpufreq-aperf -o -i 10
[sudo] password for forrest: 
Error reading /dev/cpu/0/msr, load/enable msr.ko
forrest@rootown:~/gits/mindboggle/mindboggle/utils$ sudo modprobe msr
forrest@rootown:~/gits/mindboggle/mindboggle/utils$ sudo cpufreq-aperf -o -i 10
CPU Average freq(KHz) Time in C0 Time in Cx C0 percentage
000 2438000   09 sec 978 ms 00 sec 021 ms 99
001 2438000   09 sec 978 ms 00 sec 021 ms 99
002 2438000   09 sec 976 ms 00 sec 023 ms 99
003 2438000   09 sec 976 ms 00 sec 023 ms 99
004 2438000   09 sec 976 ms 00 sec 023 ms 99
005 2438000   09 sec 976 ms 00 sec 023 ms 99
006 2438000   09 sec 976 ms 00 sec 023 ms 99
007 2438000   09 sec 976 ms 00 sec 023 ms 99
008 2438000   09 sec 978 ms 00 sec 021 ms 99
009 2438000   09 sec 978 ms 00 sec 021 ms 99
010 2438000   09 sec 976 ms 00 sec 023 ms 99
011 2438000   09 sec 976 ms 00 sec 023 ms 99
012 2438000   09 sec 976 ms 00 sec 023 ms 99
013 2438000   09 sec 971 ms 00 sec 028 ms 99
014 2438000   09 sec 976 ms 00 sec 023 ms 99
015 2438000   09 sec 976 ms 00 sec 023 ms 99

If Turbo Core is on, then you should see such frequency in freq column. Here, since I used all 16 cores, they all work at the label frequency.

References:
  1. http://manpages.ubuntu.com/manpages/lucid/man1/cpufreq-aperf.1.html
  2. https://wiki.debian.org/HowTo/CpuFrequencyScaling
  3. https://wiki.archlinux.org/index.php/CPU_Frequency_Scaling

No comments: