4

After installing Kubuntu 20.04 on my laptop, I have the problem that after some time, the CPU randomly gets stuck at 400MHz and doesn't step up resulting in very slow respond times. Surfing, or even writing a document becomes a pain.

I checked many pages (some reporting it might be a kernel bug) and tried different things like:

  • reinstalling the computer 6-8 times in total now (happens again after some days)

  • disable thermald service:

    systemctl disable thermald.service
    
  • disable intel_pstate in /etc/default/grub:

    GRUB_CMDLINE_LINUX_DEFAULT="intel_pstate=disable"
    
  • set the cpu governor to performance:

    GOVERNOR="performance"
    
  • set all CPUs to max:

    cpupower frequency-set -d `cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq`
    

    or

    cpupower frequency-set -d 2.5GHz
    
  • I installed the "Intel P-State and CPUFreq Manager" KDE Widget to monitor and adjust everything to high performance with no effect

    Processor settings

Hard and Software info:

$ cat /sys/devices/system/cpu/cpu*/cpufreq/scaling_driver
intel_pstate
intel_pstate
intel_pstate
intel_pstate

$ cat /sys/devices/system/cpu/cpu*/cpufreq/scaling_governor performance performance performance performance

$ 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 - 3.10 GHz available cpufreq governors: performance powersave current policy: frequency should be within 3.10 GHz and 3.10 GHz. The governor "performance" may decide which speed to use within this range. current CPU frequency: Unable to call hardware current CPU frequency: 400 MHz (asserted by call to kernel) boost state support: Supported: yes Active: yes

$ grep "model name" /proc/cpuinfo model name : Intel(R) Core(TM) i7-6500U CPU @ 2.50GHz model name : Intel(R) Core(TM) i7-6500U CPU @ 2.50GHz model name : Intel(R) Core(TM) i7-6500U CPU @ 2.50GHz model name : Intel(R) Core(TM) i7-6500U CPU @ 2.50GHz

$ uname -a Linux kubu 5.4.0-42-generic #46-Ubuntu SMP Fri Jul 10 00:24:02 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux

Please help. I tried It's getting really frustrating and I don't know what else I can try :(

Zanna
  • 70,465
  • 1
    try the powersave governor, which sounds counter intuitive. You likely had some thermal throttling event, and then the performance governor never set it back. I think, but am not sure this got fixed upstream. you could try the mainline kernel, just as a test. – Doug Smythies Jul 28 '20 at 17:25
  • Thanks for the comment. Unfortunately, it didn't change anything when upgrading to the mainline kernel. Meanwhile, I tried with a different distro (lubuntu) and it was OK for some days. Still trying, but I realized that my keyboard is broken, so I'm not sure whether it could be a hardware problem or not :/ – DonBilbo Aug 03 '20 at 07:59
  • i have this problem as well for some time but i run ubuntu 20.04. I have a Dell XPS 6C65VT2. It happens about 50% of the times that the notebook resumes from sleep mode and only now and then after a normal boot. Very annoying. It already happenedd with ubuntu 18 and 19 (all versions). The only way to exit this is reboot the computer by turning it off. Just a reboot does often not help. – user2867399 Aug 04 '20 at 18:11
  • Thanks for the advice @user2867399 However, I think it is a hardware issue, because with the new laptop and same SDD (same configuration) there no problems. this is really weird, because except of the keyboard, everything was working fine with the old laptop :/ – DonBilbo Aug 19 '20 at 14:10
  • Having the same problem with my T480 :( it is really intermittent. I've got powersave usually on, it doesn't work. Been several kernels and it still happens. Exact same text from cpupower frequency-info except for 4.00 GHz instead of 3.10 GHz :( – Antti Haapala Oct 29 '20 at 18:16
  • you can try disable ACPI https://askubuntu.com/questions/160036/how-do-i-disable-acpi-when-booting – Kostas Šliažas Nov 05 '20 at 13:43
  • Please try: https://github.com/erpalma/throttled – Juan Cruz Apr 07 '21 at 00:20

2 Answers2

1

I had the same exact problem on a Dell Latitude 7490; frequency getting stuck/pinned at 400Mhz randomly, sometimes after resume from suspend on battery, or when unplugging AC adapter. The problem also doesn't disappear with a hot reboot. I must power off the machine completely and turn it back on, or re-plug in the AC adapter. When the problem occurred, I did a hot-reboot to windows (as I am dual booting Kubuntu 20.04 and Windows 10), and found that windows 10 was also stuck at 400mhz frequency.

Finally it became apparent that is a hardware or firmware related issue. Latest BIOS as of date (BIOS dated feb 2021)

Did an RTC reset (RealTime Clock reset) as recommended in another post by dell but the problem comes back occasionally when unplugging AC Adapter. disabled C-states and Intel Speed Shift (leaving only SpeedStep enabled) in the BIOS, also problem still happening occasionally, so I re-enabled them.

Finally, I was able to find a software based workaround that doesn't require re-plugging in of AC adapter or cold boot.

Create script called cpufix in your path:

$ sudo nano /usr/local/bin/cpufix

with the following content:

#!/bin/bash

Determinate CPU capabilities

MAX_CPU=$(cpupower frequency-info -l | tail -n1 | cut -d' ' -f2)

Disable "BD PROCHOT"

wrmsr -a 0x1FC 262238;

Set and apply frequencies

cpupower frequency-set
-d $(expr $MAX_CPU / 4)
-u $MAX_CPU
-r
-g powersave;

Then set it as executable:

$ sudo chmod +x /usr/local/bin/cpufix

You can also change "powersave" in the last line above to "performance" if you want higher performance rather than normal powersaving profile when on battery operation.

When the issue occurs and you're pinned at 400Mhz frequency, just run:

$ sudo cpufix

In Windows (if you also dual boot), you can do similar with "Throttlestop" program, and uncheck the "BD PROCHOT" checkbox if it is checked (which is likely what happens when your CPU gets pinned at 400Mhz due to manufacturer firmware issue)

0

I believe this may be related to this open issue in thermald: https://github.com/intel/thermal_daemon/issues/293

I'm seeing this issue on my Dell Latitude 7320 and these couple of commands transiently fixes it (until next reboot):

sudo rmmod intel_rapl_msr
sudo modprobe intel_rapl_msr

You can add them to your init scripts if you want to make them run on every boot.