Automatic CPU speed & power optimizer for Linux
Automatic CPU speed & power optimizer for Linux
Automatic CPU speed & power optimizer for Linux. Actively monitors laptop battery state, CPU usage, CPU temperature, and system load, ultimately allowing you to improve battery life without making any compromises.
For tl;dr folks:
= v2.0)" />
Example of auto-cpufreq --stats CLI output
One of the problems with Linux today on laptops is that the CPU will run in an unoptimized manner which will negatively impact battery life. For example, the CPU may run using the "performance" governor with turbo boost enabled regardless of whether it's plugged into a power outlet or not.
These issues can be mitigated by using tools like indicator-cpufreq or cpufreq, but those still require manual action from your side which can be daunting and cumbersome.
Tools like TLP (which I used for numerous years) can help extend battery life, but may also create their own set of problems, such as losing turbo boost.
Given all of the above, I needed a simple tool that would automatically make CPU frequency-related changes and save battery life, but let the 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, so after you install auto-cpufreq it's recommended to remove TLP. Using both for the same functionality (i.e., to set CPU frequencies) will lead to unwanted results like overheating. Hence, only use both tools in tandem if you know what you're doing.
One tool/daemon that does not conflict with auto-cpufreq in any way, and is even recommended to have running alongside, is thermald.
Only devices with an Intel, AMD, or ARM CPU are supported. This tool was developed to improve performance and battery life on laptops, but running it on desktops/servers (to lower power consumption) should also be possible.
As auto-cpufreq relies on git based versioning, users are advised to install
auto-cpufrequsinggit clonemethod only. Downloading source code as a zip/from release will emit build error like these.
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
Please note: while all auto-cpufreq >= v2.0 CLI functionality will work as intended, the GUI won't be available on Snap package installs due to Snap package confinement limitations. Hence, please consider installing auto-cpufreq using auto-cpufreq-installer.
auto-cpufreq is available on the Snap Store or via CLI:
sudo snap install auto-cpufreq
Please note:
Make sure snapd is installed and snap version is >= 2.44 for auto-cpufreq to fully work due to recent snapd changes.
Fedora users will encounter the following error due to cgroups v2 being in development. This problem can be resolved by either running sudo snap run auto-cpufreq after the snap installation or by using the auto-cpufreq-installer which doesn't have this issue.
The AUR Release Package is currently being maintained by MusicalArtist12, liljaylj, and parmjotsinghrobot.
Notices
/usr/share/ instead of /usr/local/share/# systemctl enable --now auto-cpufreq
sudo systemctl mask power-profiles-daemon.service (then enable and start the auto-cpufreq.service if you haven't already).New versions of auto-cpufreq were recently added to GURU, Gentoo's official community-maintained ebuild repository. The ebuild is maintaned by S41G0N and other GURU contributors, who can respond in case of issues.
In order to build auto-cpufreq, it is necessary to add & sync GURU repository first. Adding ~amd64 keyword is also needed to unmask the package.
# echo "sys-power/auto-cpufreq ~amd64" >> /etc/portage/package.accept_keywords
# eselect repository enable guru
# emaint sync -r guru
# emerge --ask auto-cpufreq
Notices
/usr/share/ instead of /usr/local/share/# systemctl enable --now auto-cpufreq
# rc-update add auto-cpufreq default && rc-service auto-cpufreq start
This repo contains a flake that exposes a NixOS Module that manages and offers options for auto-cpufreq. To use it, add the flake as an input to your flake.nix file and enable the module:
# flake.nix
{
inputs = {
# ---Snip---
auto-cpufreq = {
url = "github:AdnanHodzic/auto-cpufreq";
inputs.nixpkgs.follows = "nixpkgs";
};
# ---Snip---
}
outputs = {nixpkgs, auto-cpufreq, ...} @ inputs: {
nixosConfigurations.HOSTNAME = nixpkgs.lib.nixosSystem {
specialArgs = { inherit inputs; };
modules = [
./configuration.nix
auto-cpufreq.nixosModules.default
];
};
}
}
Then you can enable the program in your configuration.nix file:
# configuration.nix
{inputs, pkgs, ...}: {
# ---Snip---
programs.auto-cpufreq.enable = true;
# optionally, you can
No open issues yet, or sync has not completed.