You are not logged in.
Hi,
I was trying to configure my netbook which as an atom to switch governors automatically depending on the current power profile in KDE.
The problem is i have to be root to switch governors and typing "cpufreq-set -g foo_governor" in the "script" textbox in the power profiles window doesn't works. Trying to put sudo before that but obviously it didn't work. I thought about using a script to do it but my scripting skills are few and i don't know how to grant root privileges from whitin a script.
How do you guys deal with this?
Last edited by tataraperz (2011-03-03 03:49:50)
Offline
Check out the KDE page and cpufreq page in the wiki... You'll have to remain root while changing governors. Unfortunately, the folks at KDE want to keep changing this. Granted, they're moving forward consstantly, but still... Bit of a pain. Use cpufreq and you should be good.
Offline
Solution :
Add Sudo to the Script file in question :
sudo cpufreq-set -c 0 -g $set
sudo cpufreq-set -c 1 -g $set
Then add the following line to the Sudoers file (visudo)(Replace %wheel with your username if thats what you did to get Sudo Access)
%wheel ALL = NOPASSWD /usr/bin/cpufreq-set
I guess you would run the script with the KDE power thing? or just do it manually if necessary
---
I personally did the same thing although I use a minimalistic openbox install so i manually change it when i need to.. I generally use the Powersave governor since I usually don't need the performance setting on my Laptop unless im messing with Gimp or something
Last edited by StarGater93 (2011-03-04 14:28:52)
Offline
thanks a lot it worked like a charm!
Offline
sudo cpufreq-set -r -g ondemand
placed in your xinit script, with the requisite &&'s or whatever, will change all cores to ondemand when initiating X. The option "-r" copies the command for every like-cpu, so for instance all eight cores in an i7 (4 physical 4 hyperthreaded) will be set to ondemand.
Team Ignition Kernel Developer
linux-ideapad developer/maintainer
Flame Kernel developer for Galaxy Nexus and Galaxy S3
Want a cheap, reliable VPS with AWESOME customer service?
Offline
sudo cpufreq-set -r -g ondemand
placed in your xinit script, with the requisite &&'s or whatever, will change all cores to ondemand when initiating X. The option "-r" copies the command for every like-cpu, so for instance all eight cores in an i7 (4 physical 4 hyperthreaded) will be set to ondemand.
For my AMD Phenom II X4, the "-r" option has no effect. cpufreq-set simply sets the governor for CPU 0 and leaves the rest unchanged. I'm not sure what cpufreq-set uses to determine what CPUs are related but it seems Phenom cores are not "related" as far as it's concerned. For me, the only option was to create a shell script to iterate through the processors (one cpufreq-set call per core).
I ended up doing something like:
for i in {0..3}; do
sudo /usr/bin/cpufreq-set -c${i} -gondemand
done
Offline