Site Tools


start:setcpuscalingnogui

This is an old revision of the document!


Roughly checked this on 14/09/2023. Seems to work (more testers needed) - Pete

Just really quick write up but worked like this:

Installed some relevant tools (check your kernel version some tools are different for later kernels):

sudo apt-get install cpufreq cpufrequtils 
sudo apt-get install linux-tools-common 
Maybe? sudo apt-get install linux-tools-5.15.0-27-generic
Maybe? sudo apt-get install linux-cpupower 
Depends on distro used what you have to install, bookworm I think is linux-cpupower... maybe?

For trixie I believe you just need cpufrequtils and linux-cpupower only.

decide on a governor

sudo cpupower frequency-info

passable options listed in that command such as conservative ondemand userspace powersave performance schedutil etc

eg: for powersave

cpupower frequency-set --governor powersave

To check if cpu is no longer scaling monitor your cpu:

watch "cat /proc/cpuinfo | grep MHz"

After reboot changes will be lost. To make a startup script one way is (another option shown elsewhere in this wiki is with systemd, just feel like showing you a second way):

Create script:

sudo nano /root/SetCPU.sh

In this file put this text:

#!/bin/bash
cpupower frequency-set --governor powersave

Obviously modify above to correct governor. Now to add script to reboot:

sudo crontab -e

Add this line into the crontab:

@reboot /root/SetCPU.sh

Finally make script executable:

sudo chmod +x /root/SetCPU.sh

Now test by rebooting and checking the CPU with watch command from earlier.

All done :)

start/setcpuscalingnogui.1694723461.txt.gz · Last modified: 2023/09/14 20:31 by peter