Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save serboox/4f2b8e5e7b07599940c3a265b543c538 to your computer and use it in GitHub Desktop.
Save serboox/4f2b8e5e7b07599940c3a265b543c538 to your computer and use it in GitHub Desktop.
Disable Intel Turbo Boost

Prerequisites

  • Intel processor

Installing

sudo apt-get install msr-tools linux-cpupower lm-sensors

OU

sudo apt-get install msr-tools linux-tools-common lm-sensors linux-tools-generic linux-cloud-tools-generic

Configuration

Follow the steps below:

  • Create directory
  • Create service file
  • Create service unit file
  • Set service

Create directory

sudo mkdir /opt/power-mode && cd $_

Create service file

  • Create the file and save it in /opt/power-mode/powersave-no-turbo-boost.sh
#!/bin/bash

cpupower frequency-set -g powersave
cpupower frequency-set -r -u 800MHz
wrmsr -a 0x1a0 0x4000850089
  • Set file permissions
sudo chmod +x /opt/power-mode/powersave-no-turbo-boost.sh

Create service unit file

  • Create the file and save it in "/opt/power-mode/powersave-no-turbo-boost.service"
[Unit]
Description=Power Mode Settings
After=acpid.socket
After=syslog.service

[Service]
User=root
Type=simple
ExecStart=/opt/power-mode/powersave-no-turbo-boost.sh
ExecStop=/opt/power-mode/powersave-no-turbo-boost.sh
TimeoutSec=30
StartLimitInterval=350

[Install]
WantedBy=multi-user.target

Service

Set power mode service with turbo boost disabled

cd /etc/systemd/system
sudo ln -s /opt/power-mode/powersave-no-turbo-boost.service powersave-no-turbo-boost.service
sudo chmod u+x /etc/systemd/system/powersave-no-turbo-boost.service
sudo systemctl enable powersave-no-turbo-boost

Check out

Check processor status

sudo reboot
sudo cpupower frequency-info

Output

analyzing CPU 0:
  driver: intel_pstate
  CPUs which run at the same hardware frequency: 0
  CPUs which need to have their frequency coordinated by software: 0
  maximum transition latency:  Cannot determine or is not supported.
  hardware limits: 800 MHz - 2.60 GHz
  available cpufreq governors: performance powersave
  current policy: frequency should be within 800 MHz and 800 MHz.
                  The governor "powersave" may decide which speed to use
                  within this range.
  current CPU frequency: Unable to call hardware
  current CPU frequency: 798 MHz (asserted by call to kernel)
  boost state support:
    Supported: no
    Active: no
    25500 MHz max turbo 4 active cores
    25500 MHz max turbo 3 active cores
    25500 MHz max turbo 2 active cores
    25500 MHz max turbo 1 active cores

Learn More

@serboox
Copy link
Author

serboox commented Nov 4, 2019

sudo cpupower --cpu all frequency-set --max 2.0GHz
sudo cpupower --cpu all frequency-info

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment