43

I recently purchased a laptop with a sandy bridge CPU that is supposed to have turbo boost. Is turbo boost supported in 11.04? How can I tell if it's working?

I tried this but it seems to only detect Nehalem CPUs.

muru
  • 207,228
gregghz
  • 2,130

7 Answers7

37

11.04 runs the 2.6.38 kernel which is supposed to work well with Sandy Bridge CPUs.

You can open a terminal and run grep MHz /proc/cpuinfo. Then open a second terminal tab and run a loop like while :; do :; done. In the first terminal, run grep MHz /proc/cpuinfo again. You should see one of the cores has a higher frequency now:

$ grep MHz /proc/cpuinfo 
cpu MHz         : 1600.000
cpu MHz         : 1600.000
cpu MHz         : 1600.000
cpu MHz         : 1600.000
cpu MHz         : 1600.000
cpu MHz         : 3701.000
cpu MHz         : 1600.000
cpu MHz         : 1600.000

You can also try powertop and turbostat from the linux-tools-common package (run sudo modprobe msr before sudo turbostat). The Git version of i7z is supposed to work for Sandy Bridge (and it works for me with a desktop i7).

yorch
  • 3,510
elmicha
  • 9,960
19

Use sudo turbostat for this. The output of cat /proc/cpuinfo does not always show the real current CPU frequency but instead the maximum non-turbo frequency even when Turbo Boost is enabled and active.

As stated in elmicha's answer, you'll need to load the msr module with sudo modprobe msr and then run turbostat with sudo turbostat.

17

Accepted top voted answer doesn't always work

As the second top voted answer pointed out, the top voted and accepted answer sometimes shows the maximum regular frequency.

Alternate CLI methods

Below you can see frequencies for CPU Number 0. To see all CPU's replace 0 with *. The frequency is expressed in MHz with three decimal places. So 1000000 = 1000 MHz = 1 GHz. This Intel Skylake processor is rated to 2.6 GHz or 3.5 GHz with Turbo Boost enabled.

Minimum frequency 800 MHz

$ cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq
800000

Maximum frequency 3500 MHz (3.5 GHz)

$ cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq
3500000

Current frequency 1027.669 MHz (1.028 GHz)

$ cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_cur_freq
1027669

CPU 0 to 7 Frequency when YouTube loads up

$ cat /sys/devices/system/cpu/cpu*/cpufreq/scaling_cur_freq
2754249
2700098
2842167
2700270
1359287
901937
1662780
1731062

4 out of 8 processors are in turbo mode (above 2.6 GHz)

CPU 0 to 7 Frequency when YouTube paused

$ cat /sys/devices/system/cpu/cpu*/cpufreq/scaling_cur_freq
808913
800029
800022
800004
800001
800001
800013
800009

All processors are at minimum speed of 800 MHz even though Chrome is running on two screens with 11 tabs open but YouTube paused.

Is Intel Turbo Boost enabled?

Using the terminal you can check if Turbo Boost feature is enabled:

$ cat /sys/devices/system/cpu/intel_pstate/no_turbo
0

This is a double negative; when "no turbo" is off (=0) then Turbo Boost is on.

To disable Turbo Boost use sudo powers and set the switch no_turbo to 1:

$ echo "1" | sudo tee /sys/devices/system/cpu/intel_pstate/no_turbo
1

The returned 1 indicates turbo is now off.


Alternate GUI method using Conky

Other answers mention alternate methods to the basic CLI (Command Line Interface). I like to use Conky to do this. In the example below the Skylake CPU has a regular frequency from 800 MHz to 2600 Mhz. With turbo boost enabled the frequency can jump to 3500 MHz under heavy load.

The .gif sample below starts out by showing frequency fluctuating around 3100 MHz under heavy load when grep is running on the whole file system. Then the command is issued:

$ echo "1" | sudo tee /sys/devices/system/cpu/intel_pstate/no_turbo

...to shut off turbo boost. Speed drops to fixed speed of 2600 MHz which is the regular maximum speed without turbo.

Then the turbo command is reversed:

$ echo "0" | sudo tee /sys/devices/system/cpu/intel_pstate/no_turbo

...to turn turbo back on and speed jumps above 2600 MHz and fluctuates around 3100 to 3200 MHz again.

Toggle turbo boost

Notice how quickly temperature jumps 10 degrees when Turbo is turned on

7

You can see the working of turbo boost in ubuntu in real-time using htop.

  1. Install htop:

    sudo apt install htop
    
  2. Open it by running htop in the terminal. You will see a graphical window in the terminal.

  3. Click Setup with the mouse or press F2.

  4. Click on the Display options and enable Also show CPU frequency:

    htop display options

  5. Click Done or press F10 to save the settings.

Now you can see the turbo boost is working by looking at the real-time CPU frequency. In the following screenshot, for example, the base speed of my i5 processor is 2.5GHz, but you can see the turbo boost is kicking in and giving more than 3GHz.

example screenshot showing turbo boost

In addition, htop can display how much percentage of the core is used along with the temperature as well and htop displays the statistics more graphically in the terminal window itself. The advantage of using htop over other tools mentioned in this question, we can see which process is taking more resources in terms of CPU used and memory used. Users can kill the process if they want to.

Krishnaap
  • 171
  • 1
  • 4
7

To install turbostat you need to run:

$ sudo apt-get install linux-tools-common linux-tools-generic

(apparently I lack reputation to add this as a comment to @david-gardner post)

dimril
  • 171
5

For me everything was set properly so none of the answers were applicable. After wasting a couple of days I found out that my CPU governor was set to powersave and would never go above the base frequency. Had to switch it to performance

Here is how to fix it

sudo cpupower frequency-set -g performance

You will need to install cpupower first

sudo apt-get install linux-tools-common linux-tools-generic
4

cpupower is a collection of tools to examine and tune power saving related features of your processor. cpupower frequency-info can help to get the required info.

Sample output:

# cpupower frequency-info
analyzing CPU 0:
  driver: intel_pstate
  ...
  ...
  current CPU frequency is 2.80 GHz (asserted by call to hardware).
  boost state support:
    Supported: yes
    Active: yes
    3000 MHz max turbo 4 active cores
    3000 MHz max turbo 3 active cores
    3100 MHz max turbo 2 active cores
    3100 MHz max turbo 1 active cores

boost state - active confirms what you looking for.

Man page: https://linux.die.net/man/1/cpupower

PS: I know its an old thread but thought this answer is appropriate here and can help someone.

Cyril
  • 141