2

I've recently updated to Ubuntu 22.04 LTS and saw there was power options. However, performance mode is not available.

I can't get the same performance and benchmark scores I get in Windows dual boot. I think this is the reason.

So I checked power governor and it says acpi-cpufreq. I checked my grub cfg, and it says intel_pstate=enable. I had the same problem with Ubuntu 20.04, thought maybe it's an issue with kernle, but even with new kernel, it's still not working.

[    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

Also, when I Google the cpu model and intel_pstate, I can see some forum posts with the same cpu, and driver/governor(?) as intel_pstate, so it's probably supported.

I was wondering what steps I could take to further troubleshoot or fix this issue? Thanks!

p.s. my device is a laptop

Cagri
  • 747
  • Agreed, you should be able to use the intel_pstate CPU frequency scaling driver and it should be used by default, not needing to be specified on the grub command line. Are there any pstate related messages in the /var/log/kern.log file and/or dmesg after boot? Example intel_pstate: Intel P-state driver initializing – Doug Smythies Sep 02 '22 at 22:59
  • Is HWP (HardWare Pstate) control, A.K.A. Intel Speed Shift Technology, disabled in the BIOS? If yes, I think there is a code path that could give the intel_pstate: CPU model not supported result you are getting. This is wrong, and I think TIGERLAKE needs to be added to the test in the no HWP code path. – Doug Smythies Sep 02 '22 at 23:40
  • @DougSmythies Intel SpeedStep was enabled. I tried disabling it and now "no or unknown cpufreq driver" is shown on cpufreq-info. dmesg error is same – Cagri Sep 03 '22 at 00:53
  • I've checked the kernel source code and tiger lake isn't in the supported cpu id list. maybe that's why? but how do others enable it, with the same CPU and kernel then? – Cagri Sep 03 '22 at 01:35
  • 1
    Don't confuse "Intel Speed Step" with "Intel Speed Shift Technology". Yes, disabling speed step will disable CPU frequency scaling entirely. It is Speed Shift I am asking about. And yes, the code path you found is only for the HWP (AKA Speed Shift) disabled path (I think). So, others have it enabled (I think). Are you capable of compiling the kernel? If yes, would you be willing to test a patch? If yes, I'll take this upstream, once verified and tested. – Doug Smythies Sep 03 '22 at 02:46
  • I've always seen it's a complicated thing to do, but I'll try and let you know. thanks! – Cagri Sep 03 '22 at 10:38
  • Before trying kernel compile, did you find the "Intel Speed Shift Technology" setting in BIOS? And was it disabled? And does enabling allow use of the intel_pstate CPU frequency scaling driver? If yes to all 3, then we are on the right track and kernel compile is next. Alternatively, I could compile the kernel and get it to you for test. See my mainline how to notes here. – Doug Smythies Sep 03 '22 at 13:48
  • @DougSmythies there's no speed shift in BIOS unfortunately. thx for the instructions, I'll try to compile in 1-2 days and add another comment here – Cagri Sep 03 '22 at 19:09
  • I wonder if it has another name in your BIOS? What brand and model of LapTop? I'll see if I can find BIOS instructions. Meanwhile, I'll go the other way with my COMETLAKE processor and see if taking that line out of the code and disabling HWP in BIOS makes the intel_pstate CPU frequency scaling driver not supported. That'll be a couple of days also. – Doug Smythies Sep 03 '22 at 20:42
  • @DougSmythies it's MSI Pulse GL66, I checked and don't think there's another name for it, there was Intel SpeedStep and CPU c-states (enabled). BIOS screenshot: https://ibb.co/Ln8Qtvy -- by the way my telegram username is @ cagri if u want faster messaging – Cagri Sep 03 '22 at 20:57
  • Access to the desired setting seems to be hidden. Use "Shift - CTRL - Alt - F2" to access it. Reference. – Doug Smythies Sep 03 '22 at 23:13

1 Answers1

1

During boot you are getting the kernel message:

[    0.453038] intel_pstate: CPU model not supported

Because:

  1. HWP (HardWare Pstate) control, A.K.A. Intel Speed Shift Technology (not to be confused with Intel Speed Step), is disabled in the BIOS.
  2. There seems to be a bug in the source code for the intel_pstate CPU frequency scaling driver that does not allow use of the driver with HWP disabled for the Tiger Lake family of Intel processors, and possibly other families.

For a verification test on my 20.04.4 test server with a Intel(R) Core(TM) i5-10600K CPU @ 4.10GHz, or Comet Lake, processor I commented out the line that includes that family in the no HWP code path:

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),
        {}
 };

For the unmodified kernel I got:

  • HWP set to auto or enabled in BIOS resulted in the intel_pstate CPU frequency scaling driver.
  • HWP set to disabled in the BIOS resulted in the intel_cpufreq CPU frequency scaling driver. (Note that the intel_cpufreq driver is just the intel_pstate driver in passive mode, which is the default now when HWP is not available. See also here.)

For the modified kernel I got:

  • HWP set to auto or enabled in BIOS resulted in the intel_pstate CPU frequency scaling driver.
  • HWP set to disabled in the BIOS resulted in the acpi_cpufreq CPU frequency scaling driver.

The list of processor families for the no HWP code branch seems rather incomplete. In the case of this question the model number is 141 or 0X8D or TIGERLAKE:

./arch/x86/include/asm/intel-family.h:#define INTEL_FAM6_TIGERLAKE              0x8D    /* Willow Cove */

So the suggested code patch would be:

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);

By the way, the performance CPU frequency scaling governor is available for the acpi-cpufreq CPU frequency scaling governor. Just do this:

echo performance | sudo tee /sys/devices/system/cpu/cpu*/cpufreq/scaling_governor

And then check it:

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
Doug Smythies
  • 15,448
  • 5
  • 44
  • 61
  • Thank you very much! turns out BIOS had SpeedShift under "hidden" menu as you've said, and was disabled. I've turned it on, and now intel_pstate is being used! For the kernel, let me know if I can help (like doing tests), if you're going to contribute to it, please! – Cagri Sep 04 '22 at 18:17
  • 1
    @Cagri : I forgot, but the only reason COMETLAKE is currently included is because I asked for it. If you send your email address to dsmythies at telus dot net then I will add you as a "reported by" reference to the patch. In my opinion, this piece meal approach is the bigger issue here. – Doug Smythies Sep 04 '22 at 21:17
  • Please test mainline kernel 6.1-rc1, which contains the patch for your issue. – Doug Smythies Oct 17 '22 at 01:05