Ubuntu – CPU Turbo boost: modify temperature limit under 14.04

cpu loadcpufreqinteltemperatureturbo-boost

I've installed kubuntu 14.04, and there is some problem with CPU turbo frequency. I've read a lot about it, but can't find the correct answer.

There is an i7-3630QM CPU @ 2.40GHz with 3.20GHz turbo in my Lenovo Y580 notebook. If i put the cpu at full load (with rendering in blender on 8 threads) the frequency jumps to around 3.2GHz for all cores, but after a few seconds, when the temperature rises, the frequency decreases to 2.4GHz, and stay on it during the rendering, (the fan does not run at max speed).

When i used ubuntu 12.10 this problem not occured, but it does in 13.10 and 14.04.

My notebooks cooler is really good, so there is no toverheating problem with the full speed turbo boost (the cpu temp was 85-90°C at 3.2GHz in ubuntu 12.10), so i want to use it on full speed. How can i use the cpu with turbo boost at full 3.2GHz speed in ubuntu 14.04 without this (temperature?) limit?

(after discuss with terdon)
I think the problem is that cpu freq is scaled down before the fan could respond to the high temperature. AFTER cpu scaled back from 3.2GHz to 2.4GHz the fan spins up for a moment, but because cpufreq already scaled down, it generates less heat, so the fan's rpm falls back. It would be ok, if after cpu cooling down, frequency rise again to 3.2GHz, but it stays on 2.4GHz.

Some measurements:

Output of i7z program, when the render just started:

 Cpu speed from cpuinfo 2394.00Mhz                                                                                                                               
cpuinfo might be wrong if cpufreq is enabled. To guess correctly try estimating via tsc                                                                         
Linux's inbuilt cpu_khz code emulated now                                                                                                                       
True Frequency (without accounting Turbo) 2394 MHz                                                                                                              
  CPU Multiplier 24x || Bus clock frequency (BCLK) 99.75 MHz                                                                                                    

Socket [0] - [physical cores=4, logical cores=8, max online cores ever=4]                                                                                       
  TURBO ENABLED on 4 Cores, Hyper Threading ON                                                                                                                  
  Max Frequency without considering Turbo 2493.75 MHz (99.75 x [25])                                                                                            
  Max TURBO Multiplier (if Enabled) with 1/2/3/4 Cores is  34x/33x/32x/32x                                                                                      
  Real Current Frequency 3192.01 MHz [99.75 x 32.00] (Max of below)                                                                                             
        Core [core-id]  :Actual Freq (Mult.)      C0%   Halt(C1)%  C3 %   C6 %   C7 %  Temp                                                                     
        Core 1 [0]:       3191.98 (32.00x)       100       0       0       0       0    83                                                                      
        Core 2 [2]:       3192.01 (32.00x)      99.8       0       0       0       1    92                                                                      
        Core 3 [4]:       3192.00 (32.00x)       100       0       0       0       0    88                                                                      
        Core 4 [6]:       3192.00 (32.00x)       100       0       0       0       0    76                                                                      
...

And 5-10 seconds later (also with full load):

Cpu speed from cpuinfo 2394.00Mhz                                                                                                                               
cpuinfo might be wrong if cpufreq is enabled. To guess correctly try estimating via tsc                                                                         
Linux's inbuilt cpu_khz code emulated now                                                                                                                       
True Frequency (without accounting Turbo) 2394 MHz                                                                                                              
  CPU Multiplier 24x || Bus clock frequency (BCLK) 99.75 MHz                                                                                                    

Socket [0] - [physical cores=4, logical cores=8, max online cores ever=4]                                                                                       
  TURBO ENABLED on 4 Cores, Hyper Threading ON                                                                                                                  
  Max Frequency without considering Turbo 2493.75 MHz (99.75 x [25])                                                                                            
  Max TURBO Multiplier (if Enabled) with 1/2/3/4 Cores is  34x/33x/32x/32x                                                                                      
  Real Current Frequency 2462.52 MHz [99.75 x 24.69] (Max of below)                                                                                             
        Core [core-id]  :Actual Freq (Mult.)      C0%   Halt(C1)%  C3 %   C6 %   C7 %  Temp                                                                     
        Core 1 [0]:       2394.01 (24.00x)       100       0       0       0       0    65                                                                      
        Core 2 [2]:       2394.00 (24.00x)       100       0       0       0       0    74                                                                      
        Core 3 [4]:       2462.43 (24.69x)       100       0       0       0       0    71                                                                      
        Core 4 [6]:       2462.52 (24.69x)      99.9       0       0       0       0    61        
...

Thanks in advance for the answers.

Best Answer

That's not a bug, it's a feature! Check your temperatures, the only reason the CPU speed is decreased is because you're overheating. Look at the first output you show, you have one of your cores running at 92°C! That's pretty hot to begin with and it probably went even higher before your clock speed was reduced.

You can check the maximum temperature your CPU can deal with by running sensors. For example, for my Intel i7:

$ sensors
coretemp-isa-0000
Adapter: ISA adapter
Core 0:       +77.0°C  (high = +95.0°C, crit = +105.0°C)
Core 2:       +79.0°C  (high = +95.0°C, crit = +105.0°C)

So, on my machine, 95.0°C is considered high and 105°C is the critical temperature at which the machine will be shut down. Your specs might be a little different but 92.0°C is definitely high.

Now, you can force your CPU to keep the same clock speed. This is controlled by the CPU governor. You probably have it set to ondemand, but the following options are available:

  • Performance keeps the CPU at the highest possible frequency
  • Powersave keeps the CPU at the lowest possible frequency
  • Userspace exports the available frequency information to the user level (through the /sys file system) and permits user-space control of the CPU frequency
  • Ondemand scales the CPU frequencies according to the CPU usage (like does the userspace frequency scaling daemons, but in kernel)
  • Conservative acts like the ondemand but increases frequency step by step

To change your governor to, for example, "Performance", run this:

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

However, the likely result will simply be that your computer will shutdown when the high temperatures are reached. It might also still scale it down, I'm not sure how the safety features are implemented. In any case, the main point is that you don't want to do this because it can seriously harm your hardware.

There are very good reasons why your computer won't let you go past certain temperatures and you don't want to screw with that. I don't know of any way to actually disable the temperature limit and I wouldn't tell you if I did. There are easier ways, but disabling the temperature safety limits is certainly a good way to destroy your computer.

Related Question