Can't set vids by hand but phctools can.

If you run into trouble with PHCTool you can ask for help here.
Post Reply
andb
Posts: 4
Joined: Sun 15. Nov 2009, 19:41

Can't set vids by hand but phctools can.

Post by andb » Sat 17. Jul 2010, 08:03

I've used PHC successfully under Ubuntu 9.04 with my Thinkpad x200. I recently installed 10.04 and am unable to change the phc_default_vids manually. But when I run PHCtool, they get set. How does PHCtool set the vid values? Below is what I tried, I even added the owner write bit as a test. I also tried setting via /etc/sysfs.conf, which didn't work either.

Code: Select all

root@light:~/# cat  /sys/devices/system/cpu/cpu0/cpufreq/phc_default_vids 
43 35 23 17 
root@light:~/# echo "21 20 17 17" | sudo tee  /sys/devices/system/cpu/cpu0/cpufreq/phc_default_vids 
tee: /sys/devices/system/cpu/cpu0/cpufreq/phc_default_vids: Permission denied
21 20 17 17
[code]root@light:~/# cat  /sys/devices/system/cpu/cpu0/cpufreq/phc_default_vids 
43 35 23 17 
root@light:~/# chmod u+w  /sys/devices/system/cpu/cpu0/cpufreq/phc_default_vids 
root@light:~/# echo "21 20 17 17" | sudo tee  /sys/devices/system/cpu/cpu0/cpufreq/phc_default_vids
tee: /sys/devices/system/cpu/cpu0/cpufreq/phc_default_vids: Input/output error
[code]root@light:~/# cat  /sys/devices/system/cpu/cpu0/cpufreq/phc_default_vids 
43 35 23 17 
Any ideas what I can do differently (or how phctools does it) so I can get these values set at boot automatically?

EDIT: posted in phctools since it works with this software and someone who knows pchtool may have a good chance of solving. Feel free to move to PHC if appropriate.

User avatar
DavidG
Posts: 180
Joined: Fri 18. Jul 2008, 11:25
Contact:

Re: Can't set vids by hand but phctools can.

Post by DavidG » Sat 17. Jul 2010, 16:43

You cannot change the default values, they are only there for reference, e.g. for undoing:

Code: Select all

cat phc_default_vids|sudo tee phc_vids
The "phc_default_vids" isn't something you can set, they are hardcoded in either the processor, the ACPI definition and/or the BIOS.
A bank is a place where they lend you an umbrella in fair weather and ask for it back when it begins to rain -- R. Frost

andb
Posts: 4
Joined: Sun 15. Nov 2009, 19:41

Re: Can't set vids by hand but phctools can.

Post by andb » Sun 29. Aug 2010, 12:50

Yes, this was the issue. However, in Ubuntu 10.04, I've found that I can't set the values in sysfs.conf, it seems they are being overwritten with the defaults later. Instead of trying to figure out if there is a way around this, I simply made a script /etc/init.d/set-vids which I linked to /etc/rc.2/S99set-vids so that it gets called at the end of startup. Nothing complex, but in case it helps anyone else to see what I did, here it is.
  • Alter the for statement based on your number of cores
  • Alter the VIDS variable based on the voltage your processor will run at. (this assumes that all cores have same VID limits

Code: Select all

#! /bin/bash

VIDS="22 22 17 17"

for i in {0..1}
  do   
    FILE="/sys/devices/system/cpu/cpu$i/cpufreq/phc_vids"
    echo $VIDS > $FILE
    echo $FILE
    cat $FILE
  done
echo "VIDS set"

Post Reply