4

CPU consumption goes very high (which obviously shouldn't) when watching video on Chrome. This is due to some regression that has appeared recently (it wouldn't happen before), but that is not the point here. Let's just assume that something is consuming a lot of CPU.

I disabled intel_powerclamp and intel_rapl, so when CPU consumption gets high, I would expect the cooling fan to speed up as fast as it has to in order to cool down the CPU.

Instead, what happens is that the fan NEVER reaches its top speed, not even close to that. And the whole system slows down and becomes unresponsive, in a very similar fashion as it used to when intel_powerclamp was enabled. But no "kidle_inject" processes show up in top.

The PROOF that the cooling fan is not spinning as fast as it should is that if I restart the computer, before the system starts to boot (at the boot menu), the fan spins at crazy speed. That proves (1) that it is capable of going faster than it does while the OS is running and (2) that the hardware "thinks" the temperature does require it, until the OS kicks in and thinks it knows better.

I can only see two explanations for it:

A) some software configuration is limiting the fan speed (perhaps because it is configured under the assumption that intel_powerclamp was there too and would do half of the job). So, because the fan at its current speed isn't sufficient to cool down the CPU, and since intel_powerclamp is not there limiting CPU use, some internal hardware protection of the CPU kicks in and throttles it, to prevent it from burning (or reaching the hard limit that would cause it to turn off abruptly) OF

B) besides intel_powerclamp and intel_rapl which I have disabled (I understand how intel_powerclamp works, I have no idea how intel_rapl does), there is some other driver that works in some similar way, slowing down the CPU to make it consume less power.

In case (A) I would need to fix the configuration so that the fan is allowed to run at its maximum capacity and see if that is enough to keep the temperature down and prevent hardware protection to kick in.

In case (B) I probably want to try either

[B1] disable whatever other software or semi-software based CPU throttling mechanism is doing a poor job, and see if the fan alone is enough, or

[B2] somehow tweak some weight factor or threshold or priority configuration so that the fan is allowed to run faster BEFORE the CPU throttling kicks in (and hopefully even prevents it from happening).

Does anyone know how to figure out whether it's (A) or (B) and how to fix this?

I read about configuring Thermald at https://wiki.ubuntu.com/Kernel/PowerManagement/ThermalIssues but it's terribly unclear and there are no practical examples.

2

I just went through this exercise with thermald. First, I should point out that thermald was broken, even in fresh versions of 16.04, as it would not read its configuration file. This has now been fixed, so make sure that you have all of your updates installed.

Also, the page you reference is pretty good, and also contains an example thermal-conf.xml configuration file.

Next, assuming that you've got thermald installed, stop the process, and restart it in --no-daemon mode, and carefully watch the output. It'll give you most of the answers that you need to configure your own thermal-conf.xml file. Watch for cdev (cooling device), etc.

sudo service thermald stop

sudo thermald --no-daemon --loglevel=debug

Here's a copy of my custom thermal-conf.xml file for you to look at:

<?xml version="1.0"?>
<ThermalConfiguration>
<Platform>
    <Name>Toshiba Laptop</Name>
    <ProductName>*</ProductName>
    <Preference>QUIET</Preference>
    <ThermalSensors>
            <ThermalSensor>
                    <Type>x86_pkg_temp</Type>
                    <Path>/sys/class/thermal/thermal_zone0/</Path>
                    <AsyncCapable>1</AsyncCapable>
            </ThermalSensor>
    </ThermalSensors>
    <ThermalZones>
            <ThermalZone>
                    <Type>cpu package</Type>
                    <TripPoints>
                            <TripPoint>
                                    <SensorType>x86_pkg_temp</SensorType>
                                    <Temperature>59000</Temperature>
                                    <type>passive</type>
                                    <ControlType>PARALLEL</ControlType>
                                    <CoolingDevice>
                                            <index>0</index>
                                            <type>Processor</type>
                                            <influence> 10 </influence>
                                            <SamplingPeriod> 5 </SamplingPeriod>
                                    </CoolingDevice>
                                    <CoolingDevice>
                                            <index>1</index>
                                            <type>Processor</type>
                                            <influence> 10 </influence>
                                            <SamplingPeriod> 5 </SamplingPeriod>
                                    </CoolingDevice>
                                    <CoolingDevice>
                                            <index>2</index>
                                            <type>Processor</type>
                                            <influence> 10 </influence>
                                            <SamplingPeriod> 5 </SamplingPeriod>
                                    </CoolingDevice>
                                    <CoolingDevice>
                                            <index>3</index>
                                            <type>Processor</type>
                                            <influence> 10 </influence>
                                            <SamplingPeriod> 5 </SamplingPeriod>
                                    </CoolingDevice>
                                    <CoolingDevice>
                                            <index>4</index>
                                            <type>intel_powerclamp</type>
                                            <influence> 30 </influence>
                                            <SamplingPeriod> 10 </SamplingPeriod>
                                    </CoolingDevice>
                                    <CoolingDevice>
                                            <index>5</index>
                                            <type>rapl_controller</type>
                                            <influence> 50 </influence>
                                            <SamplingPeriod> 10 </SamplingPeriod>
                                    </CoolingDevice>
                                    <CoolingDevice>
                                            <index>6</index>
                                            <type>intel_pstate</type>
                                            <influence> 40 </influence>
                                            <SamplingPeriod> 10 </SamplingPeriod>
                                    </CoolingDevice>
                                    <CoolingDevice>
                                            <index>7</index>
                                            <type>rapl_controller_dram</type>
                                            <influence> 50 </influence>
                                            <SamplingPeriod> 10 </SamplingPeriod>
                                    </CoolingDevice>
                            </TripPoint>
                    </TripPoints>
            </ThermalZone>
    </ThermalZones>
</Platform>
</ThermalConfiguration>
  • Oops. It didn't like my paste of my thermal-conf.xml file. I don't know how to get it to view correctly here. Cheers, Al – heynnema Jul 9 '16 at 23:32
  • Thanks. You're right, the abovementioned page does have an example; however that example didn't include physical fans as cooling devices and said nothing about how to figure out existing devices. For now, I have shut down thermald completely and this alone has given me the desired result: the fan reaches higher speed (not the maximum, which means it doesn't even need it) and the CPU does not slow down. This proves how broken thermald is, or its default configuration. – matteo Jul 10 '16 at 9:20
  • What are the "Processor" cooling devices? Btw, I do have all the updates but I have Ubuntu 15.10. Do you know if thermald is fixed (in that it does read the configuration file) there? Is there an easy way to test? – matteo Jul 10 '16 at 9:21
  • Ah, I suggested an edit to fix the XML code in your answer, I don't know if you can see and accept it. Otherwise, you just need to add four spaces at the beginning of every line (or just the first three and last four since the other have already more than four spaces) – matteo Jul 10 '16 at 9:23
  • 1
    Matteo.. I believe that processor cooling devices are temp sensors for Intel cores (in my configuration). You can tell if thermald is fixed by running it in --no-daemon mode, as I indicated above, and it'll show you if thermald is reading its thermal-conf.xml file. Cheers, Al – heynnema Jul 10 '16 at 13:49

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.