Pages

Wednesday, May 30, 2012

CPU Undervolting with Ubuntu 12.04


Hi guys,

PHC stands for Processor Hardware Control and, as it's easy to understand, it allows users to customize some features of CPU control in a linux environment, as undervolting.


So what do we need? An Ubuntu (or Debian) box, usually undervolting is useful on laptops: it enhance battery duration and reduces the heat production. You will also need some time and patience, ;]
  1. You will need a kernel patch and a particular CPU driver so that the hardware control will be possible. First let's add the repo:
    sudo add-apt-repository ppa:linux-phc/ppa
    sudo add-apt-repository ppa:linux-phc/testing
    sudo apt-get update
  2. Now let's install the kernel and its headers:
    sudo apt-get install linux-generic-phc linux-headers-generic-phc
    First pause... restart your PC and be sure to choose your new *-phc kernel.
  3. As we will need to compile some stuff some Ubuntu users might need
    sudo apt-get install gtk2-engines-pixbuf python-gtk2-dev  build-essential
    And then:
    sudo apt-get install dkms debhelper
    Before doing anything else we have to create an empty file to match dmks autoconfiguration: Intel users go with the first, AMD with the second line!
    sudo sh -c 'echo >> /etc/modprobe.d/phc-intel.conf'
    sudo sh -c 'echo >> /etc/modprobe.d/phc-k8.conf'
  4. Now you have to download the driver, choose it looking at your CPU: there are two choices AMD and Intel, be sure to take the right one.
  5. Unpack the package to a temporary folder. Open a terminal and move there:
    cd **your_path**
    Intel users can generate a debian package:
    make dkms_mkdeb
    And install the resulting .deb package:
    sudo dpkg -i phc-intel-dkms_0.3.2_all.deb
    While AMD can't generate it, so:
    sudo make dkms_install 
    Now you have your driver ready to go!
  6. So we will unload the old driver:
    sudo modprobe -r acpi-cpufreq
    Once you're done load the new one, amd users will have the second line, intel the first!
    sudo modprobe phc-intel
    sudo modprobe phc-k8
    If you experience the error: "FATAL: Module acpi_cpufreq is in use." you'll need to:
    sudo sh -c ' echo "\n#blackist required to load phc drivers
    blacklist acpi_cpufreq
    blacklist cpufreq_stats" > /etc/modprobe.d/blacklist.conf'
    sudo sh -c ' echo "modprobe ##your module##" > /etc/modules'
    And REBOOT =_= ...
  7. Now I guess you want a cool GUI to easier setting VIDs: get it here. Unpack it to a non temporary folder and move there.
  8. From the main phctool folder run:
    sudo ./install.sh
  9. Follow the instruction (both yes will be OK)
  10. Create a new program link in the menu with "Main Menu" to the command /**your_path**/pchtool.sh
  11. Be sure to create a startup entry with the command
    /**your_path**/phctray.sh
    So voltages will be restored at each startup! 
After this installation procedure try to launch phctool from the main menu: there you can set the voltages and see many infos about your CPU. If it happens that you can't refresh the actual values install msr-tools and run it with:
sudo apt-get install msr-tools
sudo modprobe msr
The correct undervolted values are not universal, so you'll need some testing. If you think you'll need a guide, then take a look here:

http://linuxsolver.blogspot.com/2011/10/how-to-set-cpu-voltage.html


Cheers!

114 comments:

  1. thanks for the tutorial before
    I've managed to implement phctool and want to try undervolting, to apply and save the settings, whether to reboot the laptop or not?

    could you please explain the meaning of some of the sensors below?

    acpitz-virtual-0 [meaning what?]
    Adapter: Virtual device [meaning what?]
    Temp1: 65.0 ° C (crit = 120.0 ° C) [meaning what?]
    temp2: 64.0 ° C (crit = 120.0 ° C) [mean what?]

    coretemp-isa-0000 [what does it mean?]
    Adapter: ISA adapter [meaning what?]
    Core 0: 79.0 ° C (high = 100.0 ° C, crit = 100.0 ° C) [meaning what?]

    coretemp-isa-0001 [what does it mean?]
    Adapter: ISA adapter [meaning what?]
    Core 1: 79.0 ° C (high = 100.0 ° C, crit = 100.0 ° C) [meaning what?]

    ReplyDelete
    Replies
    1. Hi,

      values are saved and restored at each boot by phctool. Don't worry about that.

      Wow... sensors are not always easy to understand indeed

      coretemp-isa-0000 [sensor name]
      Adapter: ISA adapter [type of sensing device]
      Core 0: 79.0 ° C (high = 100.0 ° C, crit = 100.0 ° C) [Actual sensor: temp (max temp, critical temp))]

      in your setup the first is the "acpi thermal zone" maybe motherboard or graphic card sensors, the other are the cores

      ^_^

      Delete
    2. thanks for the reply :)

      if I wanted to make a permanent setting value on phctools, how?
      because I wanted to test the power consumption using a power quality analyzer.


      I am still confused about the "acpitz-virtual-0 Adapter: Virtual device", can you give more info?
      btw what is shown on Temp1 n 2 ..

      thanks in advance ^ ^

      Delete
    3. "Temp1: 65.0 ° C (crit = 120.0 ° C) [meaning what?]
      temp2: 64.0 ° C (crit = 120.0 ° C) [mean what?]"
      Temp1 is one core temperature or video card temperature or core temperature but mishure in other plase or other metod.
      Temp2 is also can be other core temperature and so on...
      Crit =120 ° C means, that then temperature rich 120 ° C you computer turn off to protect processor from it damage.

      Delete
  2. PHCtool not working for me. Would be nice to know how to access these settings directly so that I can add entries in rc.local or init.d

    ReplyDelete
    Replies
    1. If you give me more details we'll fix it...

      Delete
  3. I get the following error trying to launch phctool.sh on a thinkpad T60 running linux mint 13 after following your instructions :

    Traceback (most recent call last):
    File "./phctool.py", line 468, in
    app=appgui()
    File "./phctool.py", line 102, in __init__
    self.ShowPHCVIDs() ##display current VIDs
    File "./phctool.py", line 283, in ShowPHCVIDs
    columns = self.data[cpu]['frequencies'] ##define the amount of columns we'll use to display all data
    KeyError: 'frequencies'

    ReplyDelete
    Replies
    1. I get the same message that you do. Any workarounds yet?

      Delete
    2. I'm working on it, I'll give you a feedback as soon as it's fixed

      Cheers

      Delete
    3. I guess they moved the frequencies storing file. Can you please paste the output of:

      ls /sys/devices/system/cpu/cpu0/
      ls /sys/devices/system/cpu/cpu0/cpufreq/
      sudo cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_available_frequencies

      Delete
    4. cache cpuidle crash_notes thermal_throttle topology

      ls: cannot access /sys/devices/system/cpu/cpu0/cpufreq/: No such file or directory

      cat: /sys/devices/system/cpu/cpu0/cpufreq/scaling_available_frequencies: No such file or directory

      Using Linux Mint 13

      Delete
  4. $ls /sys/devices/system/cpu/cpu0/
    cache cpuidle crash_notes topology

    ReplyDelete
    Replies
    1. mmm ok, you might not have the driver loaded. Try:

      sudo lsmod | grep phc

      if no output then:

      sudo modprobe phc-intel (or phc-k8)

      if it issues an error paste it here

      Delete
  5. None of those 2 commands give me any output (my laptop is intel).

    ReplyDelete
    Replies
    1. Please keep replying to the same comment. Ok I suppose you to know these commands, but i'll explain them. The first checks if you have loaded any phc driver, so in your case phc-intel, the second loads the driver. If the problem is solved and the second command did not give any output error the driver now should be loaded (please check with lsmod...) and the bug solved. If you need further infos (or of course if it still does not work) feel free to ask.

      Cheers ^_^

      Delete
    2. that was it and phctool now works, but ir doesn't seem to change any voltages. however that's another story and I'll take a look at that later

      Delete
  6. I'm pretty clueless when it comes to this stuff and I'm just following your directions. I _think_ I've loaded the new modules, and I am able to open phctool. However, under the Voltages tab, everything is just blank and I don't seem to be able to edit anything anywhere. Any idea where I went wrong?

    Thanks for this great guide!

    ReplyDelete
    Replies
    1. That's a problem indeed.. what's your cpu? can you paste the output of:

      sudo lsmod | grep phc

      ? Thanks!

      Cheers

      Delete
  7. When I noticed that the PHCTool didnt start, I had to look up (with lsmod) to check if the phc module was actually loaded - it wasn't. I loaded it and got the GUI of PHCTool started right away!

    ReplyDelete
  8. I could install phctool and got it to run once, but upon trying to relaunch it, it crashes with the following error:
    ./phctool.sh
    app=appgui()
    File "./phctool.py", line 100, in __init__
    self.phcdata.RestoreValues() ##restore VIDs from last session
    File "inc/libs/generic.py", line 55, in RestoreValues
    self.parent.throttling.set_throttledata_array(throttles)
    File "inc/libs/throttling.py", line 77, in set_throttledata_array
    self.set_throttledata(cpu, array[cpu])
    File "inc/libs/throttling.py", line 69, in set_throttledata
    if int(value) >= 0 and int(value)< self.data[cpu]["state_count"]:
    ValueError: invalid literal for int() with base 10: ''

    When it was running it showed only CPU 0 and CPU 7 and all of the voltage values were N/A, but it was running.

    Output of sudo lsmod | grep phc:
    phc_intel 18321 1
    mperf 12667 1 phc_intel

    Any help would be much appreciated.

    ReplyDelete
    Replies
    1. Sorry, it looks like an interface problem, I'll try to fix it as soon as I can.

      Cheers

      Delete
    2. Thanks. Let me know when a fix is ready and I'm happy to test it. Theron

      Delete
    3. Can you please give me some more informations about your cpu?

      I need also the outputs of:

      sudo cat /sys/devices/system/cpu/online
      sudo ls /sys/devices/system/cpu/cpu*

      Thanks

      Regards

      Delete
    4. I have fixed the bug (I guess). To try the fixed phctool take these two steps:

      cd to your phctool folder,

      rm phctool/inc/libs/cpuinfo.pyc

      download the lib again as in step 8

      launch phctool


      Regards

      Delete
  9. In step 6 i get this error:

    $ sudo modprobe phc-intel
    FATAL: Error inserting phc_intel (/lib/modules/3.2.0-25-generic-phc/updates/dkms/phc-intel.ko): Invalid argument

    here's my lsmod listing:
    $ lsmod
    Module Size Used by
    vesafb 13844 1
    mperf 12667 0
    cpufreq_stats 13364 0
    serio_raw 13211 0
    tg3 152032 0
    mei 41616 0
    ext2 73795 1
    mac_hid 13253 0
    coretemp 13525 0

    ReplyDelete
    Replies
    1. What does this give back

      ls /lib/modules/3.2.0-25-generic-phc/updates/dkms/phc-intel.ko

      Have you tried the blacklist procedure?

      Delete
    2. $ ls /lib/modules/3.2.0-25-generic-phc/updates/dkms/phc-intel.ko
      /lib/modules/3.2.0-25-generic-phc/updates/dkms/phc-intel.ko

      yes i tried the blacklist method. No change in error.


      Isn't is weird that the error states: "Invalid argument"?

      Delete
    3. i have the same error but with amd, will you be able to help me out?

      i have amd c50 processor on this tablet.

      error details are:

      4.4 $ sudo make dmks_install
      [sudo] password for xpert:
      make: *** No rule to make target `dmks_install'. Stop.


      and

      4.4 $ sudo modprobe phc-k8FATAL: Error inserting phc_k8 (/lib/modules/3.2.0-25-generic-phc/updates/kernel/arch/x86/kernel/cpu/cpufreq/phc-k8.ko): Device or resource busy

      Delete
  10. hi
    in step 6 when i write "sudo modprobe -r acpi-cpufreq" i get this eror:

    FATAL: Module cpufreq_stats is builtin
    FATAL: Error running remove command for acpi_cpufreq
    can u help me?

    ReplyDelete
    Replies
    1. I guess you are running the wrong kernel.. try to check the output of

      sudo uname -a

      If it has no -phc suffix please take a look at step 2

      Cheers

      Delete
    2. Hi Fabio, Where/how do I select the -phc kernel?

      Delete
  11. Hi. I've followed the guide and it all seems to work ok apart from the PHCTOOL is only showing my CPU0 and CPU3, not the other CPU1 and CPU2, and its only showing 8 of the 10 voltages. I put screenshot here http://s334.photobucket.com/albums/m421/NigelHealy/?action=view&current=phc.jpg

    ReplyDelete
    Replies
    1. I guess it's the same bug Theron complained about. I've just fixed it (I guess). Please paste the output of:

      sudo cat /sys/devices/system/cpu/online
      sudo ls /sys/devices/system/cpu/cpu*

      To try the fixed phctool take these two steps:

      cd to your phctool folder, rm /inc/libs/cpuinfo.pyc

      download the lib again as in step 8

      Any feedback would be appreciated ^_^

      Regards

      Delete
  12. Is your command syntax correct for this section, two >> needed? Doesn't match you saying need to create empty files which should be a single > ?

    "Before doing anything else we have to create an empty file to match dmks autoconfiguration: Intel users go with the first, AMD with the second line!
    sudo sh -c 'echo >> /etc/modprobe.d/phc-intel.conf'
    sudo sh -c 'echo >> /etc/modprobe.d/phc-k8.conf'"

    ReplyDelete
    Replies
    1. It's the same but I guess the single > is correct. I'll update it

      Thanks

      Delete
  13. I wanted to set undervolted values for my CPU cores but how can achieve that with PHCtool? I get a "Voltages" tab where there is no enough width to fit all the frequencies (my CPU ranges from 2667 to 1199 but PHCtool only shows down to 1866).

    Plus, I can not fix a max CPU from here.

    So basically PHCtool is useless for me.

    Plus, suspend does not work (cpu goes 100%, fan goes 100%, heat goes 100%, and does not recover). Which has nothing to do with your article, but whining feels good... and I'll add that Linux/Ubuntu laptop power efficiency fucking sucks 360º and I swear to God I'd use another OS if it wasn't because they all suck their own way.

    ReplyDelete
    Replies
    1. Haters gonna hate...
      If you need help, why not ask?

      If you care please, tell me at least your CPU model. Maybe we can find a solution to your problems, or I'll suggest weather to file a bug to phc forum or not.

      Delete
    2. It looks your cpu has 13 (!) voltages, the trouble is that PHCtool window has been thinked to be fixed width: your lower values are somewere out of the border =_="".

      I'll try to fix that.

      What do you mean with: "I can not fix a max CPU from here."

      For your 100% problem try with

      sudo apt-get install htop

      after suspend and resume open a terminal and:

      sudo htop

      try to find the trolling process, so you can investigate where the problem actually is.

      Delete
    3. I fixed the width problem. Delete your 0.5.2-2 folder and install 0.5.2-3 as in the updated guide

      Cheers

      Delete
    4. Fabio, thank you so much for your support. I'll try to check the update with the width fix soon.

      By "max CPU" I meant "max CPU frequency" (sorry for the brainfart). I think it would be a useful addition to the program; avoiding having to manage two different applications for CPU-energy issues.

      About suspension, the problem is deeper: when I open the lid again, the screen is black and I can do nothing but hard power off. But never mind this because is pretty off-topic.

      Delete
  14. I get "Makefile:28: *** Only support for 2.6 series kernels. Stop." when running the "sudo make dmks_install" on a AMD processor.

    ReplyDelete
    Replies
    1. Following the instructions on http://www.linux-phc.org/forum/viewtopic.php?f=7&t=295, now I get "make: *** No rule to make target `dmks_install'. Stop"...

      Delete
    2. nvm, it works now...

      Delete
    3. ...or not.
      I can't run phc-tool...


      sudo sh phctool.sh

      Traceback (most recent call last):
      File "./phctool.py", line 468, in
      app=appgui()
      File "./phctool.py", line 81, in __init__
      self.cpuinfo=cpuinfo.cpuinfo() ##functions to gather CPU informations
      File "inc/libs/cpuinfo.py", line 13, in __init__
      self._get_acpi_cpus() ##get ACPI-supported CPUs
      File "inc/libs/cpuinfo.py", line 25, in _get_acpi_cpus
      for intcpunr in range(int(content[0].strip()),int(content[1].strip())+1):
      IndexError: list index out of range

      Delete
    4. Well done for the first fix. They are supposed to fix that issue, but nevermind.

      About the second problem I'm fixing a trouble linked with more-than-2-cores CPU, but it seems it needs some more work. Can you please post the output of

      sudo cat /sys/devices/system/cpu/online
      sudo ls /sys/devices/system/cpu/cpu*

      Thanks

      Delete
    5. sudo cat /sys/devices/system/cpu/online

      0

      sudo ls /sys/devices/system/cpu/cpu*

      /sys/devices/system/cpu/cpu0:
      cache cpufreq cpuidle crash_notes topology

      /sys/devices/system/cpu/cpufreq:
      ondemand

      /sys/devices/system/cpu/cpuidle:
      current_driver current_governor_ro


      It's a single core AMD Athlon Neo MV-40, I can undervolt it just fine on Windows with RMClock.
      Thanks for helping!

      Delete
    6. It should work now. Please take a look to the new PHCtool version and update yours (delete 0.5.2-2 folder and install 0.5.2-3)

      Cheers

      Delete
    7. PHCtool does open know, thanks. However, it says my CPU is not recognized.
      I assumed I could blindly change the VID values, but that doesn't seem to be the case.
      On Windows, using RMClock, I get a instant BSOD as soon as I set the voltages too low, but setting the VID to 0 doesn't seem to cause this on Linux, nor it seems to affect the temperature. Is there anything I can do about it?

      Delete
  15. Hi Fabio,

    Thanks for the great tutorial!

    I followed it and everything works, except I cannot change CPU voltage in the phctool. It says "CPU not recognized - calculation not available". I have an Intel i3 Sandybridge. You know anything about this?

    Thanks!!!

    ReplyDelete
    Replies
    1. It looks strange indeed. I have two hypothesis:
      # you messed up with something
      # your cpu is not supported

      So double check everything, if you have the same problem open an help request to PHC forum (linked at top of the page)

      Cheers

      Delete
    2. I already followed your tutorial a few times, so I guess it's the CPU that's not supported. Will ask in the forum, thx!

      Delete
  16. Hi,

    1st thx for your work on this famous tool.
    if i start phctool.sh it crashs:

    Traceback (most recent call last):
    File "./phctool.py", line 468, in
    app=appgui()
    File "./phctool.py", line 81, in __init__
    self.cpuinfo=cpuinfo.cpuinfo() ##functions to gather CPU informations
    File "inc/libs/cpuinfo.py", line 14, in __init__
    self._get_cpuinfos() ##get Infos from /proc/cpuinfo for every ACPI-CPU we found
    File "inc/libs/cpuinfo.py", line 95, in _get_cpuinfos
    self._get_phc(cpu) ##get PHC infos
    File "inc/libs/cpuinfo.py", line 104, in _get_phc
    self.data[cpunr]["phcvalues"]=self._get_PHCData(cpunr)
    File "inc/libs/cpuinfo.py", line 123, in _get_PHCData
    for line in phcif:
    IOError: [Errno 19] No such device

    any idea?! its a pentium M 735 1.70 ghz. merci a.

    ReplyDelete
    Replies
    1. Not sure, can you please paste the output of:

      sudo cat /sys/devices/system/cpu/online
      sudo ls /sys/devices/system/cpu/cpu*

      Thanks

      Delete
    2. hi,
      was in holidays but now the results of my task:

      sudo cat /sys/devices/system/cpu/online
      0
      sudo ls /sys/devices/system/cpu/cpu0/
      cpureq cpuidle crash_notes thermal_throttle topology


      Delete
  17. Hello Fabio, I noticed that you took a commenter's advice to replace '>>' append shell redirections with '>' overwrite ones, but I don't think that's correct for this part:


    sudo sh -c ' echo "\n#blackist required to load phc drivers
    blacklist acpi_cpufreq
    blacklist cpufreq_stats" >> /etc/modprobe.d/blacklist.conf'
    sudo sh -c ' echo "modprobe ##your module##" >> /etc/modules'


    It looks like your intention was to append to the files in this part. Yes, I overwrote my /etc/modules... whoops! I added append redirections above.

    ReplyDelete
    Replies
    1. Crap! You're definitively right... updated...

      Sorry about that!

      Delete
  18. I still get:
    FATAL: Error inserting phc_intel (/lib/modules/3.2.0-27-generic/updates/dkms/phc-intel.ko): Device or resource busy
    After having followed your post:

    "Fabio VeroneseFebruary 6, 2012 8:29 AM
    One last attemp before blacklisting... try with

    sudo update-initramfs -u

    if it still does the same just blacklist acpi_cpufreq and cpufreq_stats by adding

    #blackist required to load phc drivers
    blacklist acpi_cpufreq
    blacklist cpufreq_stats

    in /etc/module.d/phc (eventually create it)

    and put phc-intel to /etc/modules"

    So I wonder what im doing wrong?

    ReplyDelete
  19. Never mind my comment above, i ditched Lubuntu and went the Mint route and now everything works :)

    ReplyDelete
  20. First, thanks for making available this amazing tool! I've just discovered the amazing world of undervolting and I have a few newbie questions.

    I've been running ubuntu for a couple of years, and I've noticed that periodically I get kernel updates.

    (1) If I switch to a phc kernel, would the system updater messes up the phc kernel? Or perhaps your package would turn off (only?) that part of the auto-updater?
    (2) Does the phc kernel get updated in step with the mainline kernel?
    (3) Is it possible to "undo" the phc kernelc, or do I need to reinstall the system from scratch?
    (4) Is there a recipe for building my own phc kernel?

    MANY THANKS!

    ReplyDelete
    Replies
    1. 1 - maybe... if it founds an update to a newer version of the mainstream it updates and switches to it. The thing you can do is lock auto-update of the kernel and do it manually just when you see the phc update.
      2 - sort of... if you want more infos ask here: http://www.linux-phc.org/
      3 - you can just boot back the standard kernel from grub at boot. In that case phc driver can't load and you won't be able to undervolt.
      4 - Pretty sure. With linux anything is possible. The core point in the phc kernel is that cpu driver and the modules depending on mperf are not built-in, so you can unload them and load the phc driver. For more infos on how to build a custom kernel you'll find out tons of guides, but be sure to look for the ubuntu way, which is different from the other.

      Cheers

      Delete
  21. Hi! I'm using an Intel chip and have been following your instructions for undervolting under 12.04, however I have run into a snag. On step 4, I enter 'make dkms_mkdeb' but I get the error message, 'make: *** No rule to make target `dkms_mkdeb'. Stop.' Up until this point there have been no problems. Please help.

    Thanks!

    ReplyDelete
    Replies
    1. Please try directly

      make dkms_install

      as in the AMD procedure... it should work

      Cheers

      Delete
  22. I got phctool to run and set all my voltages and tested them, but I'm still having a couple of issues:

    1) When I try to run phctray.sh I get the following error:

    Traceback (most recent call last):
    File "./phctray.py", line 78, in
    gtk.main()

    2) When I restart my computer, phctool no longer runs (and I can't access the cpufreq commands). Running this code:

    sudo modprobe phc-intel

    as suggested to a user above, fixes the problem. However, I have to run it every time I start up. Is there a way I can fix this?

    3) Kind of unrelated, but after looking at the article on testing and doing some research on the different cpu governors, I decided to change mine from 'performance' to 'ondemand'. But when I restart, it is always set back to performance. Is there a way to save this setting?


    Thanks in advance for any help.

    ReplyDelete
    Replies
    1. 1) It crashes apparently for no reason... can you try with "sudo python phctray.py"

      2) You just can add it to the default loaded modules with
      sudo sh -c 'echo "\n# PHC Mod autoload\nphc-intel" >> modules'

      3) You can edit cpufrequtils file (it should lay in /etc/init.d or in /etc/conf.d), look for the lines:

      ENABLE="true"
      GOVERNOR="preformance"
      MAX_SPEED="0"
      MIN_SPEED="0"

      and change the governor to your likes

      Cheers

      Delete
  23. Hi, today i tried your method for installing phc, but when i go to voltages, everything in the "new voltage" row its locked at n/a, and so is the "difference to original row". I tried the method at https://wiki.archlinux.org/index.php/PHC#Finding_safe_low_voltages with the mprime-phc-setup script and it tries all the vid's until 0 (and it never crashes). So finally, it returns vid 2 for all frequency's (minimum plus 2). The processor is an i5-430m on an hp g62-149wm. It has a serious heating problem... Do you have any idea on how to proceed? Thanks in advance, your post was really helpfull

    ReplyDelete
    Replies
    1. I guess you CPU is a Sandy Bridge. It means it's not supported. We are working to make it compatible too.

      Regards

      Delete
    2. Ok, i'll keep looking for any updates. Thanks for the help anyways!

      Delete
  24. I had a problem starting phctool.sh.

    I followed some other directions you gave above, namely:

    sudo lsmod | grep phc

    then

    sudo modprobe phc-intel

    Output:
    WARNING: All config files need .conf: /etc/modprobe.d/options, it will be ignored in a future release.
    WARNING: /etc/modprobe.d/options line 3: ignoring bad line starting with 'gksu'

    Upon doing these (and ignoring the errors) i can start phctool.sh, made modifications to the voltages based on a table I found online from someone else using same CPU. But i havent noticed any changes to the temperature of my CPU.

    Or, perhaps my tool for measuring the system temperature is not good? I use the output read from a fan control software.


    ReplyDelete
    Replies
    1. I have a feeling the driver isnt loaded...

      Delete
    2. Yep, you are supposed to get an output to:
      sudo lsmod | grep phc

      the couple of warning seem not to be related to phc... did you reboot before trying loading the file?

      Be sure that phctool or phctray is running, or you voltage changes won't be loaded.

      If you still have troubles make me know.

      Cheers

      Delete
  25. Output to sudo lsmod | grep phc

    phc_intel 17977 1
    mperf 12603 1 phc_intel

    When i run ./phctool.sh i get

    File "./phctool.py", line 468, in
    app=appgui()
    File "./phctool.py", line 100, in __init__
    self.phcdata.RestoreValues() ##restore VIDs from last session
    File "inc/libs/generic.py", line 55, in RestoreValues
    self.parent.throttling.set_throttledata_array(throttles)
    File "inc/libs/throttling.py", line 77, in set_throttledata_array
    self.set_throttledata(cpu, array[cpu])
    File "inc/libs/throttling.py", line 69, in set_throttledata
    if int(value) >= 0 and int(value)< self.data[cpu]["state_count"]:
    ValueError: invalid literal for int() with base 10: ''

    ReplyDelete
    Replies
    1. Do you get this error at first run or while you set throttling values? If it pops simply running phc try to delete settings data in your home folder.

      Let me know you you still have problems

      Cheers

      Delete
  26. I get the error in the first run.

    The interface never opens now. Please ignore my previous posting from Oct 13...i decided to go back to step 1 and redo everything. Upon doing so, I never get

    ./phctool.sh

    to run (meaning I get the errors I posted above on Nov 22).

    ReplyDelete
  27. When I try this with my Ubuntu 12.10 install I get:

    E: Unable to locate package linux-generic-phc
    E: Unable to locate package linux-headers-generic-phc

    Is there a way to get the PHC kernel and headers on Ubuntu 12.10?

    ReplyDelete
    Replies
    1. You have to be patient and wait for the phc kernel release. If you're not, you still can recompile the kernel, including mperf and acpi-cpufreq as modules.

      If this does not make sense to you... go to the phc forum, ask for the new kernel patch and be patient.

      Regards

      Delete
  28. hi fabio.

    It wasnt clear what you meant by "If it pops simply running phc try to delete settings data in your home folder". Can you elaborate? I am a newbie at ubuntu. I looked for a data folder in my home directory, but it does not exist.

    Thanks (and sorry for being annoying).
    -Greg

    ReplyDelete
    Replies
    1. Don't worry, it's just hard to debug everyone's error. The config location is your home folder, its name is .phcstore.phc and, since it's a config file, it's hidden, so you may need to ctrl+h to see it.

      We have also to consider you have a centrino cpu, in which the throttling interface might still have some functionality. This may introduce unexpected bugs in the GUI...

      Delete
  29. Hi Fabio

    Ok so this worked. For the other users out there: I had to delete the file .phcstore.phc (as fabio indicated). Then I reinstalled the phctool and the gui opened.

    My only remaining question is how to keep setting as is (once modified) for every reboot. In other words: does one alsways need to load phctool to make the desired changes? Or, can settings be saved and loaded upon every bootup?

    -Greg

    ReplyDelete
    Replies
    1. by starting phctray on startup you'll have a nice trayicon, preloading phc stuff.

      Delete
  30. Hi Fabio,
    It seems I overlooked that throttling is "Not Available" according to the dropdown menus in the PHC GUI. Does this mean changes I make have no effect? I do see "Vcc Calculation: CPU recognized, calculation available" Under Analysis tab target VID, target Vcc and reached VID are all n/A.

    Does this mean the tool wont work on my CPU?
    Thanks

    -Greg

    ReplyDelete
    Replies
    1. Ok, if throttling is "not available" it's not a problem for phc. It relies on Intel Model Specific Registers so it won't be affected.

      Have you tried to "Refresh" values (I mean by pushing the so called button in Analysis tab)?

      Delete
  31. I tried to hit the refresh button but the values on that page do not change. What i mean is that the entries for target VID/target VCC/Reached VID and reached VCC are all n/A. I saved my changes and made to the voltages and exited the program, entered back in. The entries in Analysis tab are still n/A even if I press the refresh button.

    More information that could be useful (maybe):

    I checked what was in/sys/devices/system/cpu/cpu0/cpufreq/phc_controls and I indeed see the changes I made in the gui.

    Are these being implemented? How can one check?

    Is there something else I need to switch on in order for the changes to take effect?

    -Greg


    ReplyDelete
  32. Hi
    phctool also worked for me and then stopped. Reinstall did not help!?...cause needed to remove the phc config file
    phcstore.phc

    Then reinstall and works again

    ReplyDelete
  33. This comment has been removed by a blog administrator.

    ReplyDelete
  34. Hi Fabio,

    Are there any news on the SandyBridge version of linux-PHC?

    In the forum you mention a hack that works for your machine ... can we do this, too, with a bit of fiddling around?

    So much looking forward to silence my current machine!

    Cheers
    -T

    ReplyDelete
    Replies
    1. Sorry, but it seems there's still no way to undervolt Sandy Bridge and Ivy Bridge CPUs. I just succeded in unlocking the lowest CPU freq availble. See more infos here:

      http://linuxsolver.blogspot.it/2012/09/how-to-customize-cpu-frequency-steps.html

      Delete
  35. Hello to everybody, are i'm the only one who get's Error-messages during installing the new REV9-phc-intel-driver?
    thx

    ReplyDelete
  36. I'm also experiencing problems installing.

    ReplyDelete
  37. phc-intel-pack-rev9 works. please delete the posts since first may. thanks

    ReplyDelete
    Replies
    1. No man, it doesn't work! I have 2 intel laptops trying to undervolt:on the older xubu12.04 and on the newer ubu12.04. On both i get the same message after installing the created .deb package on step 5: "Error! Bad return status for module build on kernel: 3.2.0-25-generic-phc(i686) Consult /var/lib/dkms/phc-intel/0.3.2/build/make.log for more information."

      Delete
    2. Everything works fine now with Revision9.1.

      Delete
  38. Hello Fabio

    Recently i am trying to undervolte my intel core i 5 M 540, I am using ubuntu 12.04 LTS and i have three python in my ubuntu 2.6.6 in a default and 2.7.3 is used by ubunut and 3.2 is used by pycairo, anyway, when i am trying to launch phctool, i am getting this message :

    sudo python2.7 phctool.py

    GLib-GIO-Message: Using the 'memory' GSettings backend. Your settings will not be saved or shared with other applications.
    Traceback (most recent call last):
    File "phctool.py", line 468, in
    app=appgui()
    File "phctool.py", line 102, in __init__
    self.ShowPHCVIDs() ##display current VIDs
    File "phctool.py", line 283, in ShowPHCVIDs
    columns = self.data[cpu]['frequencies'] ##define the amount of columns we'll use to display all data
    KeyError: 'frequencies'

    and when sudo python2.7 phctray.py

    GLib-GIO-Message: Using the 'memory' GSettings backend. Your settings will not be saved or shared with other applications.
    GLib-GIO-Message: Using the 'memory' GSettings backend. Your settings will not be saved or shared with other applications.
    You need to install pyGTK or GTKv2 or set your PYTHONPATH correctly.
    try: export PYTHONPATH= /usr/local/lib/python2.2/site-packages/

    i am trying to export the PYTHONPATH but every time this message appear.
    sudo ls /sys/devices/system/cpu/cpu*

    /sys/devices/system/cpu/cpu0:
    cache cpuidle crash_notes node0 topology

    /sys/devices/system/cpu/cpu1:
    cache cpuidle crash_notes node0 online topology

    /sys/devices/system/cpu/cpu2:
    cache cpuidle crash_notes node0 online topology

    /sys/devices/system/cpu/cpu3:
    cache cpuidle crash_notes node0 online topology

    /sys/devices/system/cpu/cpufreq:

    /sys/devices/system/cpu/cpuidle:
    current_driver current_governor_ro

    I really don't know what the problem is,So can you help me please? It would be really appreciate to have your help.

    payam

    ReplyDelete
  39. Dear Fabio

    Somehow i managed to run phctool.sh with your guid through above comments, but after I rerun the phctool.sh the follow error appear. even i remove cpuinfo.pyc from the lib and download the phctool0.5.2-3 again and copy the lib but it didn't work. I got the error again. can you help me please.

    Thank you for your kind and consideration.

    Traceback (most recent call last):
    File "./phctool.py", line 468, in
    app=appgui()
    File "./phctool.py", line 100, in __init__
    self.phcdata.RestoreValues() ##restore VIDs from last session
    File "inc/libs/generic.py", line 55, in RestoreValues
    self.parent.throttling.set_throttledata_array(throttles)
    File "inc/libs/throttling.py", line 77, in set_throttledata_array
    self.set_throttledata(cpu, array[cpu])
    File "inc/libs/throttling.py", line 69, in set_throttledata
    if int(value) >= 0 and int(value)< self.data[cpu]["state_count"]:
    ValueError: invalid literal for int() with base 10: ''

    ReplyDelete
  40. Thank you Fabio for your great thread, it is working fine right now, I delete the .phcstore.phc as you mentioned above and reinstall the phctool. it work fine. even my vid refresh but still my throttling is "Not Available". I am going to next step.
    Thanks
    payam

    ReplyDelete
  41. Hi , I got an error FATAL : Module cpufreq_stats is builtin
    FATAL : Error running remove command for acpi_cpufreq

    ReplyDelete
    Replies
    1. This means almost surely you're not running the right kernel.. double check it with "uname -a"

      Regards

      Delete
    2. uhm...what should the correct kernel be ? I've checked it and I got this as a result

      3.2.0-49-generic #75-Ubuntu SMP Tue Jun 18 17:39:32 UTC 2013 x86_64 x86_64 x86_64 GNU/Linux

      Delete
    3. Step 2

      "Now let's install the kernel and its headers:
      sudo apt-get install linux-generic-phc linux-headers-generic-phc
      First pause... restart your PC and be sure to choose your new *-phc kernel."

      Delete
    4. Uhm...I've run the command...it's said that "linux-generic-phc is already the newest version"....what do you mean by "pause" ?? Just stop ? I've restarted my laptop , but I don't know how to choose the new *-phc kernel...

      sorry about all these...I'm a newbie in Linux...just decided to give it a try last week ^^

      Delete
  42. I've managed to install PHCtool V0.5.2-3 , but in the "Vcc calculation" column , it says "CPU not recognized-calculation not available"...what does this mean ?

    ReplyDelete
    Replies
    1. I also tried to create the program link in Step 10 , but it didn't work , I clicked on the application in Dash , and when I keyed in my password , nothing happened...I have to execute "phctool.sh" manually from the folder where it is located...any ideas on my problem ?

      Delete
    2. Probably you CPU is not supported, which one are you running? Which linux distro are you applying this to?

      Delete
    3. And my CPU is Intel Core i3 M350 @2.27 GHz

      Delete
  43. Hello, thank you for tutorial, iv been using PHC on 10.04, but unfortunately i m not able on 12.04. Maybe i am missing someting, but after installing kernelfrom phc-repos, compiling module using your guide i still won`t boot without acpi=off - otherwise it gives error: " fixing recursive fault but reboot is needed". I am using Pentium M laptop. Thanks in advance.

    ReplyDelete
  44. Hi,

    Thanks a lot for this tutorial ! I am currently struggling with the " FATAL: Module cpufreq_stats is builtin "
    As you said it's because of the step 2 "be sure to choose your new *-phc kernel." but how to be sure ?

    ReplyDelete
  45. Hi Fabio,

    Thanks a lot for your amazing work. I have followed your tutorial: kernel 3.2.0.25-generic-phc loaded. phc-intel driver loaded...but unfortunatelly phctool is not working:
    Traceback (most recent call last):
    File "./phctool.py", line 468, in
    app=appgui()
    File "./phctool.py", line 81, in __init__
    self.cpuinfo=cpuinfo.cpuinfo() ##functions to gather CPU informations
    File "inc/libs/cpuinfo.py", line 14, in __init__
    self._get_cpuinfos() ##get Infos from /proc/cpuinfo for every ACPI-CPU we found
    File "inc/libs/cpuinfo.py", line 102, in _get_cpuinfos
    self._get_phc(cpu) ##get PHC infos
    File "inc/libs/cpuinfo.py", line 111, in _get_phc
    self.data[cpunr]["phcvalues"]=self._get_PHCData(cpunr)
    File "inc/libs/cpuinfo.py", line 130, in _get_PHCData
    for line in phcif:
    IOError: [Errno 19] No existe el dispositivo


    would you please give me some guidance?
    Thanks in advance!!!!

    ReplyDelete
  46. By the way I tried to delete the hiden file .phcstore.phc but the file does not exist.... Any hint?

    ReplyDelete
  47. It worked! Thanks for the helpful guide, as a linux noob I'm not sure how I would have done without this.

    I used PHC to undervolt my Dell Latitude E6400 w/ Intel P9700 and significantly drop my temps.

    ReplyDelete
  48. yes, it work om my AMD MV-40, thank alot guys. Now my laptop running cool.....

    ReplyDelete
  49. There is no solution for ubuntu 14.04? I searched the kernel online to compile it, but I cannot find it... The ones in kernel.org are not working

    ReplyDelete