Ubuntu

CPU頻率在負載下下降而沒有散熱問題

  • September 23, 2021

這個問題困擾了我幾個星期,我似乎無法弄清楚真正的問題可能是什麼。

問題是在負載下CPU頻率急劇下降。我的意思是,例如,僅打開 Web 瀏覽器時,CPU 頻率約為 400 MHz,而當沒有負載時,頻率又會回升。(不是很高,但仍然不是靜態行為)。這真的讓我發瘋。

一些可能有幫助的進一步資訊:

硬體:

聯想thinkpad T15:

CPU:英特爾 I7-10510U

=> 基本時鐘:1.8GHz

=> 升壓時鐘:4.9GHz

軟體:

發行版:Ubuntu 20.04.1 LTS

核心:5.4.0-52-generic

⇒  cpupower frequency-info
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 "powersave" may decide which speed to use
                 within this range.
 current CPU frequency: Unable to call hardware
 current CPU frequency: 1.24 GHz (asserted by call to kernel)
 boost state support:
   Supported: yes
   Active: yes
# command to simulate a stress on the CPU
⇒  stress-ng --cpu 8 --timeout 15s
stress-ng: info:  [43652] dispatching hogs: 8 cpu
stress-ng: info:  [43652] successful run completed in 15.34s

# The result of the stress on the CPU
⇒  sudo turbostat --Summary --quiet  --show Busy%,Bzy_MHz,PkgTmp,PkgWatt,GFXWatt,IRQ --interval 6
Busy%   Bzy_MHz IRQ PkgTmp  PkgWatt GFXWatt
6.58    1862    11418   51  5.00    0.00
7.69    1813    14444   51  4.96    0.00
7.79    1817    16988   51  5.03    0.00
7.99    1724    14679   51  5.00    0.00
9.12    1542    14504   51  4.91    0.00
8.82    1662    13878   51  4.98    0.00
60.61   1060    19508   52  5.84    0.00 # Applied load around here
99.75   460     19984   51  4.59    0.00
98.06   654     21316   51  4.79    0.00
10.26   1181    16730   51  4.25    0.00 # load ended around here
5.90    1782    10315   50  4.74    0.00
6.60    1890    11701   50  5.10    0.00
6.00    1901    10736   50  5.13    0.00
6.74    1981    13477   51  5.23    0.00
7.43    1731    1500    50  4.92    0.00
⇒  cpufreq-info
cpufrequtils 008: cpufreq-info (C) Dominik Brodowski 2004-2009
Report errors and bugs to cpufreq@vger.kernel.org, please.
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: 4294.55 ms.
 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 "powersave" may decide which speed to use
                 within this range.
 current CPU frequency is 1.26 GHz.
analyzing CPU 1:
 driver: intel_pstate
 CPUs which run at the same hardware frequency: 1
 CPUs which need to have their frequency coordinated by software: 1
 maximum transition latency: 4294.55 ms.
 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 "powersave" may decide which speed to use
                 within this range.
 current CPU frequency is 1.48 GHz.
analyzing CPU 2:
 driver: intel_pstate
 CPUs which run at the same hardware frequency: 2
 CPUs which need to have their frequency coordinated by software: 2
 maximum transition latency: 4294.55 ms.
 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 "powersave" may decide which speed to use
                 within this range.
 current CPU frequency is 982 MHz.
analyzing CPU 3:
 driver: intel_pstate
 CPUs which run at the same hardware frequency: 3
 CPUs which need to have their frequency coordinated by software: 3
 maximum transition latency: 4294.55 ms.
 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 "powersave" may decide which speed to use
                 within this range.
 current CPU frequency is 983 MHz.
analyzing CPU 4:
 driver: intel_pstate
 CPUs which run at the same hardware frequency: 4
 CPUs which need to have their frequency coordinated by software: 4
 maximum transition latency: 4294.55 ms.
 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 "powersave" may decide which speed to use
                 within this range.
 current CPU frequency is 1.06 GHz.
analyzing CPU 5:
 driver: intel_pstate
 CPUs which run at the same hardware frequency: 5
 CPUs which need to have their frequency coordinated by software: 5
 maximum transition latency: 4294.55 ms.
 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 "powersave" may decide which speed to use
                 within this range.
 current CPU frequency is 872 MHz.
analyzing CPU 6:
 driver: intel_pstate
 CPUs which run at the same hardware frequency: 6
 CPUs which need to have their frequency coordinated by software: 6
 maximum transition latency: 4294.55 ms.
 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 "powersave" may decide which speed to use
                 within this range.
 current CPU frequency is 926 MHz.
analyzing CPU 7:
 driver: intel_pstate
 CPUs which run at the same hardware frequency: 7
 CPUs which need to have their frequency coordinated by software: 7
 maximum transition latency: 4294.55 ms.
 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 "powersave" may decide which speed to use
                 within this range.
 current CPU frequency is 850 MHz.

到目前為止我嘗試過的事情:

  • 將電源調速器設置為性能
  • 設置英特爾 pstate 驅動程序頻率限制
  • 使用 cpupower 設置頻率限制(這與直接更改 intel pstate 驅動程序值相同嗎?)
  • 重新安裝 ubuntu 20.04,在全新安裝時遇到了同樣的問題。

我曾經能夠讓我的系統啟動並按應有的方式執行:從 Windows 重新啟動後,在系統上執行假負載時 CPU 直接達到最大 CPU 限制,並在一天的剩餘時間裡繼續工作。系統熱節流如預期的那樣,但據我所知從未低於 2 GHz。但是,重新啟動後問題再次出現……之後我也無法重現這種行為……

如果還不清楚:問題是如何解決這個問題,以便我可以充分利用筆記型電腦的潛力,而不是每次載入新視窗或打開新的瀏覽器選項卡時都等待?

提前致謝!

編輯:

  • 添加重新安裝到我嘗試過的東西

事實證明,這是一個散熱問題,但與軟體無關。將設備送回工廠後,他們更換了設備的冷卻器,問題已解決!

顯然,CPU 升到略低於 100 攝氏度,然後立即進行熱節流。

可能您的嵌入式控制器設置為保守的熱設置。請注意,這些設置在主機板而不是硬碟上是持久的。因此,如果您在 windows 下使用聯想工具,將您的筆記本置於一種“省電且安靜”的配置文件中,然後啟動 ubuntu,該設置仍然處於活動狀態。

要在 Ubuntu 下更改它,您需要正確的核心模組(在我的情況下是dell-smbios)和執行以下操作的smbios-thermal-ctl包:

sudo smbios-thermal-ctl -i

Print all the Available Thermal Information of your system: 
-------------------------------------------------------------------
Supported Thermal Modes: 
    Balanced
    Cool Bottom
    Quiet
    Performance

然後啟動一個更寬鬆的配置文件,在我的情況下(戴爾),兩全其美似乎是Balanced.

sudo smbios-thermal-ctl --set-thermal-mode=Balanced

我可以推薦的另一個工具是s-tui診斷這種行為。

引用自:https://unix.stackexchange.com/questions/616842