NoCache

Table of Contents

Set CPU Governor/Frequency using cpupower on Linux

Cyrus Kao
Last modified on .

Need more CPU power? Set your governor to performance. Wanna save money on utility bills? Then powersave it is. Changing CPU governor and frequency can be easily done on Linux by using cpupower. And it supports both AMD and Intel CPUs, using native modules like intel_pstate and acpi-cpufreq for best optimization.

Installation

Install cpupower through the package manager depending on the distro you're running:

  • Debian/Ubuntu

    $ sudo apt install linux-tools-common
    
  • Arch Linux/Manjaro

    $ yay -S cpupower
    

    Don't know how to install packages on Arch based Linux? A full guide on Two Ways to Install Packages from AUR on Arch Linux/Manjaro.

  • Fedora/CentOS 8+/RHEL 8+

    $ sudo dnf install kernel-tools
    
  • CentOS/RHEL

    $ sudo yum install cpupowerutils
    

GUI

Alternatively, there is a GUI (Graphical User Interface) tool build on top of cpupower called cpupower-gui. Feel free to use it if you're more comfortable with GUI.

cpupower-gui
Interface of cpupower-gui

Set Governor

The following are some commonly used governors:

Governor Description
performance Maximum performance.
powersave Minimum frequency possible.
ondemand Scales the frequency dynamically.
conservative Same as ondemand, but scale more gradually.

Intel CPU should use either performance or powersave since it's specially optimized by the intel_pstate driver.

Set your governor to what suits you:

$ sudo cpupower frequency-set --governor performance

Set Fixed Frequency

It's normally advised against setting CPU frequency to a fixed value, but if you know what you're doing:

  • Setting frequency to maximum of 3GHz and minimum of 1GHz

    $ sudo cpupower frequency-set --max 3GHz --min 1GHz
    
  • Lock frequency to 2GHz:

    $ sudo cpupower frequency-set --freq 2GHz
    

Verify Your Settings

Use frequency-info to see the details of your CPU driver and current frequency settings:

$ cpupower frequency-info
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 - 3.70 GHz
  available cpufreq governors: performance powersave
  current policy: frequency should be within 800 MHz and 3.70 GHz.
                  The governor "performance" may decide which speed to use
                  within this range.
  current CPU frequency: Unable to call hardware
  current CPU frequency: 3.55 GHz (asserted by call to kernel)
  boost state support:
    Supported: yes
    Active: yes
Output

See Also

Comments

Sign in to leave a comment.