Does Fedora Linux Run Hot or Seem to Consume a Lot of Battery Power?
Here is a guide how to tweak your fedora OS to run smoother and maximize the battery life for you laptop or desktop without sacrificing performance.
The following tips will help many Fedora users running x86; and other architectures with a slight programming adjustment; please walk through all the steps below to fulfill necessary adjustments.
If you have any third party battery programs, power modifiers, or any other battery tweaking daemon(s) they will usually conflict so for this tutorial to work, id suggest to stick with:
How to install Power Profiles?
sudo dnf install power-profiles-daemon
After you install the Power Profiles, lets runs a command to enable at it boot (below).
sudo systemctl enable power-profiles-daemon
After you have reverted or installed power profiles lets move on to some of the other source(s) most consumers have issues with like, overheating or battery drainage.
How to install Powertop?
sudo dnf install powertop
Incase you haven’t installed or used Powertop, to simplify things you can use autotune (below) after you have installed it, powertop is almost a most, you can disable extra processes utilized by the system that are able to be stopped.
Or you can run powertop after installed, and navigate to the “tunable” tab and select/deselect the processes tunable recommends to tune.
Pay attention to a service with USB in it, if you have a wired mouse and use it to game, you may want to leave this enabled. It will pause the electricity to the mouse (put it to sleep) and will have a split second delay to wake it back up — I disable it; the delay shows me that powertop is still enabled when I switch users or just installed major updates and might forget about it.
sudo dnf --auto-tune
Note: if you are going to use autotune, the process takes some time, and has important steps on how to start and finish, such as; having enough battery and not use it while it is running; please read the man pages or follow the link above to dig into more options.
Recommend | Xybercraft ™
How to install Thermld?
To further you tweaks with heating concerns you can install thermld, this is another daemon that can run on its own.
Thermal daemon looks for thermal sensors and thermal cooling drivers in the Linux thermal sysfs (/sys/class/thermal) the linux daemon activates various cooling methods to try to cool the system.
sudo dnf install thermald
After you install it enable it:
sudo systemctl enable thermld
Check out the man pages for exclusive control settings and non daemon provision(s), I just leave it alone, and let it do its thing, you can further tweak your settings for you system.
How to set CPU Frequency on Fedora?
First make sure you have the following commands installed to properly configure your system CPU correctly, they are:
sudo dnf install kernel-tools
sudo dnf install cpupowerutils
Let those download and update (if you haven’t) they are both vital to adjusting your CPU frequency and kernel settings.
Now lets set your frequency.
sudo cpupower frequency-set -g conservative
Note: there are more than “conservative” options to choose from, such as ondemand, schedutil, powersave, etc., I personally use conservative because a simple mouse movement or opening a notepad doesn't burst the voltage up in the CPU; the “conservative” link contains more official detailed information on each kernel setting to tailor your preference.
Incase you are interested on learning more about performance scaling.
Recommend | Xybercraft ™
How to Monitor CPU Power on Fedora?
You can almost skip this step, but checking never hurts anything — after you have set your desired power frequency, you should run a quick measurement to determine wether or not temporarily disabling pstate and turbo to monitor the difference in battery discharge shows a noticeable difference.
Run these two following commands to check the output performance on your CPUs.
You will see your processors Max and Min MHz available with the first command (below).
lscpu | grep MH
With the second command (below) you can see how each core is being utilized, take a screenshot or a quick note on the outputs.
grep MH /proc/cpuinfo
Pay attention to the maximum MH; if you see a great number of your processors closer to the Max MH, (throttled) then you are on the right track to reducing those problems; lets continue through these next few steps below.
How to Enable Passive “Pstate” on Fedora?
To help stabilize the power consumptions (Max MH) run the following command which will reduce the pstate usage throughout your operating system.
sudo sh -c "echo ‘passive’ >> /sys/devices/system/cpu/intel_pstate/status"
After you run this command (above) you can check back with the previous step and confirm with your last results.
Setting the pstate to passive (above) allows it to spin up on demand instead of throttling constantly, disabling turbo boost (below) is more for battery over power users, and honestly if you have a newer processor you may not tell a difference if its off, for AMD users please follow the link on amd_pstate_epp and amd_pstate information.
This and disabling turbo command (below) will revert after reboot unless you create a startup #!/bin/sh or modify your editor to allow permanent changes which you can decide how to go about for yourself.
I manually add them to a note and enable the “execute as program” option to manually run them on each startup also.
I recommend enabling “passive” pstate permanently for both laptop and desktop users — it will not affect performance or cause stability issues.
Recommend | Xybercraft ™
How to Disable Turbo Boost on Fedora?
sudo sh -c "echo ‘1’ >> /sys/devices/system/cpu/intel_pstate/no_turbo"
As mentioned (above) this will revert after reboot unless you create a startup #!/bin/sh or modify your editor to allow permanent changes which you can decide how to go about that for yourself, and or needs.
You can save the command(s) to a note and enable the “execute as program” option to manually run them on each startup.
How to Park a CPU Core on Fedora Linux?
If you are desperate for more battery you can even park a core… or 10; just remember more cores usually equals less on the overall processes needed, meaning that to less of cores will use the same amount of MHz in equivalency for the desired output, the command below will park a core of your choice with a simple edit.
sudo echo 0 | sudo tee /sys/device/system/cpu/cpu#/online
Change the # to the CPU and repeat as desired, to change the core back to the “on state” edit the command with 0 to 1 to enable. Note*: “cpu0”* will not change its status, it is a mandatory CPU; anything after it can be disabled; you can even set a note by repeating the command in separate lines to disable cores in a sequence to manually execute them prior to each startup like this:
sudo echo 0 | sudo tee /sys/device/system/cpu/cpu1/online
sudo echo 0 | sudo tee /sys/device/system/cpu/cpu2/online
sudo echo 0 | sudo tee /sys/device/system/cpu/cpu3/online
To fully maximize you power wattage such as powertop and thermld for now.
I hope these tips bring you the expectations desired and consider continuing your #TeamFedora journey.
Summary
If your hardware supports Speed Shift or SmartShift and Speed Step, test out what you like, I keep them enabled; they will be located in your BIOS/UEFI. Alongside Turbo Boost, and your systems Power Configuration for additional tweaking.
If you are having install issues or have come across broken links (in the future) use the keywords above with your “device brand” or “hardware” such as processor (INTEL, AMD, ARM, RISCV) and/or “operating system”.
#HowTo, #Fedora, #Linux, #Redhat,
Recommend | Xybercraft ™