
我最近更新到 Ubuntu 22.04 LTS 並看到電源選項。但是,效能模式不可用。
我無法獲得與 Windows 雙啟動相同的效能和基準分數。我想這就是原因。
所以我檢查了電源調節器,它說acpi-cpufreq
。我檢查了我的 grub cfg,它說intel_pstate=enable
.我在 Ubuntu 20.04 上遇到了同樣的問題,認為這可能是核心的問題,但即使使用新內核,它仍然無法運作。
[ 0.062414] Kernel command line: BOOT_IMAGE=/vmlinuz-5.15.0-47-generic root=UUID=9103868b-6caf-4c46-95b9-05f6bb5b8e94 ro intel_pstate=enable quiet splash vt.handoff=7
[ 0.453038] intel_pstate: CPU model not supported
$ cat /sys/devices/system/cpu/cpu*/cpufreq/scaling_driver
acpi-cpufreq
$ uname -r
5.15.0-47-generic
$ grep -i pstate /boot/config-$(uname -r)
CONFIG_X86_INTEL_PSTATE=y
$ grep intel_pstate /boot/grub/grub.cfg
linux /vmlinuz-5.15.0-47-generic root=UUID=xxxxx ro intel_pstate=enable quiet splash $vt_handoff
$ cat /sys/devices/system/cpu/cpufreq/boost
1
$ ls /sys/devices/system/cpu/intel_pstate/
no such file or directory
$ cpufreq-info
..snip..
analyzing CPU 15:
driver: acpi-cpufreq
CPUs which run at the same hardware frequency: 15
CPUs which need to have their frequency coordinated by software: 15
maximum transition latency: 10.0 us.
hardware limits: 800 MHz - 2.30 GHz
available frequency steps: 2.30 GHz, 2.30 GHz, 2.20 GHz, 2.10 GHz, 2.00 GHz, 1.90 GHz, 1.80 GHz, 1.70 GHz, 1.50 GHz, 1.40 GHz, 1.30 GHz, 1.20 GHz, 1.10 GHz, 1000 MHz, 900 MHz, 800 MHz
available cpufreq governors: conservative, ondemand, userspace, powersave, performance, schedutil
current policy: frequency should be within 800 MHz and 2.30 GHz.
The governor "ondemand" may decide which speed to use
within this range.
current CPU frequency is 997 MHz.
cpufreq stats: 2.30 GHz:1,62%, 2.30 GHz:0,13%, 2.20 GHz:0,25%, 2.10 GHz:0,17%, 2.00 GHz:0,27%, 1.90 GHz:0,31%, 1.80 GHz:0,29%, 1.70 GHz:0,54%, 1.50 GHz:0,73%, 1.40 GHz:0,72%, 1.30 GHz:0,96%, 1.20 GHz:1,33%, 1.10 GHz:3,17%, 1000 MHz:6,38%, 900 MHz:18,62%, 800 MHz:64,50% (30660)
$ lscpu
..snip..
Model name: 11th Gen Intel(R) Core(TM) i7-11800H @ 2.30GHz
CPU family: 6
Model: 141
..snip..
Frequency boost: enabled
CPU max MHz: 2301,0000
CPU min MHz: 800,0000
BogoMIPS: 4608.00
Flags: fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mc
a cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss
ht tm pbe syscall nx pdpe1gb rdtscp lm constant_tsc art
arch_perfmon pebs bts rep_good nopl xtopology nonstop_
tsc cpuid aperfmperf tsc_known_freq pni pclmulqdq dtes6
4 monitor ds_cpl vmx est tm2 ssse3 sdbg fma cx16 xtpr p
dcm pcid sse4_1 sse4_2 x2apic movbe popcnt tsc_deadline
_timer aes xsave avx f16c rdrand lahf_lm abm 3dnowprefe
tch cpuid_fault epb cat_l2 invpcid_single cdp_l2 ssbd i
brs ibpb stibp ibrs_enhanced tpr_shadow vnmi flexpriori
ty ept vpid ept_ad fsgsbase tsc_adjust bmi1 avx2 smep b
mi2 erms invpcid rdt_a avx512f avx512dq rdseed adx smap
avx512ifma clflushopt clwb intel_pt avx512cd sha_ni av
x512bw avx512vl xsaveopt xsavec xgetbv1 xsaves split_lo
ck_detect dtherm ida arat pln pts avx512vbmi umip pku o
spke avx512_vbmi2 gfni vaes vpclmulqdq avx512_vnni avx5
12_bitalg avx512_vpopcntdq rdpid movdiri movdir64b fsrm
avx512_vp2intersect md_clear flush_l1d arch_capabiliti
es
另外,當我用 Google 搜尋 cpu 型號和 intel_pstate 時,我可以看到一些論壇帖子具有相同的 cpu,並且驅動程式/調速器(?) 與 intel_pstate 相同,因此它可能受支援。
我想知道我可以採取哪些步驟來進一步排除或解決此問題?謝謝!
ps 我的裝置是筆記型電腦
答案1
在啟動過程中,您將收到內核訊息:
[ 0.453038] intel_pstate: CPU model not supported
因為:
- HWP(硬體 Pstate)控制,又稱為 Intel Speed Shift 技術(不要與 Intel Speed Step 混淆),在 BIOS 中被停用。
- intel_pstate CPU 頻率縮放驅動程式的原始程式碼似乎存在一個錯誤,該錯誤不允許在 Tiger Lake 系列英特爾處理器(可能還有其他系列)禁用 HWP 的情況下使用該驅動程式。
為了在我的 20.04.4 測試伺服器上使用 或 Comet Lake 處理器進行驗證測試Intel(R) Core(TM) i5-10600K CPU @ 4.10GHz
,我註解掉了無 HWP 程式碼路徑中包含該系列的行:
doug@s19:~/kernel/linux$ git diff
diff --git a/drivers/cpufreq/intel_pstate.c b/drivers/cpufreq/intel_pstate.c
index 57cdb3679885..3cbc1abb9911 100644
--- a/drivers/cpufreq/intel_pstate.c
+++ b/drivers/cpufreq/intel_pstate.c
@@ -2414,7 +2414,7 @@ static const struct x86_cpu_id intel_pstate_cpu_ids[] = {
X86_MATCH(ATOM_GOLDMONT, core_funcs),
X86_MATCH(ATOM_GOLDMONT_PLUS, core_funcs),
X86_MATCH(SKYLAKE_X, core_funcs),
- X86_MATCH(COMETLAKE, core_funcs),
+/* X86_MATCH(COMETLAKE, core_funcs), */
X86_MATCH(ICELAKE_X, core_funcs),
{}
};
對於未修改的內核,我得到:
- BIOS 中的HWP 設定為
auto
或enabled
會導致intel_pstate
CPU 頻率縮放驅動程式。 - BIOS 中的HWP 設定
disabled
導致intel_cpufreq
CPU 頻率縮放驅動程式。 (請注意,該intel_cpufreq
驅動程式只是intel_pstate
被動模式下的驅動程序,這是當前 HWP 不可用時的預設驅動程式。另請參閱這裡.)
對於修改後的內核,我得到:
- BIOS 中的HWP 設定為
auto
或enabled
會導致intel_pstate
CPU 頻率縮放驅動程式。 - BIOS 中的HWP 設定
disabled
導致acpi_cpufreq
CPU 頻率縮放驅動程式。
無 HWP 程式碼分支的處理器系列清單似乎相當不完整。在本問題中,型號為 141 或 0X8D 或 TIGERLAKE:
./arch/x86/include/asm/intel-family.h:#define INTEL_FAM6_TIGERLAKE 0x8D /* Willow Cove */
所以建議的程式碼補丁是:
doug@s19:~/kernel/linux$ doug@s19:~/kernel/linux$ git diff
diff --git a/drivers/cpufreq/intel_pstate.c b/drivers/cpufreq/intel_pstate.c
index 57cdb3679885..fc3ebeb0bbe5 100644
--- a/drivers/cpufreq/intel_pstate.c
+++ b/drivers/cpufreq/intel_pstate.c
@@ -2416,6 +2416,7 @@ static const struct x86_cpu_id intel_pstate_cpu_ids[] = {
X86_MATCH(SKYLAKE_X, core_funcs),
X86_MATCH(COMETLAKE, core_funcs),
X86_MATCH(ICELAKE_X, core_funcs),
+ X86_MATCH(TIGERLAKE, core_funcs),
{}
};
MODULE_DEVICE_TABLE(x86cpu, intel_pstate_cpu_ids);
順便說一下,效能 CPU 頻率調節調節器可用於 acpi-cpufreq CPU 頻率調節調節器。只需這樣做:
echo performance | sudo tee /sys/devices/system/cpu/cpu*/cpufreq/scaling_governor
然後檢查一下:
doug@s19:~/kernel/linux$ grep . /sys/devices/system/cpu/cpu*/cpufreq/scaling_governor
/sys/devices/system/cpu/cpu0/cpufreq/scaling_governor:performance
/sys/devices/system/cpu/cpu10/cpufreq/scaling_governor:performance
/sys/devices/system/cpu/cpu11/cpufreq/scaling_governor:performance
/sys/devices/system/cpu/cpu1/cpufreq/scaling_governor:performance
/sys/devices/system/cpu/cpu2/cpufreq/scaling_governor:performance
/sys/devices/system/cpu/cpu3/cpufreq/scaling_governor:performance
/sys/devices/system/cpu/cpu4/cpufreq/scaling_governor:performance
/sys/devices/system/cpu/cpu5/cpufreq/scaling_governor:performance
/sys/devices/system/cpu/cpu6/cpufreq/scaling_governor:performance
/sys/devices/system/cpu/cpu7/cpufreq/scaling_governor:performance
/sys/devices/system/cpu/cpu8/cpufreq/scaling_governor:performance
/sys/devices/system/cpu/cpu9/cpufreq/scaling_governor:performance