Last active
September 8, 2020 08:49
-
-
Save xsnpdngv/1bb42e315f42f1b0276a2fb5f53f0ff1 to your computer and use it in GitHub Desktop.
Set CPU governor to powersave on Ubuntu
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
sudo apt-get install cpufrequtils | |
echo 'GOVERNOR="powersave"' | sudo tee /etc/defaults/cpufrequtils | |
sudo /etc/init.d/cpufrequtils restart | |
cpufreq-info |
Error at the path...
Correct: /etc/default/cpufrequtils (default, without 's')
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
To add indicator/setter GUI
In order to literally set CPU frequency userspace governor is required which is not available by default.
Your system is using
intel_pstate
driver. There are only two governors available when using this driver:powersave
andperformance
.The userspace governor is only available with the older
acpi-cpufreq
driver (which will be automatically used if you disableintel_pstate
at boot time; you then set thegovernor/frequency
withcpupower
):disable the current driver: add
intel_pstate=disable
to your kernel boot lineboot, then load the userspace module:
modprobe cpufreq_userspace
set the governor:
cpupower frequency-set --governor userspace
set the frequency:
cpupower --cpu all frequency-set --freq 800MHz
To temporarily add a boot parameter to a kernel:
Start your system and wait for the GRUB menu to show (if you don't see a GRUB menu, press and hold the left
Shift
key right after starting the system). Now highlight the kernel you want to use, and press the e key. You should be able to see and edit the commands associated with the highlighted kernel. Go down to the line starting with linux and add your parameter e.g.,intel_pstate=disable
to its end.Now press
Ctrl + x
orF10
to boot.To make this change permanent:
sudo vi /etc/default/grub
Find the line starting with
GRUB_CMDLINE_LINUX_DEFAULT
and append e.g.,intel_pstate=disable
to its end. For example:GRUB_CMDLINE_LINUX_DEFAULT="quiet splash intel_pstate=disable"
Finally, start a terminal and run:
sudo update-grub
to update GRUB's configuration file.
On the next reboot, the kernel should be started with the boot parameter. To permanently remove it, simply remove the parameter from
GRUB_CMDLINE_LINUX_DEFAULT
and runsudo update-grub
again.To verify your changes, you can see exactly what parameters your kernel booted with by executing
cat /proc/cmdline
.Wiki Page