Is Turbo Boost Working?

72,224

Solution 1

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).

Solution 2

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.

Solution 3

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

Solution 4

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)

Solution 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
Share:
72,224

Related videos on Youtube

gregghz
Author by

gregghz

Scala Programmer.

Updated on September 18, 2022

Comments

  • gregghz
    gregghz over 1 year

    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.

  • gregghz
    gregghz almost 13 years
    Thanks for that. It appears that turbo boost is not working for me. I have the 8,1 macbook pro. and it maxes out at 2.7ghz which is the advertised base clock speed, while the turbo boost speed is advertised at 3.4ghz. I'll probably start a new question on this . . .
  • n3rd
    n3rd over 12 years
    I am somewhat confused: using your technique Turbo Boost does not seem to work. However if I use i7z script is tells me that Turbo Boost is enabled.
  • psusi
    psusi over 12 years
    @R3s3t, the 3701 really means 3700 with turbo boost enabled, to be activated at the discretion of the motherboard.
  • king_julien
    king_julien almost 11 years
    This is weird my processor hase a base clock speed of 1.8 GHz with turbo boost up to 2.6 GHz but I this only shows me 800MHZ to 1.8GHz. No wonder Ubuntu feels a bit laggy... :(
  • Run CMD
    Run CMD almost 10 years
    This answer appears to be only partially true. All the info in /proc/ and /sys/device/system/cpu/ is always limited to regular frequencies by design; see kernel.org/doc/Documentation/cpu-freq/boost.txt Also, the CPU Freq Mons rely on this information, so they will not show boosts. But turbostat and other tools will. Special care should be taken for AMD processors with integrated graphics, see askubuntu.com/a/501599/308343 @king_julien Your assumption is probably wrong.
  • muru
    muru over 7 years
    You can always suggest an edit to that answer.
  • muru
    muru over 6 years
    What part of the Conky gif shows turboboost?
  • WinEunuuchs2Unix
    WinEunuuchs2Unix over 6 years
    @muru I should fire up the old laptop and generate a new .gif under heavy load because on the Ivy Bridge CPU turbo engages after 2.4 GHz (2400 MHz). Anyway we assume the conky creator knows his processor speed min, max at non-turbo and turbo max. Then s/he can simply glance at the MHz readout to know if turbo is working or not.
  • muru
    muru over 6 years
    Yes, you should.
  • Mikhail T.
    Mikhail T. almost 6 years
    On my server running RHEL-6.6 there is no /sys/devices/system/cpu/intel_pstate/no_turbo. The CPUs are Xeon E5-2690, which should have the Boost technology... Is my kernel (2.6.32) too old?
  • WinEunuuchs2Unix
    WinEunuuchs2Unix almost 6 years
    @MikhailT. I'm not sure. I read your specs and it's based on Sandy Bridge which is second generation. My Ivy Bridge was third generation and definitely had the Turbo Boost setup as detailed above. My current laptop is sixth generation (Skylake) and adheres to directories above. Tthey've just released eighth generation (Coffee Lake I think) but haven't looked into that yet. At work we have REHL and one day it crashed to a shell prompt and I discovered the kernel version was 2.6.512 or something like that. I'm afraid I don't know enough to answer your question.
  • Ryan Jeremiah Freeman
    Ryan Jeremiah Freeman over 4 years
    Hi I've just run your script testing my own Turbo in 5.3.0-12 Intel 18c V4 chip, should turbo boost up to 3GHz but it's stuck at 22x multiplier. cpuf set max to 3000 and set min to 1200. Turbo was enabled but no change to frequency.
  • BeastOfCaerbannog
    BeastOfCaerbannog almost 3 years
    Note that the Also show CPU frequency option was added in htop version 3.0.0. For Ubuntu releases before 20.10, the version of htop in the default repositories is 2.x, so this setting isn't available.
  • Krishnaap
    Krishnaap almost 3 years
    @BeastOfCaerbannog Thanks for pointing out that. That is true I haven't seen this before. But new version is good.