Automatic CPU speed & power optimizer for Linux based on active monitoring of 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
One of the problems with Linux today on laptops is that CPU will run in unoptimized manner which will negatively reflect on battery life. For example, CPU will run using "performance" governor with turbo boost enabled regardless if it's plugged in to power or not.
Issue 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 will help in this situation with extending battery life (which is something I did for numerous years now), 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: this tool doesn't conflict and works great in tandem with TLP.
Supported devices must have an Intel, AMD or ARM CPU's. 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.
- 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)
auto-cpufreq is available on snap store, or can be installed using CLI:
sudo snap install auto-cpufreq
Please note:
-
Make sure snapd is installed and
snap version
version is >= 2.44 forauto-cpufreq
to fully work due to recent snapd changes. -
Fedora users will encounter following error. Due to
cgroups v2
being in development. This problem can be resolved by either runningsudo snap run auto-cpufreq
after snap installation. Or using auto-cpufreq-installer which doesn't have this issue.
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
In case you encounter any problems with auto-cpufreq-installer
, please submit a bug report.
AUR package is available for install. After which auto-cpufreq
will be available as a binary and you can refer to auto-cpufreq modes and options.
Please note: If you want to install auto-cpufreq daemon, do not run auto-cpufreq --install
otherwise you'll run into an issue: #91, #96.
Instead run systemctl start auto-cpufreq
to start the service. Run systemctl status auto-cpufreq
to see the status of service, and systemctl enable auto-cpufreq
for service to persist running accross reboots.
auto-cpufreq can be run by simply running the auto-cpufreq
and following on screen instructions, i.e:
sudo auto-cpufreq
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.
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.
Necessary changes are made to the system for auto-cpufreq CPU optimizaton to persist across reboots. Daemon is deployed and then started as a systemd service. Changes are made automatically and live stats are generated for monitoring purposes.
sudo auto-cpufreq --install
After 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 install has been performed as part of snap package, daemon status can be verified by running:
systemctl status snap.auto-cpufreq.service.service
auto-cpufreq daemon and its systemd service, along with all its persistent changes can be removed by running:
sudo auto-cpufreq --remove
If daemon has been installed, live stats of CPU/system load monitoring and optimization can be seen by running:
auto-cpufreq --stats
Since I'm working on this project in free time, please consider supporting this project by making a donation of any amount!
bc1qlncmgdjyqy8pe4gad4k2s6xtyr8f2r3ehrnl87