12

I do not really knows when it started, i just upgraded from 13.10 to 14.04 and was about to do something about graphics performances (unity felt sluggish). That situation already lasted for 6 months I was paying attention to troubled nvidia proprietary drivers in sli configuration... I was seriously pissed off on nvidia, unity and I was about to go for something non-unity related just go get smooth environment...

Then I discovered less then hour before I killed ubuntu/unity...

It is something related to intel_pstate...

I simply noticed, upon login performances are fantastics... Both cpu and gpu... Like a dream... Then after cca 10 seconds they drop and situation becomes ugly... I chased trough logs and found in syslog it seems to be related to this line:

Apr 28 21:29:41 b4da55 kernel: [ 83.861621] intel_powerclamp: Start idle injection to reduce power

After this line performances are gone. The session I'm having this one while writing this post is somewhat different... I was looking at Google to find how to tune or disable this idle injection (at least while I work on ac, not batteries) to get max performances but nothing... Then it happened on it's own, this line pop-up in syslog:

Apr 28 21:46:03 b4da55 kernel: [  362.386585] intel_powerclamp: Stop forced idle injection

I do not know what caused it... But now it works like a charm! It's so smooth... I can't believe... I guess it renders like over 100fps... I enabled wobbling window effect and having fun... htop is showing much lower cpu usage while i'm not doing anything...

Can someone tell me how I can control this idle injection?

4
  • 2
    @Ingo its purpose is to slow things down (and reduce your power consumption). There is documentation directly from Intel directly in the kernel.
    – ulidtko
    Dec 6, 2014 at 14:18
  • 2
    @ulidtko This is exactly the problem. We know it slows down things on purpose, therefore, we want to turn it off, and the question was "how".
    – Ingo
    Dec 6, 2014 at 18:20
  • @ulidtko see also askubuntu.com/questions/552539/…
    – Ingo
    Dec 6, 2014 at 18:24
  • Man, why does it idle soo badly? It completely blows everything. When removed the cpus are instead lowered in clock and responds much better Sep 12, 2023 at 9:02

2 Answers 2

12

Warning: check your CPU temperature. On my system, idle injection starts only when things get hot. The OS protects the hardware from overheating.

See intel_powerclamp manual. It has "Usage and Interfaces" section which describes how to control it.

TL;DR sudo rmmod intel_powerclamp, but you've been warned.

More gentle means to control the thing exist.

First, locate the abstract "thermal device" corresponding to the power consumption control loop:

# grep -l intel_powerclamp /sys/class/thermal/cooling_device*/type
/sys/class/thermal/cooling_device11/type

# cd /sys/class/thermal/cooling_device11

Now, the "slowdown" percentage of the control loop can be adjusted:

# echo 25 > cur_state

It's possible to set 0 there. Percentage above 50 is not allowed.


It'd be great if someone came up with an applet for controlling this contraption easily (i.e. if someone added the obviously needed general user controls), perhaps with rules (AC/battery, time of day, screen idle etc).

4
  • Bonus note: I've actually used intel_powerclamp to workaround a thermal issue in a laptop, whereby it abortively shut down from just a ~minute of running Minecraft. With the powerclamp enabled and adjusted, the laptop run Minecraft for hours no problem. Interestingly, the FPS looked more smooth with powerclamp than without. Finally: that laptop has a powerful i5 and passive-only cooling. So that's one anecdotal situation where intel_powerclamp is useful.
    – ulidtko
    Jun 5, 2019 at 8:01
  • 1
    tlp might be a helpful addition to your answer: askubuntu.com/questions/391474/stop-cpu-from-overheating/… Jun 5, 2019 at 12:42
  • "Percentage above 50 is not allowed.": Interestingly, my max_state parameter is indeed 50, but I've seen my cur_state vary between 0 and 88. Are you sure that it's not the max_state parameter that we need to modify, if cur_state is continuously changing?
    – RJVB
    Dec 10, 2023 at 11:48
  • 1
    My bad, the control parameter is indeed cur_state. Let me just add that setting it to 0 to disable powerclamp seems to have solved an issue with periodic inexplicable slowdowns for me. Figures, because conky did show me very frequent kidle threads despite very low CPU load and fan activity. Running tmon I don't really see a significant increase in temperatures but the fan seems to be running a little less audibly. Now I'll just have to see if this also addresses the occasional full-system freeze that looked a lot like a CPU halt.
    – RJVB
    Dec 11, 2023 at 11:51
5

In the running system, you can get rid of intel_powerclamp:

sudo rmmod intel_powerclamp

To disable it permanently and suppress loading it altogether, in addition do:

cd /etc/modprobe.d
sudo su
echo install intel_powerclamp /bin/true  >intel_powerclamp.conf

Then, after a reboot, it wont come back.

You must log in to answer this question.