3

I have a new Core i7-based Sandy Bridge machine. The machine was overclocked by the system builders so that it should run at 4.6Ghz when a single core is under load.

However, the suggested method for confirming this given by the suppliers was to run Prime95 and CPU-Z - these are Windows applications, whilst I am using a Linux (Ubuntu 11.04) environment.

Having done a fair amount of internet searching I'm unable to find a canonical way of confirming in Linux that the "turbo" is taking place when the single core is under load.

This is quite important to me as I'm running computational physics calculations on the machine and need it to be as quick as possible.

1
  • If these are reliable, deterministic calculations, you might just consider running them with the overclock enabled and disabled and comparing the runtimes.
    – Shinrai
    Commented Jun 6, 2011 at 18:16

4 Answers 4

3

After a great deal of searching, forum posts and dead-ends, I finally discovered the tool "TurboStat", which is capable of reading the CPU frequency. It's in source-code form, the link is here: https://github.com/torvalds/linux/blob/master/tools/power/x86/turbostat/turbostat.c

Other tools that I tried and failed to use: cpufreq, cpupowerutils

0
2

Use MPrime. It is the same as prime95, but its for linux. See here for slightly more info.

1
  • Thanks, but I guess my question is more along the lines of how can I see the CPU clock rate, rather than how can I max out the CPU.
    – endian
    Commented Jun 6, 2011 at 18:57
2

You should be able to find out your current cpu speed with the command

more /proc/cpuinfo | grep MHz

Remember that the 4.6GHz speed is when your maxing out one core, if your test program is using several cores you probably won't see speeds that high.

1
  • Thanks. Unfortunately cpuinfo only displays the standard frequency (3400.509 in my case) regardless of whether the system is under load. The program only uses one core, so I would expect the system to enter the overclocked state.
    – endian
    Commented Jun 6, 2011 at 19:42
0

The file /proc/cpuinfo (recommended in another answer) lists the current CPU frequency for each core when the file is read. If dynamic CPU frequency scaling (e.g. turbo boost) is enabled, this may not reflect the CPU frequency over the entire period that your program is executing.

Running perf stat will report an average frequency over the runtime of the program, calculated by dividing the measured number of CPU cycles by the total user+system time. (Both cycles and user+sys time are summed across all threads.) This is a pretty good way to determine the actual CPU frequency in effect on the cores on which your program is running.

For example, running perf stat on a single-threaded, highly CPU-intensive command (md5sum) on a ThunderX2:

$ perf stat timeout 5 md5sum /dev/zero

 Performance counter stats for 'timeout 5 md5sum /dev/zero':

          5,000.82 msec task-clock:u              #    1.000 CPUs utilized
                 0      context-switches:u        #    0.000 /sec
                 0      cpu-migrations:u          #    0.000 /sec
               133      page-faults:u             #   26.596 /sec
     9,814,860,071      cycles:u                  #    1.963 GHz
    11,687,517,078      instructions:u            #    1.19  insn per cycle
   <not supported>      branches:u
           199,612      branch-misses:u

       5.001897254 seconds time elapsed

       4.931454000 seconds user
       0.069996000 seconds sys

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .