Reputation: 908
When I run the google benchmark I get a WARNING saying that cpu scaling is enabled. Is that a feature that I can toggle at build via flags or at runtime via arguments or is it a system setting?
Upvotes: 25
Views: 7521
Reputation: 4195
As stated in google benchmark documentation, to disable CPU scaling use cpupower
tool.
sudo cpupower frequency-set --governor performance
./mybench
sudo cpupower frequency-set --governor powersave
Upvotes: 31
Reputation: 3473
To change your CPU mode (governor), you should become root or use sudo, then one of powersave
or performance
should be echo in the file /sys/devices/system/cpu/cpu*/cpufreq/scaling_governor
.
So, let’s say we want to switch from powersave mode to performance mode, we will do:
sudo sh -c "echo performance | tee /sys/devices/system/cpu/cpu*/cpufreq/scaling_governor"
And if we want to switch back to powersave mode, we will do:
sudo sh -c "echo powersave | tee /sys/devices/system/cpu/cpu*/cpufreq/scaling_governor"
And to get our current CPU mode, we will type:
cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor
Upvotes: 1