https://github.com/AdnanHodzic/auto-cpufreq Skip to content Sign up * Why GitHub? Features - + Mobile - + Actions - + Codespaces - + Packages - + Security - + Code review - + Issues - + Integrations - + GitHub Sponsors - + Customer stories- * Team * Enterprise * Explore + Explore GitHub - Learn and contribute + Topics - + Collections - + Trending - + Learning Lab - + Open source guides - Connect with others + The ReadME Project - + Events - + Community forum - + GitHub Education - + GitHub Stars program - * Marketplace * Pricing Plans - + Compare plans - + Contact Sales - + Education - [ ] * # In this repository All GitHub | Jump to | * No suggested jump to results * # In this repository All GitHub | Jump to | * # In this user All GitHub | Jump to | * # In this repository All GitHub | Jump to | Sign in Sign up {{ message }} AdnanHodzic / auto-cpufreq Public * Notifications * Star 1.9k * Fork 96 * Automatic CPU speed & power optimizer for Linux foolcontrol.org/?p=3124 LGPL-3.0 License 1.9k stars 96 forks Star Notifications * Code * Issues 30 * Pull requests 4 * Discussions * Actions * Projects 0 * Wiki * Security * Insights More * Code * Issues * Pull requests * Discussions * Actions * Projects * Wiki * Security * Insights master Switch branches/tags [ ] Branches Tags Could not load branches Nothing to show {{ refName }} default View all branches Could not load tags Nothing to show {{ refName }} default View all tags 20 branches 27 tags Code Latest commit @AdnanHodzic AdnanHodzic v1.7.1 snap package release ... 893ed43 Oct 17, 2021 v1.7.1 snap package release 893ed43 Git stats * 244 commits Files Permalink Failed to load latest commit information. Type Name Latest commit message Commit time .github implemented --debug option (#70) Aug 5, 2020 auto_cpufreq daemon running msg was wrong (#262) Oct 17, 2021 bin daemon running msg was wrong (#262) Oct 17, 2021 scripts Code refactor (improved readability) of auto-cpufreq-installer (#238) Sep 19, 2021 snap v1.7.1 snap package release Oct 17, 2021 .gitignore Improve domain language around logging and stats (#160) Feb 2, 2021 LICENSE Initial commit Dec 29, 2019 README.md Update README Oct 16, 2021 auto-cpufreq-installer Revert "install service file to proper location; enable and start ser... Oct 17, 2021 auto-cpufreq.conf-example Add config file for preferred governor and turbo boost behaviour. (# 250) Oct 10, 2021 requirements.txt removed unused power lib Aug 14, 2020 setup.py Improved Python file structure (rename source > auto_cpufreq) #153 Jan 21, 2021 View code [ ] auto-cpufreq Why do I need auto-cpufreq? Supported architectures and devices Features Installing auto-cpufreq Snap store auto-cpufreq-installer AUR package (Arch/Manjaro Linux) Configuring auto-cpufreq Example config contents How to run auto-cpufreq auto-cpufreq modes and options Monitor Live Install - auto-cpufreq daemon Remove - auto-cpufreq daemon Stats Troubleshooting Discussion: Donate Financial donation PayPal BitCoin Code contribution README.md auto-cpufreq 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 [687474703a] Why do I need auto-cpufreq? 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: auto-cpufreq aims to replace TLP and after you install auto-cpufreq it's recommended to remove TLP. However, if for some reason you still need/want TLP installed and running auto-cpufreq doesn't conflict and works great in tandem with TLP. Supported architectures and devices 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. 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 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 for auto-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 running sudo snap run auto-cpufreq after snap installation. Or using auto-cpufreq-installer which doesn't have this issue. 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 In case you encounter any problems with auto-cpufreq-installer, please submit a bug report. AUR package (Arch/Manjaro Linux) 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. Configuring auto-cpufreq You can configure profiles for 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. Default location where config needs to be placed for it to be read automatically: /etc/auto-cpufreq.conf Example config 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 # 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 # turbo boost setting. possible values: always, auto, never turbo = auto How to run auto-cpufreq auto-cpufreq can be run by simply running the auto-cpufreq and following on screen instructions, i.e: sudo auto-cpufreq 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. Install - auto-cpufreq daemon 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 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 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 peformance A: If you're using intel_pstate CPU management driver consider changing it to: acpi-cpufreq. This can be done by editting /etc/default/grub file and appending intel_pstate=disable to GRUB_CMDLINE_LINUX_DEFAULT line, followed by sudo update-grub Example line change: GRUB_CMDLINE_LINUX_DEFAULT="quiet splash intel_pstate=disable" Discussion: * Blogpost: auto-cpufreq - Automatic CPU speed & power optimizer for Linux 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. About Automatic CPU speed & power optimizer for Linux foolcontrol.org/?p=3124 Topics linux cli frequency cpu monitor battery monitoring tool daemon boost management speed power automatic turbo laptop governor Resources Readme License LGPL-3.0 License Releases 27 v1.7.1 Latest Oct 17, 2021 + 26 releases Packages 0 No packages published Contributors 31 * @AdnanHodzic * @Red-Eyed * @validatedev * @aroundthfur * @marc0der * @yochananmarqos * @vivel * @rrodriguez81 * @asperan * @Haptein * @marc-vdm + 20 contributors Languages * Python 65.7% * Shell 34.3% * (c) 2021 GitHub, Inc. * Terms * Privacy * Security * Status * Docs * Contact GitHub * Pricing * API * Training * Blog * About You can't perform that action at this time. You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.