Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I'd like to set the CPU frequency scaling governor for all cores at once instead of doing it individually for each core. Is there a way to do this?

(I know it would be easy to echo the governor to /sys/devices/system/cpu/cpu*/cpufreq/scaling_governor, but I'm not looking for a custom solution.)

share|improve this question
1  
With "custom solution" you mean that a shell script is unacceptable, it needs to be a built-in GUI button? –  j-g-faustus Jan 6 '11 at 16:09
    
I'm just wondering if there already exists a solution in a standard installation (doesn't need to have a GUI). –  htorque Jan 6 '11 at 16:20
    
Check this page: idebian.wordpress.com/2008/06/22/cpu-frequency-scaling-in-linux under "debian implementation": It is apparently possible to change the boot default, and there is a userspace tool called powernowd. (This is a comment rather than reply because the post is from 2008, and I haven't tested if it still works...) –  j-g-faustus Jan 6 '11 at 22:47

3 Answers 3

I'm still a linux noob but don't you think cpufrequtils lets u do it by using (its not bundled in the Ubuntu OS but is there in the repository)

sudo apt-get install cpufrequtils
cpufreq-set -r -g performance #-r for related (all) the cores
share|improve this answer
1  
@htorque What prevents you from installing the cpufrequtils package? –  Marco Mar 6 '12 at 15:42
    
The -r related option doesn't do it for all the cores. We have to specify the cpu number with option -c <number> however this script will do it for all cpus in one go: for ((i=0;i<$(nproc);i++)); do cpufreq-set -c $i -r -g performance; done –  Sri Sep 11 at 9:50
up vote 5 down vote accepted

I googled a lot and I think it's just not possible, so I added the following one-liner to my .bashrc:

function setgov ()
{
    echo "$1" | sudo tee /sys/devices/system/cpu/cpu*/cpufreq/scaling_governor 
}

Now I can run something like setgov ondemand and all cores will switch to the ondemand governor.

share|improve this answer
    
This doesn't work as the file scaling_governor is owned by root and has restricted permissions. Changing the permissions is not always recommended. –  Sri Sep 11 at 9:16
    
Please see alternative script in my comment to user49449's answer. –  Sri Sep 11 at 9:53

Check out Jupiter:

https://launchpad.net/~webupd8team/+archive/jupiter

It's a power mgmt daemon that runs in the background and will govern your cores on-demand.

http://www.webupd8.org/2010/07/jupiter-ubuntu-ppa-hardware-and-power.html

share|improve this answer
    
jupiter has been discontinued. –  Volker Siegel Jul 9 at 0:25

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.