Automatic CPU speed & power optimizer for Linux
Go to file
shadeyg56 0925b5d542
Gtk Application for auto-cpufreq (#486)
* Squashed commit of the following:

commit ec7e087b343f33af7a92b190ed666845dab60f20
Merge: 32b6e63 9912f9d
Author: shadeyg56 <31134255+shadeyg56@users.noreply.github.com>
Date:   Mon Feb 13 14:11:21 2023 -0600

    Merge branch 'AdnanHodzic:master' into gui

commit 32b6e632830fe8a7c3a3ce601ef2ba5b254572d7
Author: shadeyg56 <shadeyg56@gmail.com>
Date:   Mon Feb 13 14:10:34 2023 -0600

    increase MenuButton size

commit 12a2cda82a5f56bfbb532c893d822341e9b2d7cb
Author: shadeyg56 <shadeyg56@gmail.com>
Date:   Sun Feb 12 23:35:33 2023 -0600

    set app icon

commit d170d07e866644bcb662bf342530c497390f0303
Author: shadeyg56 <shadeyg56@gmail.com>
Date:   Sun Feb 12 23:35:15 2023 -0600

    remove unused pixbuf

commit 993333fb5aad448103e24e38bc85fb04e7e4dd0c
Author: shadeyg56 <shadeyg56@gmail.com>
Date:   Sun Feb 12 22:43:56 2023 -0600

    fix MenuButton icon

commit d1b8bd74caab2cf216bf40bdfc35ef3520e891c7
Author: shadeyg56 <shadeyg56@gmail.com>
Date:   Sun Feb 12 17:19:32 2023 -0600

    add icon

commit 13f43fa0c7d59b2405bac688119690d01a7ec019
Author: shadeyg56 <shadeyg56@gmail.com>
Date:   Sun Feb 12 17:19:10 2023 -0600

    add pkexec policy and change wrapper for gui

commit 4ddbb9c6667aa97bb7cd242fb4a376e061c9b308
Author: shadeyg56 <shadeyg56@gmail.com>
Date:   Sun Feb 12 14:09:35 2023 -0600

    add icon to destop entry and about dialog

commit 9912f9d809
Author: Siddharth Kumar Jha <101443068+siddharthkumarjha@users.noreply.github.com>
Date:   Sun Feb 12 12:55:14 2023 +0530

    Update Readme for issue of auto-cpufreq not autostarting on AUR  (#485)

    * Updated Readme for issue auto-cpufreq not autostarting

    Added solution to issue https://github.com/AdnanHodzic/auto-cpufreq/issues/463

    * Fixed minor errors

    * Fixed auto-cpufreq.serivce Typo

    * Reprashed text as per suggestion

commit 4379024adab282fcdb58a7091df2a6adf833e700
Author: shadeyg56 <shadeyg56@gmail.com>
Date:   Tue Feb 7 19:06:59 2023 -0600

    add removal of gui and desktop entry

commit 42693703324762418a7f810f04a3d77803afa236
Author: shadeyg56 <shadeyg56@gmail.com>
Date:   Mon Feb 6 23:28:44 2023 -0600

    CPU stats refresh and style stuff

commit 7149db72c0bb39af57ceccb16df8e9164c77fae3
Author: shadeyg56 <shadeyg56@gmail.com>
Date:   Mon Feb 6 23:10:29 2023 -0600

    daemon detection, daemon install/removal, and layout stuff

commit f7e03c9bcc2e2578703807ceeb7a652903571b71
Author: shadeyg56 <shadeyg56@gmail.com>
Date:   Sun Feb 5 19:26:42 2023 -0600

    improve AboutDialog

    Please enter the commit message for your changes. Lines starting

commit cb8cfe7b3194273dea229fe550fdf66cd6af82fa
Author: shadeyg56 <shadeyg56@gmail.com>
Date:   Sun Feb 5 18:28:19 2023 -0600

    add dropdown menu and (not completed) about dialog

commit ade1fed790f2ebbaae4e92ce8879ab812c9b2850
Author: shadeyg56 <shadeyg56@gmail.com>
Date:   Sun Feb 5 15:57:17 2023 -0600

    actually fix css

commit 67c8c97bcf2f2f408431bc162c38dee5c278ed0b
Author: shadeyg56 <shadeyg56@gmail.com>
Date:   Sun Feb 5 15:54:47 2023 -0600

    fix css

commit c65eac3472
Author: Adnan Hodzic <adnan@hodzic.org>
Date:   Sun Feb 5 09:29:19 2023 +0100

    Update readme, install psutil lib for power_helper

commit bd3feae38824764155d31ccd6debc1fcf18830da
Author: shadeyg56 <shadeyg56@gmail.com>
Date:   Sun Feb 5 00:42:52 2023 -0600

    add desktop entry for gui

commit 5426a6a443c90a9d65b858ae1951219898cba332
Author: shadeyg56 <shadeyg56@gmail.com>
Date:   Sun Feb 5 00:33:08 2023 -0600

    add gui to install file, update required packages, and create wrapper script

commit 84124dfa605b930b3722ed852486cbe11c254092
Author: shadeyg56 <shadeyg56@gmail.com>
Date:   Sat Feb 4 23:28:24 2023 -0600

    create system tray

commit 7b0d46d8ddafdeff9006a1ad10ccd99c24b9eb1e
Author: shadeyg56 <shadeyg56@gmail.com>
Date:   Sat Feb 4 23:28:01 2023 -0600

    small changes to layout

commit cd51ea317085ac6ea5b4918ef057ad4c19a71640
Author: shadeyg56 <shadeyg56@gmail.com>
Date:   Sat Feb 4 00:44:08 2023 -0600

    css styling support

commit 136b449febece04c036b72b4a14ccceb422f62dd
Author: shadeyg56 <shadeyg56@gmail.com>
Date:   Sat Feb 4 00:14:52 2023 -0600

    several improvements

commit f9f7170391e1abc1499b7d5ae93327999e013730
Merge: 242a8d0 8f343df
Author: shadeyg56 <31134255+shadeyg56@users.noreply.github.com>
Date:   Fri Feb 3 22:44:01 2023 -0600

    Merge branch 'AdnanHodzic:master' into gui

commit 8f343df8b8
Merge: dadfae0 b38919f
Author: shadeyg56 <31134255+shadeyg56@users.noreply.github.com>
Date:   Fri Feb 3 14:54:11 2023 -0600

    Merge pull request #481 from shadeyg56/master

    Fix uncaught error in checking for snap

commit b38919f56b
Author: shadeyg56 <shadeyg56@gmail.com>
Date:   Fri Feb 3 14:48:01 2023 -0600

    fix uncaught error in checking for snap

commit 242a8d0401d1ffd00c982aa731c04ef7ea726fee
Merge: f50b982 dadfae0
Author: shadeyg56 <31134255+shadeyg56@users.noreply.github.com>
Date:   Fri Feb 3 14:19:01 2023 -0600

    Merge branch 'AdnanHodzic:master' into gui

commit dadfae087f
Author: Adnan Hodzic <adnan@hodzic.org>
Date:   Fri Feb 3 20:02:03 2023 +0100

    Update README with  new config options

commit 471611de7d
Author: Adnan Hodzic <adnan@hodzic.org>
Date:   Fri Feb 3 18:44:33 2023 +0100

    Remove GNOME Power Profiles Daemon performance install

commit f574257dc4
Author: Adnan Hodzic <adnan@hodzic.org>
Date:   Fri Feb 3 18:32:04 2023 +0100

    Remove install_performance flag

commit 04b878360c
Author: Adnan Hodzic <adnan@hodzic.org>
Date:   Fri Feb 3 17:52:20 2023 +0100

    Snap tag 2.0-beta + governor_override improvements

commit fe21ddf245
Author: Adnan Hodzic <adnan@hodzic.org>
Date:   Fri Feb 3 17:28:12 2023 +0100

    Working governor override on Snap package

commit f50b9829e5438bb96ded73775668fa048fcd3951
Merge: a98225e 69ef913
Author: shadeyg56 <31134255+shadeyg56@users.noreply.github.com>
Date:   Thu Feb 2 18:19:10 2023 -0600

    Merge branch 'AdnanHodzic:master' into gui

commit a98225e7280802c2fb09a9a52a40f7e55b26b3b1
Author: shadeyg56 <shadeyg56@gmail.com>
Date:   Thu Feb 2 18:18:43 2023 -0600

    Revert "basic GUI"

    This reverts commit d2610c921b7209fde7d7be13f187510631cc33b3.

commit 9606472fdbbff6dd551cd291b37349df17098d2e
Author: shadeyg56 <shadeyg56@gmail.com>
Date:   Thu Feb 2 18:13:41 2023 -0600

    basic gui

commit d2610c921b7209fde7d7be13f187510631cc33b3
Author: shadeyg56 <shadeyg56@gmail.com>
Date:   Thu Feb 2 17:47:55 2023 -0600

    basic GUI

commit bdbe12018b380ed70f100729c9ea3732ba24f572
Author: shadeyg56 <shadeyg56@gmail.com>
Date:   Thu Feb 2 15:21:42 2023 -0600

    rename folder

commit 31095c472e4af734a3a601f804787de89ad47964
Author: shadeyg56 <shadeyg56@gmail.com>
Date:   Wed Jan 25 23:39:52 2023 -0600

    add tray

* Squashed commit of the following:

commit e2eaffc32b382f67f97d2e25858b5b5a4abffeae
Author: shadeyg56 <shadeyg56@gmail.com>
Date:   Mon Feb 20 23:08:57 2023 -0600

    move text to be inline with menu

commit e1dae9d9de25f13c51dd983f5b4b0fbdf1bf0349
Author: shadeyg56 <shadeyg56@gmail.com>
Date:   Sun Feb 19 17:50:26 2023 -0600

    move distro info to top of system stats box

commit 959405bedc52dce14f5fd70d2fcd5fbee57e59a5
Author: shadeyg56 <shadeyg56@gmail.com>
Date:   Sun Feb 19 17:49:15 2023 -0600

    fix app name on GNOME

commit 346093dfce6ce0bfa1954ed3bb6f5364250d05b7
Author: shadeyg56 <shadeyg56@gmail.com>
Date:   Sun Feb 19 17:01:03 2023 -0600

    fix snap dependencies

commit ec7e087b343f33af7a92b190ed666845dab60f20
Merge: 32b6e63 9912f9d
Author: shadeyg56 <31134255+shadeyg56@users.noreply.github.com>
Date:   Mon Feb 13 14:11:21 2023 -0600

    Merge branch 'AdnanHodzic:master' into gui

commit 32b6e632830fe8a7c3a3ce601ef2ba5b254572d7
Author: shadeyg56 <shadeyg56@gmail.com>
Date:   Mon Feb 13 14:10:34 2023 -0600

    increase MenuButton size

commit 12a2cda82a5f56bfbb532c893d822341e9b2d7cb
Author: shadeyg56 <shadeyg56@gmail.com>
Date:   Sun Feb 12 23:35:33 2023 -0600

    set app icon

commit d170d07e866644bcb662bf342530c497390f0303
Author: shadeyg56 <shadeyg56@gmail.com>
Date:   Sun Feb 12 23:35:15 2023 -0600

    remove unused pixbuf

commit 993333fb5aad448103e24e38bc85fb04e7e4dd0c
Author: shadeyg56 <shadeyg56@gmail.com>
Date:   Sun Feb 12 22:43:56 2023 -0600

    fix MenuButton icon

commit d1b8bd74caab2cf216bf40bdfc35ef3520e891c7
Author: shadeyg56 <shadeyg56@gmail.com>
Date:   Sun Feb 12 17:19:32 2023 -0600

    add icon

commit 13f43fa0c7d59b2405bac688119690d01a7ec019
Author: shadeyg56 <shadeyg56@gmail.com>
Date:   Sun Feb 12 17:19:10 2023 -0600

    add pkexec policy and change wrapper for gui

commit 4ddbb9c6667aa97bb7cd242fb4a376e061c9b308
Author: shadeyg56 <shadeyg56@gmail.com>
Date:   Sun Feb 12 14:09:35 2023 -0600

    add icon to destop entry and about dialog

commit 4379024adab282fcdb58a7091df2a6adf833e700
Author: shadeyg56 <shadeyg56@gmail.com>
Date:   Tue Feb 7 19:06:59 2023 -0600

    add removal of gui and desktop entry

commit 42693703324762418a7f810f04a3d77803afa236
Author: shadeyg56 <shadeyg56@gmail.com>
Date:   Mon Feb 6 23:28:44 2023 -0600

    CPU stats refresh and style stuff

commit 7149db72c0bb39af57ceccb16df8e9164c77fae3
Author: shadeyg56 <shadeyg56@gmail.com>
Date:   Mon Feb 6 23:10:29 2023 -0600

    daemon detection, daemon install/removal, and layout stuff

commit f7e03c9bcc2e2578703807ceeb7a652903571b71
Author: shadeyg56 <shadeyg56@gmail.com>
Date:   Sun Feb 5 19:26:42 2023 -0600

    improve AboutDialog

    Please enter the commit message for your changes. Lines starting

commit cb8cfe7b3194273dea229fe550fdf66cd6af82fa
Author: shadeyg56 <shadeyg56@gmail.com>
Date:   Sun Feb 5 18:28:19 2023 -0600

    add dropdown menu and (not completed) about dialog

commit ade1fed790f2ebbaae4e92ce8879ab812c9b2850
Author: shadeyg56 <shadeyg56@gmail.com>
Date:   Sun Feb 5 15:57:17 2023 -0600

    actually fix css

commit 67c8c97bcf2f2f408431bc162c38dee5c278ed0b
Author: shadeyg56 <shadeyg56@gmail.com>
Date:   Sun Feb 5 15:54:47 2023 -0600

    fix css

commit bd3feae38824764155d31ccd6debc1fcf18830da
Author: shadeyg56 <shadeyg56@gmail.com>
Date:   Sun Feb 5 00:42:52 2023 -0600

    add desktop entry for gui

commit 5426a6a443c90a9d65b858ae1951219898cba332
Author: shadeyg56 <shadeyg56@gmail.com>
Date:   Sun Feb 5 00:33:08 2023 -0600

    add gui to install file, update required packages, and create wrapper script

commit 84124dfa605b930b3722ed852486cbe11c254092
Author: shadeyg56 <shadeyg56@gmail.com>
Date:   Sat Feb 4 23:28:24 2023 -0600

    create system tray

commit 7b0d46d8ddafdeff9006a1ad10ccd99c24b9eb1e
Author: shadeyg56 <shadeyg56@gmail.com>
Date:   Sat Feb 4 23:28:01 2023 -0600

    small changes to layout

commit cd51ea317085ac6ea5b4918ef057ad4c19a71640
Author: shadeyg56 <shadeyg56@gmail.com>
Date:   Sat Feb 4 00:44:08 2023 -0600

    css styling support

commit 136b449febece04c036b72b4a14ccceb422f62dd
Author: shadeyg56 <shadeyg56@gmail.com>
Date:   Sat Feb 4 00:14:52 2023 -0600

    several improvements

commit f9f7170391e1abc1499b7d5ae93327999e013730
Merge: 242a8d0 8f343df
Author: shadeyg56 <31134255+shadeyg56@users.noreply.github.com>
Date:   Fri Feb 3 22:44:01 2023 -0600

    Merge branch 'AdnanHodzic:master' into gui

commit 242a8d0401d1ffd00c982aa731c04ef7ea726fee
Merge: f50b982 dadfae0
Author: shadeyg56 <31134255+shadeyg56@users.noreply.github.com>
Date:   Fri Feb 3 14:19:01 2023 -0600

    Merge branch 'AdnanHodzic:master' into gui

commit f50b9829e5438bb96ded73775668fa048fcd3951
Merge: a98225e 69ef913
Author: shadeyg56 <31134255+shadeyg56@users.noreply.github.com>
Date:   Thu Feb 2 18:19:10 2023 -0600

    Merge branch 'AdnanHodzic:master' into gui

commit a98225e7280802c2fb09a9a52a40f7e55b26b3b1
Author: shadeyg56 <shadeyg56@gmail.com>
Date:   Thu Feb 2 18:18:43 2023 -0600

    Revert "basic GUI"

    This reverts commit d2610c921b7209fde7d7be13f187510631cc33b3.

commit 9606472fdbbff6dd551cd291b37349df17098d2e
Author: shadeyg56 <shadeyg56@gmail.com>
Date:   Thu Feb 2 18:13:41 2023 -0600

    basic gui

commit d2610c921b7209fde7d7be13f187510631cc33b3
Author: shadeyg56 <shadeyg56@gmail.com>
Date:   Thu Feb 2 17:47:55 2023 -0600

    basic GUI

commit bdbe12018b380ed70f100729c9ea3732ba24f572
Author: shadeyg56 <shadeyg56@gmail.com>
Date:   Thu Feb 2 15:21:42 2023 -0600

    rename folder

commit 31095c472e4af734a3a601f804787de89ad47964
Author: shadeyg56 <shadeyg56@gmail.com>
Date:   Wed Jan 25 23:39:52 2023 -0600

    add tray

* fix undefined var

* app no longer needs root to start, only asks when needed

* fix wmclass

* create file in /bin for gui

* fix bug with radio buttons and pkexec

* snap: update snap to package GTK gui

* update setup.py

* requirements.txt: fix conflict

* Merge master into dev

* gui: fix pkexec on launch
2023-08-15 17:58:16 +02:00
.github Fix typo in issue template 2022-10-03 20:40:54 +02:00
auto_cpufreq Gtk Application for auto-cpufreq (#486) 2023-08-15 17:58:16 +02:00
bin Gtk Application for auto-cpufreq (#486) 2023-08-15 17:58:16 +02:00
images Gtk Application for auto-cpufreq (#486) 2023-08-15 17:58:16 +02:00
scripts Gtk Application for auto-cpufreq (#486) 2023-08-15 17:58:16 +02:00
snap Gtk Application for auto-cpufreq (#486) 2023-08-15 17:58:16 +02:00
.gitignore Improve domain language around logging and stats (#160) 2021-02-02 21:40:55 +01:00
LICENSE Initial commit 2019-12-29 21:39:57 +01:00
README.md Update --update section of README.md 2023-07-15 22:30:53 +02:00
auto-cpufreq-installer Gtk Application for auto-cpufreq (#486) 2023-08-15 17:58:16 +02:00
auto-cpufreq.conf-example Add min/max allowed frequencies option (#309) (#324) 2021-12-26 11:01:32 +01:00
requirements.txt Gtk Application for auto-cpufreq (#486) 2023-08-15 17:58:16 +02:00
setup.py Gtk Application for auto-cpufreq (#486) 2023-08-15 17:58:16 +02:00

README.md

auto-cpufreq

Automatic CPU speed & power optimizer for, Linux based on active monitoring of a laptop's battery state, CPU usage, CPU temperature and system load. Ultimately allowing you to improve battery life without making any compromises.

For tl;dr folks there's a: Youtube: auto-cpufreq - tool demo

Looking for developers and co-maintainers

auto-cpufreq is looking for co-maintainers & open source developers to help shape future of the project!

Index

Why do I need auto-cpufreq?

One of the problems with Linux today on laptops is that the CPU will run in an unoptimized manner which will negatively reflect on battery life. For example, the CPU will run using "performance" governor with turbo boost enabled regardless if it's plugged in to power or not.

These issues can be mitigated by using tools like indicator-cpufreq or cpufreq, but these still require manual action from your side which can be daunting and cumbersome.

Using tools like TLP can help in this situation with extending battery life (which is something I used to do for numerous years), but it also might come with its own set of problems, like losing turbo boost.

With that said, I needed a simple tool which would automatically make "cpufreq" related changes, save battery like TLP, but let Linux kernel do most of the heavy lifting. That's how auto-cpufreq was born.

Please note: auto-cpufreq aims to replace TLP in terms of functionality and after you install auto-cpufreq it's recommended to remove TLP. If both are used for same functionality, i.e: to set CPU frequencies it'll lead to unwanted results like overheating. Hence, only use both tools in tandem if you know what you're doing.

The Tool/daemon that does not conflict with auto-cpufreq in any way, and is even recommended to have running alongside, is thermald.

Supported architectures and devices

Supported devices must have an Intel, AMD or ARM CPUs. This tool was developed to improve performance and battery life on laptops, but running it on desktop/servers (to lower power consumption) should also be possible.

Features

  • Monitoring
    • Basic system information
    • CPU frequency (system total & per core)
    • CPU usage (system total & per core)
    • CPU temperature (total average & per core)
    • Battery state
    • System load
  • CPU frequency scaling, governor and turbo boost management based on
    • Battery state
    • CPU usage (total & per core)
    • CPU temperature in combination with CPU utilization/load (prevent overheating)
    • System load
  • Automatic CPU & power optimization (temporary and persistent)

Installing auto-cpufreq

Snap store

auto-cpufreq is available on the snap store, or can be installed using CLI:

sudo snap install auto-cpufreq

Please note:

auto-cpufreq-installer

Get source code, run installer and follow on screen instructions:

git clone https://github.com/AdnanHodzic/auto-cpufreq.git
cd auto-cpufreq && sudo ./auto-cpufreq-installer

Update using auto-cpufreq-installer

The feature is available from version 1.9.8. For further information: --update

In case you encounter any problems with auto-cpufreq-installer, please submit a bug report.

AUR package (Arch/Manjaro Linux)

AUR is currently unmaintained & has issues! Until someone starts maintaining it, use the auto-cpufreq-installer if you intend to have the latest changes as otherwise you'll run into errors, i.e: #471. However, if you still wish to use AUR then follow the Troubleshooting section for solved known issues.

Post Installation

After installation auto-cpufreq will be available as a binary and you can refer to auto-cpufreq modes and options for more information on how to run and configure auto-cpufreq.

Configuring auto-cpufreq

auto-cpufreq makes all decisions automatically based on various factors like cpu usage, temperature or system load. However, it's possible to perform additional configurations:

1: power_helper.py script (Snap package install only)

When installing auto-cpufreq using auto-cpufreq-installer if it detects GNOME Power profiles service is running it will automatically disable it. Otherwise this daemon will cause conflicts and various other performance issues.

However, when auto-cpufreq is installed as Snap package it's running as part of a container with limited permissions to your host machine, hence it's highly recommended you disable GNOME Power Profiles Daemon using power_helper.py script.

Please Note:
The power_helper.py script is located at auto_cpufreq/power_helper.py. In order to have access to it, you need to first clone the repository:

git clone https://github.com/AdnanHodzic/auto-cpufreq

Navigate to repo location where power_helper.py resides, i.e:

cd auto-cpufreq/auto_cpufreq

Make sure to have psutil Python library installed before next step, i.e: sudo python3 -m pip install psutil

Then disable GNOME Power Profiles Daemon by running:

sudo python3 power_helper.py --gnome_power_disable

2: --force governor override

By default auto-cpufreq uses balanced mode which works the best on various systems and situations.

However, you can override this behaviour by switching to performance or powersave mode manually. Performance will result in higher frequencies by default, but also results in higher energy use (battery consumption) and should be used if max performance is necessary. Otherwise powersave will do the opposite and extend the battery life to its maximum.

See --force flag for more info.

3: auto-cpufreq config file

You can configure separate profiles for the battery and power supply. These profiles will let you pick which governor to use, and how and when turbo boost is enabled. The possible values for turbo boost behavior are always, auto and never. The default behavior is auto, which only kicks in during high load.

By default, auto-cpufreq does not use the config file! If you wish to use it, the location where config needs to be placed for it to be read automatically is: /etc/auto-cpufreq.conf

Example config file contents

# settings for when connected to a power source
[charger]
# see available governors by running: cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_available_governors
# preferred governor.
governor = performance

# minimum cpu frequency (in kHz)
# example: for 800 MHz = 800000 kHz --> scaling_min_freq = 800000
# see conversion info: https://www.rapidtables.com/convert/frequency/mhz-to-hz.html
# to use this feature, uncomment the following line and set the value accordingly
# scaling_min_freq = 800000

# maximum cpu frequency (in kHz)
# example: for 1GHz = 1000 MHz = 1000000 kHz -> scaling_max_freq = 1000000
# see conversion info: https://www.rapidtables.com/convert/frequency/mhz-to-hz.html
# to use this feature, uncomment the following line and set the value accordingly
# scaling_max_freq = 1000000

# turbo boost setting. possible values: always, auto, never
turbo = auto

# settings for when using battery power
[battery]
# see available governors by running: cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_available_governors
# preferred governor
governor = powersave

# minimum cpu frequency (in kHz)
# example: for 800 MHz = 800000 kHz --> scaling_min_freq = 800000
# see conversion info: https://www.rapidtables.com/convert/frequency/mhz-to-hz.html
# to use this feature, uncomment the following line and set the value accordingly
# scaling_min_freq = 800000

# maximum cpu frequency (in kHz)
# see conversion info: https://www.rapidtables.com/convert/frequency/mhz-to-hz.html
# example: for 1GHz = 1000 MHz = 1000000 kHz -> scaling_max_freq = 1000000
# to use this feature, uncomment the following line and set the value accordingly
# scaling_max_freq = 1000000

# turbo boost setting. possible values: always, auto, never
turbo = auto

How to run auto-cpufreq

auto-cpufreq should be run with with one of the following options:

  • monitor

    • Monitor and see suggestions for CPU optimizations
  • live

    • Monitor and make (temp.) suggested CPU optimizations
  • install / remove

    • Install/remove daemon for (permanent) automatic CPU optimizations
  • update

    • Update auto-cpufreq to the latest release
  • install_performance

    • Install daemon in "performance" mode.
  • stats

    • View live stats of CPU optimizations made by daemon
  • force=TEXT

    • Force use of either the "powersave" or "performance" governor. Setting to "reset" goes back to normal mode
  • config=TEXT

    • Use config file at defined path
  • debug

    • Show debug info (include when submitting bugs)
  • version

    • Show currently installed version
  • donate

    • To support the project
  • help

    • Shows all of the above options

Running auto-cpufreq --help will print the same list of options as above. Read auto-cpufreq modes and options for more details.

auto-cpufreq modes and options

Monitor

sudo auto-cpufreq --monitor

No changes are made to the system, and is solely made for demonstration purposes what auto-cpufreq could do differently for your system.

Live

sudo auto-cpufreq --live

Necessary changes are temporarily made to the system which are lost with system reboot. This mode is made to evaluate what the system would behave with auto-cpufreq permanently running on the system.

Overriding governor

sudo auto-cpufreq --force=governor

Force use of either "powersave" or "performance" governors. Setting to "reset" will go back to normal mode Please note that any set override will persist even after reboot.

Install - auto-cpufreq daemon

Necessary changes are made to the system for auto-cpufreq CPU optimization to persist across reboots. The daemon is deployed and then started as a systemd service. Changes are made automatically and live stats are generated for monitoring purposes.

Install the daemon using this command (after installing auto-cpufreq):

sudo auto-cpufreq --install

This will enable the auto-cpufreq service (equivalent to systemctl enable auto-cpufreq) to start on boot, and start it (equivalent to systemctl start auto-cpufreq).

After the daemon is installed, auto-cpufreq is available as a binary and is running in the background. Its stats can be viewed by running: auto-cpufreq --stats

Since daemon is running as a systemd service, its status can be seen by running:

systemctl status auto-cpufreq

If the install has been performed as part of snap package, daemon status can be verified by running:

systemctl status snap.auto-cpufreq.service.service

Update - auto-cpufreq update

Update functionality works by cloning auto-cpufreq repo to /home directory of currently logged in user, installing it using auto-cpufreq-installer and performing auto-cpufreq daemon install with latest version changes.

Update the package by running: sudo auto-cpufreq --update

Remove - auto-cpufreq daemon

auto-cpufreq daemon and its systemd service, along with all its persistent changes can be removed by running:

sudo auto-cpufreq --remove

This does the equivalent of systemctl stop auto-cpufreq && systemctl disable auto-cpufreq.

Note that the given command should be used instead of using just systemctl.

Stats

If daemon has been installed, live stats of CPU/system load monitoring and optimization can be seen by running:

auto-cpufreq --stats

Troubleshooting

Q: If after installing auto-cpufreq you're (still) experiencing:

  • high CPU temperatures
  • CPU is not scaling to minimum/maximum frequencies
  • suboptimal CPU performance

A: If you're using intel_pstate/amd-pstate CPU management driver, consider changing it to acpi-cpufreq.

This can be done by editing the GRUB_CMDLINE_LINUX_DEFAULT params in /etc/default/grub. For instance:

    sudo nano /etc/default/grub
    # make sure you have nano installed, or you can use your favorite text editor.

For Intel users:

GRUB_CMDLINE_LINUX_DEFAULT="quiet splash intel_pstate=disable"

For AMD users:

GRUB_CMDLINE_LINUX_DEFAULT="quiet splash initcall_blacklist=amd_pstate_init amd_pstate.enable=0"

Once you have made the necessary changes to the GRUB configuration file, you can update it by running sudo update-grub or sudo grub-mkconfig -o /boot/grub/grub.cfg on Arch Linux. On the other hand, for Fedora, you can update the configuration file by running one of the following commands:

    sudo grub2-mkconfig -o /etc/grub2.cfg
    sudo grub2-mkconfig -o /etc/grub2-efi.cfg
    sudo grub2-mkconfig -o /boot/grub2/grub.cfg
    # Legacy boot method for grub update.

AUR

  • The command sudo auto-cpufreq --install produces error #471 please don't use it.
    • This script is supposed to automate the process of enabling auto-cpufreq.service so you need to manually open terminal and type
    sudo systemctl enable --now auto-cpufreq.service
    
    for the service to work.
  • Power Profiles Daemon is automatically disabled by auto-cpufreq-installer due to it's conflict with auto-cpufreq.service. However this doesn't happen with AUR package and will lead to problems (i.e: #463) if not masked manually.
    • So open your terminal and type
    sudo systemctl mask power-profiles-daemon.service
    
    Following this command enable the auto-cpufreq.service if you haven't already.

Discussion:

Donate

Showing your support and appreciation for auto-cpufreq project can be done in two ways:

  • Financial donation
  • Code contribution

Financial donation

If auto-cpufreq helped you out and you find it useful, show your appreciation by donating (any amount) to the project!

PayPal

paypal

BitCoin

bc1qlncmgdjyqy8pe4gad4k2s6xtyr8f2r3ehrnl87

bitcoin

Code contribution

Other ways of supporting the project consists of making a code or documentation contribution. If you have an idea for a new features or want to implement some of the existing feature requests or fix some of the bugs & issues please make your changes and submit a pull request which I'll be glad to review. If your changes are accepted you'll be credited as part of releases page.

Please note: auto-cpufreq is looking for co-maintainers & open source developers to help shape future of the project!