I am currently developing a software related to robotics, using Ros and the OpenVino toolkit on Ubuntu 18.04 LTS. I am doing some intensive computation related to computer vision, so I am looking for the best performances.
To do so, I changed my cpu-freq governor to 'performance', through the cpupower tool:
sudo cpupower frequency-set -g performance
As a result, when nothing is running, my CPU is close to its maximum ( I have a i7-10510U, whit tubo freq = 4.9GHz):
driver: intel_pstate
CPUs which run at the same hardware frequency: 0
CPUs which need to have their frequency coordinated by software: 0
maximum transition latency: Cannot determine or is not supported.
hardware limits: 400 MHz - 4.90 GHz
available cpufreq governors: performance powersave
current policy: frequency should be within 400 MHz and 4.90 GHz.
The governor "performance" may decide which speed to use
within this range.
current CPU frequency: Unable to call hardware
current CPU frequency: 4.45 GHz (asserted by call to kernel)
boost state support:
Supported: yes
Active: yes
But as soon as I run my Ros program, it drops to approximately 2.3GHz:
analyzing CPU 0:
driver: intel_pstate
CPUs which run at the same hardware frequency: 0
CPUs which need to have their frequency coordinated by software: 0
maximum transition latency: Cannot determine or is not supported.
hardware limits: 400 MHz - 4.90 GHz
available cpufreq governors: performance powersave
current policy: frequency should be within 400 MHz and 4.90 GHz.
The governor "performance" may decide which speed to use
within this range.
current CPU frequency: Unable to call hardware
current CPU frequency: 2.32 GHz (asserted by call to kernel)
boost state support:
Supported: yes
Active: yes
Then I checked the temperature, as I thought it could be the limiting factor, but it has some room:
Package id 0: +79.0°C (high = +100.0°C, crit = +100.0°C)
Core 0: +79.0°C (high = +100.0°C, crit = +100.0°C)
Core 1: +75.0°C (high = +100.0°C, crit = +100.0°C)
Core 2: +78.0°C (high = +100.0°C, crit = +100.0°C)
Core 3: +79.0°C (high = +100.0°C, crit = +100.0°C)
So what is limiting the cpu frequency in my case? (The RAM has also lots of room, 5Gb/16Gb, and my average CPU load is 70%) I tried to get over it, by changing my drivers from intel_pstate to acpi-cpufreq, but then my maximum CPU freq available droped, and when I tried to set the cpu freq by hand while being in usermode, it did not change anything ( The frequency was still the same).
I believe there is a (security?) reason why it is stuck to this frequency, so what is it? And what would be the solution to get over it?
Thanks!
Edit:
I ran Prime95 test, and this is what I get through turbostat:
turbostat version 19.08.31 - Len Brown <lenb@kernel.org>
CPUID(0): GenuineIntel 0x16 CPUID levels; 0x80000008 xlevels; family:model:stepping 0x6:8e:c (6:142:12)
CPUID(1): SSE3 MONITOR - EIST TM2 TSC MSR ACPI-TM HT TM
CPUID(6): APERF, TURBO, DTS, PTM, HWP, HWPnotify, HWPwindow, HWPepp, No-HWPpkg, EPB
cpu6: MSR_IA32_MISC_ENABLE: 0x00850089 (TCC EIST MWAIT PREFETCH TURBO)
CPUID(7): SGX
cpu6: MSR_IA32_FEATURE_CONTROL: 0x00040005 (Locked SGX)
CPUID(0x15): eax_crystal: 2 ebx_tsc: 192 ecx_crystal_hz: 0
TSC: 2304 MHz (24000000 Hz * 192 / 2 / 1000000)
CPUID(0x16): base_mhz: 2300 max_mhz: 4900 bus_mhz: 100
cpu6: MSR_MISC_PWR_MGMT: 0x00401cc0 (ENable-EIST_Coordination DISable-EPB DISable-OOB)
RAPL: 17476 sec. Joule Counter Range, at 15 Watts
cpu6: MSR_PLATFORM_INFO: 0x4043df1011700
4 * 100.0 = 400.0 MHz max efficiency frequency
23 * 100.0 = 2300.0 MHz base frequency
cpu6: MSR_IA32_POWER_CTL: 0x0024005d (C1E auto-promotion: DISabled)
cpu6: MSR_TURBO_RATIO_LIMIT: 0x2b2b3031
43 * 100.0 = 4300.0 MHz max turbo 4 active cores
43 * 100.0 = 4300.0 MHz max turbo 3 active cores
48 * 100.0 = 4800.0 MHz max turbo 2 active cores
49 * 100.0 = 4900.0 MHz max turbo 1 active cores
cpu6: MSR_CONFIG_TDP_NOMINAL: 0x00000012 (base_ratio=18)
cpu6: MSR_CONFIG_TDP_LEVEL_1: 0x00080050 (PKG_MIN_PWR_LVL1=0 PKG_MAX_PWR_LVL1=0 LVL1_RATIO=8 PKG_TDP_LVL1=80)
cpu6: MSR_CONFIG_TDP_LEVEL_2: 0x001700c8 (PKG_MIN_PWR_LVL2=0 PKG_MAX_PWR_LVL2=0 LVL2_RATIO=23 PKG_TDP_LVL2=200)
cpu6: MSR_CONFIG_TDP_CONTROL: 0x00000000 ( lock=0)
cpu6: MSR_TURBO_ACTIVATION_RATIO: 0x00000011 (MAX_NON_TURBO_RATIO=17 lock=0)
cpu6: MSR_PKG_CST_CONFIG_CONTROL: 0x1e008008 (UNdemote-C3, UNdemote-C1, demote-C3, demote-C1, locked, pkg-cstate-limit=8 (unlimited))
cpu6: cpufreq driver: intel_pstate
cpu6: cpufreq governor: powersave
cpufreq intel_pstate no_turbo: 0
cpu6: MSR_MISC_FEATURE_CONTROL: 0x00000000 (L2-Prefetch L2-Prefetch-pair L1-Prefetch L1-IP-Prefetch)
cpu0: MSR_PM_ENABLE: 0x00000001 (HWP)
cpu0: MSR_HWP_CAPABILITIES: 0x01081231 (high 49 guar 18 eff 8 low 1)
cpu0: MSR_HWP_REQUEST: 0x80003104 (min 4 max 49 des 0 epp 0x80 window 0x0 pkg 0x0)
cpu0: MSR_HWP_INTERRUPT: 0x00000000 (Dis_Guaranteed_Perf_Change, Dis_Excursion_Min)
cpu0: MSR_HWP_STATUS: 0x00000000 (No-Guaranteed_Perf_Change, No-Excursion_Min)
cpu0: MSR_IA32_ENERGY_PERF_BIAS: 0x00000006 (balanced)
cpu0: MSR_RAPL_POWER_UNIT: 0x000a0e03 (0.125000 Watts, 0.000061 Joules, 0.000977 sec.)
cpu0: MSR_PKG_POWER_INFO: 0x00000078 (15 W TDP, RAPL 0 - 0 W, 0.000000 sec.)
cpu0: MSR_PKG_POWER_LIMIT: 0x4200e800dc80c8 (UNlocked)
cpu0: PKG Limit #1: ENabled (25.000000 Watts, 28.000000 sec, clamp DISabled)
cpu0: PKG Limit #2: DISabled (29.000000 Watts, 0.002441* sec, clamp DISabled)
cpu0: MSR_DRAM_POWER_LIMIT: 0x5400de00140000 (UNlocked)
cpu0: DRAM Limit: DISabled (0.000000 Watts, 1.000000 sec, clamp DISabled)
cpu0: MSR_PP0_POLICY: 0
cpu0: MSR_PP0_POWER_LIMIT: 0x00000000 (UNlocked)
cpu0: Cores Limit: DISabled (0.000000 Watts, 0.000977 sec, clamp DISabled)
cpu0: MSR_PP1_POLICY: 0
cpu0: MSR_PP1_POWER_LIMIT: 0x00000000 (UNlocked)
cpu0: GFX Limit: DISabled (0.000000 Watts, 0.000977 sec, clamp DISabled)
cpu0: MSR_IA32_TEMPERATURE_TARGET: 0x0a640000 (100 C)
cpu0: MSR_IA32_PACKAGE_THERM_STATUS: 0x883e0802 (38 C)
cpu0: MSR_IA32_PACKAGE_THERM_INTERRUPT: 0x00000003 (100 C, 100 C)
cpu6: MSR_PKGC3_IRTL: 0x0000884e (valid, 79872 ns)
cpu6: MSR_PKGC6_IRTL: 0x00008876 (valid, 120832 ns)
cpu6: MSR_PKGC7_IRTL: 0x00008894 (valid, 151552 ns)
cpu6: MSR_PKGC8_IRTL: 0x000088fa (valid, 256000 ns)
cpu6: MSR_PKGC9_IRTL: 0x0000894c (valid, 339968 ns)
cpu6: MSR_PKGC10_IRTL: 0x00008bf2 (valid, 1034240 ns)
1.06 855 4313 37 1.30 0.00 0.31
1.14 960 6394 36 1.30 0.00 0.31
78.24 2693 30532 79 19.92 0.04 0.35
99.62 2130 33525 74 16.44 0.01 0.30
99.74 2026 33059 77 14.93 0.01 0.31
99.75 2032 33879 80 14.95 0.01 0.30
99.76 2024 31722 81 14.95 0.00 0.29
99.74 2016 35433 82 14.95 0.02 0.32
99.68 2008 56927 83 14.95 0.14 0.51
99.72 2026 38053 81 14.96 0.04 0.36
99.72 2034 38046 78 14.96 0.05 0.37
99.73 2041 49197 77 14.95 0.02 0.33
99.71 2036 39762 77 14.95 0.05 0.38
99.72 2034 28531 77 14.95 0.04 0.36
So the power seems to be limited to 15W
RAPL: 17476 sec. Joule Counter Range, at 15 Watts
I havn't found yet the command line to allow me to change this limit, would you have an hint?
A more general question, how misleading is the turoboost frequency specification, when trying to find the appropriate CPU? Because then I am far from the 4.9GHz.
Thanks!
– DiXcipuli Apr 09 '21 at 07:39/sys/devices/virtual/powercap/intel-rapl
. Also look at the various "enable" flags. But notice your temperature at 15 watts is already high enough, so I wouldn't increase the max power anyhow. – Doug Smythies Apr 14 '21 at 18:36