- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I have an openmp "hello world" program. I have set "performance" governor with cpupower (old cpu-freq) to every core (because I have intel_pstate module).
While I run VTune, I execute:
sudo cpupower --cpu all frequency-info | grep 'CPU freq'
to check the frequencies. I get always this:
current CPU frequency: 2.70 GHz (asserted by call to hardware) current CPU frequency: 2.70 GHz (asserted by call to hardware) current CPU frequency: 2.70 GHz (asserted by call to hardware) current CPU frequency: 2.70 GHz (asserted by call to hardware)
And when it finishes:
current CPU frequency: 2.35 GHz (asserted by call to hardware) current CPU frequency: 2.79 GHz (asserted by call to hardware) current CPU frequency: 2.76 GHz (asserted by call to hardware) current CPU frequency: 2.66 GHz (asserted by call to hardware)
But then, VTune shows variable frequencies (attached image). Why?
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
The underlying issue is that Intel processors are free to ignore frequency requests when cores are idle. If all the cores are busy, cpupower's measured frequency should be correct, but if a core is not busy, running cpupower --frequency-info can return any value between the "maximum efficiency frequency" and the maximum allowed frequency.
This is one of the reasons why Intel discourages attempts to determine the instantaneous frequency, and instead recommends using performance counters (or the APERF/MPERF MSRs) to compute the average frequency over longer time periods.
VTune is reporting the average frequency for each core over short intervals using the performance counters. These values will go up and down depending on the processor utilization and the frequency governor settings. I seem to recall reading that cpupower frequency-info measures the frequency over a short interval, but if the core was idle at the beginning of the interval, you will get a lower number than you may have expected -- the interval is not long enough to "ramp up" the CPU frequency to the target value.
To test this stuff, I have a simple infinite loop code that increments a counter forever and prints out the performance counters (including the computed average frequency) every 10 billion increments. I use "taskset" to pin this to a specific core and then verify that the average frequency while the processor is busy matches the frequency that I requested with cpupower frequency-set or whatever other tool I am working with.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thank you very much.

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page