Ubuntu 22.04.1 即使在高负载下也会将 CPU 从 4000MHz 限制到 400MHz-1000MHz

Ubuntu 22.04.1 即使在高负载下也会将 CPU 从 4000MHz 限制到 400MHz-1000MHz

我的主笔记本电脑在 Intel Core -7-11370H CPU @ 3.300GHz 上运行 Ubuntu 22.04.1。我通常用它来编写代码和玩游戏,但每当我运行笔记本电脑时,它就会随机地从 4.0 GHz 波动到 800 MHz。风扇也一路调高。起初这似乎是一个热节流问题,但看了我的 CPU 温度后,它们远低于 70C。

sudo lshw

hecker-laptop               
    description: Notebook
    product: ASUS TUF Dash F15 FX516PM_FX516PM
    vendor: ASUSTeK COMPUTER INC.
    version: 1.0
    serial: M3NRKD005820116
    width: 64 bits
    capabilities: smbios-3.3.0 dmi-3.3.0 smp vsyscall32
    configuration: boot=normal chassis=notebook family=ASUS TUF Dash F15 uuid=b2def123-5f2b-aa43-aca7-8c77bc153653
  *-core
       description: Motherboard
       product: FX516PM
       vendor: ASUSTeK COMPUTER INC.
       physical id: 0
       version: 1.0
       serial: P413MC01W4
       slot: MIDDLE
     *-firmware
          description: BIOS
          vendor: American Megatrends International, LLC.
          physical id: 0
          version: FX516PM.322
          date: 08/27/2021
          size: 64KiB
          capacity: 16MiB
          capabilities: pci upgrade shadowing cdboot bootselect socketedrom edd acpi smartbattery biosbootspecification uefi
     *-memory
          description: System Memory
          physical id: 12
          slot: System board or motherboard
          size: 16GiB
        *-bank:0
             description: SODIMM DDR4 Synchronous 3200 MHz (0.3 ns)
             product: M471A1G44AB0-CWE
             vendor: Samsung
             physical id: 0
             serial: 00000000
             slot: Controller0-ChannelA
             size: 8GiB
             width: 64 bits
             clock: 3200MHz (0.3ns)
        *-bank:1
             description: SODIMM DDR4 Synchronous 3200 MHz (0.3 ns)
             product: M471A1G44AB0-CWE
             vendor: Samsung
             physical id: 1
             serial: 015BAD6E
             slot: Controller1-ChannelA-DIMM0
             size: 8GiB
             width: 64 bits
             clock: 3200MHz (0.3ns)
     *-cache:0
          description: L1 cache
          physical id: 26
          slot: L1 Cache
          size: 192KiB
          capacity: 192KiB
          capabilities: synchronous internal write-back data
          configuration: level=1
     *-cache:1
          description: L1 cache
          physical id: 27
          slot: L1 Cache
          size: 128KiB
          capacity: 128KiB
          capabilities: synchronous internal write-back instruction
          configuration: level=1
     *-cache:2
          description: L2 cache
          physical id: 28
          slot: L2 Cache
          size: 5MiB
          capacity: 5MiB
          capabilities: synchronous internal write-back unified
          configuration: level=2
     *-cache:3
          description: L3 cache
          physical id: 29
          slot: L3 Cache
          size: 12MiB
          capacity: 12MiB
          capabilities: synchronous internal write-back unified
          configuration: level=3
     *-cpu
          description: CPU
          product: 11th Gen Intel(R) Core(TM) i7-11370H @ 3.30GHz
          vendor: Intel Corp.
          physical id: 2a
          bus info: cpu@0
          version: 6.140.1
          serial: To Be Filled By O.E.M.
          slot: U3E1
          size: 4062MHz
          capacity: 4800MHz
          width: 64 bits
          clock: 100MHz
          capabilities: lm fpu fpu_exception wp vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx pdpe1gb rdtscp x86-64 constant_tsc art arch_perfmon pebs bts rep_good nopl xtopology nonstop_tsc cpuid aperfmperf tsc_known_freq pni pclmulqdq dtes64 monitor ds_cpl vmx est tm2 ssse3 sdbg fma cx16 xtpr pdcm pcid sse4_1 sse4_2 x2apic movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand lahf_lm abm 3dnowprefetch cpuid_fault epb cat_l2 invpcid_single cdp_l2 ssbd ibrs ibpb stibp ibrs_enhanced tpr_shadow vnmi flexpriority ept vpid ept_ad fsgsbase tsc_adjust bmi1 avx2 smep bmi2 erms invpcid rdt_a avx512f avx512dq rdseed adx smap avx512ifma clflushopt clwb intel_pt avx512cd sha_ni avx512bw avx512vl xsaveopt xsavec xgetbv1 xsaves split_lock_detect dtherm ida arat pln pts hwp hwp_notify hwp_act_window hwp_epp hwp_pkg_req avx512vbmi umip pku ospke avx512_vbmi2 gfni vaes vpclmulqdq avx512_vnni avx512_bitalg avx512_vpopcntdq rdpid movdiri movdir64b fsrm avx512_vp2intersect md_clear ibt flush_l1d arch_capabilities cpufreq
          configuration: cores=4 enabledcores=4 microcode=166 threads=8

当它没有满负荷时,它似乎过度使用了一个 CPU 核心,而没有利用其他核心:在此处输入图片描述

在最大负载下: 在此处输入图片描述

cpufreq-info输出:


  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: 4294.55 ms.
  hardware limits: 400 MHz - 4.80 GHz
  available cpufreq governors: performance, powersave
  current policy: frequency should be within 400 MHz and 4.80 GHz.
                  The governor "powersave" may decide which speed to use
                  within this range.
  current CPU frequency is 400 MHz.

我还检查了系统调节器是否设置为性能,结果是:

performance
performance
performance
performance
performance
performance
performance
performance

也不能成为热节流阀,因为传感器显示的数据清楚地表明温度超低(输出sudo sensors):

Adapter: ISA adapter
Package id 0:  +54.0°C  (high = +100.0°C, crit = +100.0°C)
Core 0:        +51.0°C  (high = +100.0°C, crit = +100.0°C)
Core 1:        +51.0°C  (high = +100.0°C, crit = +100.0°C)
Core 2:        +49.0°C  (high = +100.0°C, crit = +100.0°C)
Core 3:        +51.0°C  (high = +100.0°C, crit = +100.0°C)

Doug 建议:

turbostat version 2022.04.16 - Len Brown <[email protected]>
CPUID(0): GenuineIntel 0x1b CPUID levels
CPUID(1): family:model:stepping 0x6:8c:1 (6:140:1) microcode 0xa6
CPUID(0x80000000): max_extended_levels: 0x80000008
CPUID(1): SSE3 MONITOR - EIST TM2 TSC MSR ACPI-TM HT TM
CPUID(6): APERF, TURBO, DTS, PTM, HWP, HWPnotify, HWPwindow, HWPepp, HWPpkg, EPB
cpu0: MSR_IA32_MISC_ENABLE: 0x00850089 (TCC EIST MWAIT PREFETCH TURBO)
CPUID(7): No-SGX
CPUID(0x15): eax_crystal: 2 ebx_tsc: 172 ecx_crystal_hz: 38400000
TSC: 3302 MHz (38400000 Hz * 172 / 2 / 1000000)
CPUID(0x16): base_mhz: 3300 max_mhz: 4800 bus_mhz: 100
cpu0: MSR_MISC_PWR_MGMT: 0x00401cc0 (ENable-EIST_Coordination DISable-EPB DISable-OOB)
RAPL: 7490 sec. Joule Counter Range, at 35 Watts
cpu0: MSR_PLATFORM_INFO: 0x4043bf0812100
4 * 100.0 = 400.0 MHz max efficiency frequency
33 * 100.0 = 3300.0 MHz base frequency
cpu0: MSR_IA32_POWER_CTL: 0x0024005b (C1E auto-promotion: ENabled)
cpu0: MSR_TURBO_RATIO_LIMIT: 0x2b2b2b2b2b2b3030
43 * 100.0 = 4300.0 MHz max turbo 8 active cores
43 * 100.0 = 4300.0 MHz max turbo 7 active cores
43 * 100.0 = 4300.0 MHz max turbo 6 active cores
43 * 100.0 = 4300.0 MHz max turbo 5 active cores
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
48 * 100.0 = 4800.0 MHz max turbo 1 active cores
cpu0: MSR_CONFIG_TDP_NOMINAL: 0x00000021 (base_ratio=33)
cpu0: MSR_CONFIG_TDP_LEVEL_1: 0x001e00e0 (PKG_MIN_PWR_LVL1=0 PKG_MAX_PWR_LVL1=0 LVL1_RATIO=30 PKG_TDP_LVL1=224)
cpu0: MSR_CONFIG_TDP_LEVEL_2: 0x00000000 ()
cpu0: MSR_CONFIG_TDP_CONTROL: 0x00000000 ( lock=0)
cpu0: MSR_TURBO_ACTIVATION_RATIO: 0x00000020 (MAX_NON_TURBO_RATIO=32 lock=0)
cpu0: MSR_PKG_CST_CONFIG_CONTROL: 0x74008008 (UNdemote-C1, demote-C1, locked, pkg-cstate-limit=8 (unlimited))
/dev/cpu_dma_latency: 750000 usec (constrained)
current_driver: intel_idle
current_governor: menu
current_governor_ro: menu
cpu0: POLL: CPUIDLE CORE POLL IDLE
cpu0: C1ACPI: ACPI FFH MWAIT 0x0
cpu0: C2ACPI: ACPI FFH MWAIT 0x31
cpu0: C3ACPI: ACPI FFH MWAIT 0x60
cpu0: cpufreq driver: intel_pstate
cpu0: cpufreq governor: performance
cpufreq intel_pstate no_turbo: 0
cpu0: 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: 0x010e2130 (high 48 guar 33 eff 14 low 1)
cpu0: MSR_HWP_REQUEST: 0x00003030 (min 48 max 48 des 0 epp 0x0 window 0x0 pkg 0x0)
cpu0: MSR_HWP_REQUEST_PKG: 0x8000ff01 (min 1 max 255 des 0 epp 0x80 window 0x0)
cpu0: MSR_HWP_INTERRUPT: 0x00000001 (EN_Guaranteed_Perf_Change, Dis_Excursion_Min)
cpu0: MSR_HWP_STATUS: 0x00000004 (No-Guaranteed_Perf_Change, No-Excursion_Min)
cpu0: EPB: 6 (balanced)
cpu0: MSR_RAPL_POWER_UNIT: 0x000a0e03 (0.125000 Watts, 0.000061 Joules, 0.000977 sec.)
cpu0: MSR_PKG_POWER_INFO: 0x00000118 (35 W TDP, RAPL 0 - 0 W, 0.000000 sec.)
cpu0: MSR_PKG_POWER_LIMIT: 0x42820000df8200 (UNlocked)
cpu0: PKG Limit #1: ENabled (64.000 Watts, 56.000000 sec, clamp ENabled)
cpu0: PKG Limit #2: ENabled (64.000 Watts, 0.002441* sec, clamp DISabled)
cpu0: MSR_VR_CURRENT_CONFIG: 0x000003c8
cpu0: PKG Limit #4: 121.000000 Watts (UNlocked)
cpu0: MSR_DRAM_POWER_LIMIT: 0x00000000 (UNlocked)
cpu0: DRAM Limit: DISabled (0.000 Watts, 0.000977 sec, clamp DISabled)
cpu0: MSR_PP0_POLICY: 0
cpu0: MSR_PP0_POWER_LIMIT: 0x00000000 (UNlocked)
cpu0: Cores Limit: DISabled (0.000 Watts, 0.000977 sec, clamp DISabled)
cpu0: MSR_PP1_POLICY: 0
cpu0: MSR_PP1_POWER_LIMIT: 0x00000000 (UNlocked)
cpu0: GFX Limit: DISabled (0.000 Watts, 0.000977 sec, clamp DISabled)
cpu0: MSR_IA32_TEMPERATURE_TARGET: 0x04640000 (96 C) (100 default - 4 offset)
cpu0: MSR_IA32_PACKAGE_THERM_STATUS: 0x88190800 (75 C)
cpu0: MSR_IA32_PACKAGE_THERM_INTERRUPT: 0x00000003 (100 C, 100 C)
cpu0: MSR_PKGC3_IRTL: 0x00000000 (NOTvalid, 0 ns)
cpu0: MSR_PKGC6_IRTL: 0x00000000 (NOTvalid, 0 ns)
cpu0: MSR_PKGC7_IRTL: 0x00000000 (NOTvalid, 0 ns)
cpu0: MSR_PKGC8_IRTL: 0x00000000 (NOTvalid, 0 ns)
cpu0: MSR_PKGC9_IRTL: 0x00000000 (NOTvalid, 0 ns)
cpu0: MSR_PKGC10_IRTL: 0x00000000 (NOTvalid, 0 ns)
Busy%   Bzy_MHz IRQ PkgTmp  PkgWatt CorWatt GFXWatt RAMWatt
89.29   1056    69723   59  12.51   8.23    0.00    0.00
95.24   2387    149284  60  20.30   15.98   0.00    0.00
99.33   711 269919  70  9.05    4.09    0.00    0.00
99.27   2416    60068   61  22.35   17.13   0.00    0.00
95.10   3197    131078  60  26.22   21.99   0.00    0.00
95.10   1571    51773   79  15.40   11.67   0.00    0.00
85.31   1601    44297   62  16.29   12.25   0.00    0.00
86.33   1263    43754   78  14.23   10.17   0.00    0.00
83.16   1578    50564   60  16.47   12.27   0.00    0.00
96.85   400 44528   60  6.71    2.85    0.00    0.00
97.99   2818    163068  62  24.51   19.72   0.00    0.00
99.57   1607    188449  76  15.76   11.56   0.00    0.00
99.25   2398    252989  75  21.55   16.53   0.00    0.00
99.24   2354    54631   60  22.16   17.19   0.00    0.00
99.65   400 42533   59  7.41    2.85    0.00    0.00
91.83   2581    63192   60  22.70   17.96   0.00    0.00
92.22   2363    59587   78  22.72   18.15   0.00    0.00
86.30   957 46282   62  10.26   6.17    0.00    0.00
91.32   400 44582   60  6.88    2.84    0.00    0.00
97.31   2219    69392   78  21.93   16.74   0.00    0.00
90.98   911 45906   63  10.60   6.12    0.00    0.00
96.21   686 41132   77  8.57    4.74    0.00    0.00
90.98   2440    51281   60  22.40   18.11   0.00    0.00
97.57   738 54602   74  8.73    4.82    0.00    0.00
90.28   2470    54670   62  22.52   18.26   0.00    0.00
97.99   400 43327   62  7.04    2.85    0.00    0.00
97.23   899 43498   75  10.08   6.16    0.00    0.00
82.62   2335    53024   62  22.41   17.68   0.00    0.00
97.51   400 45329   60  7.22    2.85    0.00    0.00

运行后sudo rdmsr --hexadecimal 0x64F

15000400

运行后grep . /sys/class/powercap/intel-rapl/intel-rapl:0/*

/sys/class/powercap/intel-rapl/intel-rapl:0/constraint_0_max_power_uw:35000000
/sys/class/powercap/intel-rapl/intel-rapl:0/constraint_0_name:long_term
/sys/class/powercap/intel-rapl/intel-rapl:0/constraint_0_power_limit_uw:64000000
/sys/class/powercap/intel-rapl/intel-rapl:0/constraint_0_time_window_us:55967744
/sys/class/powercap/intel-rapl/intel-rapl:0/constraint_1_max_power_uw:0
/sys/class/powercap/intel-rapl/intel-rapl:0/constraint_1_name:short_term
/sys/class/powercap/intel-rapl/intel-rapl:0/constraint_1_power_limit_uw:64000000
/sys/class/powercap/intel-rapl/intel-rapl:0/constraint_1_time_window_us:2440
/sys/class/powercap/intel-rapl/intel-rapl:0/constraint_2_max_power_uw:0
/sys/class/powercap/intel-rapl/intel-rapl:0/constraint_2_name:peak_power
/sys/class/powercap/intel-rapl/intel-rapl:0/constraint_2_power_limit_uw:121000000
/sys/class/powercap/intel-rapl/intel-rapl:0/constraint_2_time_window_us:0
grep: /sys/class/powercap/intel-rapl/intel-rapl:0/device: Is a directory
/sys/class/powercap/intel-rapl/intel-rapl:0/enabled:1
grep: /sys/class/powercap/intel-rapl/intel-rapl:0/energy_uj: Permission denied
grep: /sys/class/powercap/intel-rapl/intel-rapl:0/intel-rapl:0:0: Is a directory
grep: /sys/class/powercap/intel-rapl/intel-rapl:0/intel-rapl:0:1: Is a directory
/sys/class/powercap/intel-rapl/intel-rapl:0/max_energy_range_uj:262143328850
/sys/class/powercap/intel-rapl/intel-rapl:0/name:package-0
grep: /sys/class/powercap/intel-rapl/intel-rapl:0/power: Is a directory
grep: /sys/class/powercap/intel-rapl/intel-rapl:0/subsystem: Is a directory

答案1

我遇到过同样的问题。

运行powerprofilesctl以查看使用的设置。我的设置不知为何被设置为 1GHz power-saver,并且一直保持在 1GHz 以下。

还要检查 TLP 是否正常运行,因为这些包之间存在冲突https://bugs.launchpad.net/ubuntu/+source/tlp/+bug/1934944

相关内容