我目前正在开发一款与机器人相关的软件,使用 Ubuntu 18.04 LTS 上的 Ros 和 OpenVino 工具包。我正在做一些与计算机视觉相关的密集计算,所以我正在寻找最佳性能。
为此,我通过 cpupower 工具将 cpu-freq 调节器更改为“性能”:
sudo cpupower 频率设置-g 性能
因此,当没有任何运行的时候,我的 CPU 接近最大值(我有一个 i7-10510U,管频 = 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
但是,一旦我运行 Ros 程序,它就会下降到大约 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
然后我检查了温度,因为我认为它可能是限制因素,但它还是有一些空间:
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)
那么,在我的情况下,是什么限制了 CPU 频率?(RAM 也有很多空间,5Gb/16Gb,我的平均 CPU 负载是 70%)我试图通过将我的驱动程序从 intel_pstate 更改为 acpi-cpufreq 来解决这个问题,但随后我可用的最大 CPU 频率下降了,当我尝试在用户模式下手动设置 CPU 频率时,它没有改变任何东西(频率仍然相同)。
我认为它被固定在这个频率上是有(安全?)原因的,那么原因是什么?有什么解决方案可以解决这个问题?
谢谢!
编辑:
我运行了 Prime95 测试,这是我通过 turbostat 得到的结果:
turbostat version 19.08.31 - Len Brown <[email protected]>
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
所以功率似乎限制在15W