Note: exhaustive system details are given at the end of the question.
I am trying to get my development machine to have a very stable CPU frequency so that I can get precise benchmarks of some linear algebra codes - however, it still displays significant frequency fluctuations.
I have set scaling governor to performance
mode:
echo performance | sudo tee /sys/devices/system/cpu/cpu*/cpufreq/scaling_governor
I have also locked everything in the C0
state:
sudo cpupower idle-set -D 0
However, using i7z
, I still observe CPU frequency fluctuations >5%. I would very much appreciate guidance regarding whether there are further steps I should take to constrain the CPU frequency to a fixed value, or whether it is not possible to obtain a more precise frequency constraint.
Appendix:
My processor is an Intel Core i7-9750H:
cat /proc/cpuinfo | grep 'model name'
model name : Intel(R) Core(TM) i7-9750H CPU @ 2.60GHz
...
It has 12 logical CPUs and 6 physical cores:
lscpu -a -e
CPU NODE SOCKET CORE L1d:L1i:L2:L3 ONLINE MAXMHZ MINMHZ
0 0 0 0 0:0:0:0 yes 4500.0000 800.0000
1 0 0 1 1:1:1:0 yes 4500.0000 800.0000
2 0 0 2 2:2:2:0 yes 4500.0000 800.0000
3 0 0 3 3:3:3:0 yes 4500.0000 800.0000
4 0 0 4 4:4:4:0 yes 4500.0000 800.0000
5 0 0 5 5:5:5:0 yes 4500.0000 800.0000
6 0 0 0 0:0:0:0 yes 4500.0000 800.0000
7 0 0 1 1:1:1:0 yes 4500.0000 800.0000
8 0 0 2 2:2:2:0 yes 4500.0000 800.0000
9 0 0 3 3:3:3:0 yes 4500.0000 800.0000
10 0 0 4 4:4:4:0 yes 4500.0000 800.0000
11 0 0 5 5:5:5:0 yes 4500.0000 800.0000
I am running Ubuntu 18.04:
~ cat /etc/os-release
NAME="Ubuntu"
VERSION="18.04.3 LTS (Bionic Beaver)"
ID=ubuntu
ID_LIKE=debian
PRETTY_NAME="Ubuntu 18.04.3 LTS"
VERSION_ID="18.04"
HOME_URL="https://www.ubuntu.com/"
SUPPORT_URL="https://help.ubuntu.com/"
BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/"
PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy"
VERSION_CODENAME=bionic
UBUNTU_CODENAME=bionic
One case not mentioned in your post is Intel's turbo boost. You can disable it by writing 1
to /sys/devices/system/cpu/intel_pstate/no_turbo
. This setting is also available in BIOS, but I'm not sure if the effects are 100% equivalent.