[phpBB Debug] PHP Warning: in file [ROOT]/phpbb/session.php on line 583: sizeof(): Parameter must be an array or an object that implements Countable
[phpBB Debug] PHP Warning: in file [ROOT]/phpbb/session.php on line 639: sizeof(): Parameter must be an array or an object that implements Countable
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4516: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3262)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4516: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3262)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4516: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3262)
linux-PHC • Patch for Athlon64, Opteron, Turion64, DirectTrans, & MSR
Page 1 of 2

Patch for Athlon64, Opteron, Turion64, DirectTrans, & MSR

Posted: Fri 7. Aug 2009, 21:07
by jasmine
Hi,

Just posting this during a break before I go catchup on sleep, quite tired, so I will be quite brief.. :)

When I downloaded and ran PHCTool-0.5.2-2, I realized it was missing important features, especially support for AMD64/Opteron/Turion64 in terms of Vcc calculation (Voltages tab), MSR Polling (Analysis tab). Even more unfortunate, if I use phc-k8 with direct_transitions=1 (enabled), and add intermediate fids/vids in command line, then try to open PHCTool, it would crash because it doesn't know about these intermediate fids/vids (since it doesn't find default vids for them in phc_default_fids) :|

So I went ahead and made a patch to address all these issues :)

Changes made by the attached patch:
- Added VID->Voltage calculation formula(s) for Athlon64, Opteron, Turion64 Mobile Technology CPUs (including X2)
- Added autodetection of Turion64 X2 Mobile Technology TL-50, TL-52, TL-56, Tl-58, TL-60, TL-62, etc.. to use said formula(s)
- Added checking for direct_transitions if phc-k8 module is being used (for AMD CPUs), and display if its enabled in "Infos" page
- Added detection of intermediate frequencies being used if phc-k8 is detected and direct_transitions is enabled, and auto-calculation of "default VIDs" for the intermediate FIDs (Quick and dirty imitation of RMClock, but done in a haste, so need to revise for accuracy) so that PHCTool recognizes them and allows for adjustment of their VIDs and displays the difference between the "defaults" and the values you set, and more importantly, NOT CRASH!
- Added support for AMD K8 MSR Polling, so you can now use the "Analysis" tab of PHCTool to check if the VIDs (and optionally intermediate FIDs) are actually being used by your CPU

Screenshots? Everyone loves screenshots :P

Infos
Image

Voltages
Image

Analysis
Image

Infos - Direct Transitions enabled and used
Image

Voltages - Direct Transitions enabled and used (also shows difference from the calculated "defaults")
Image

Sources used for reference/ideas in the process of creating the patch:
- Chapter 9 (Power and Thermal Management) of the "BIOS and Kernel Developer's Guide for the AMD Athlon 64 and AMD Opteron Processors" available for download from AMD
- AMD AthlonTM 64 Processor Power and Thermal Data Sheet available for download from AMD (also applies to Sempron & Turion64 Mobile Technology CPUs)
- arch/x86/kernel/cpu/cpufreq/powernow-k8.c from kernel 2.6.30 sources
- cpupowerd (just for ideas and to confirm the correctness of the formula used - src/msr_amd.c)
- RMClock manual/Readme

Re: Patch for Athlon64, Opteron, Turion64, DirectTrans, & MSR

Posted: Fri 7. Aug 2009, 22:44
by DavidG
Glad to have you on board! ;)

Re: Patch for Athlon64, Opteron, Turion64, DirectTrans, & MSR

Posted: Wed 7. Oct 2009, 19:30
by the-fallen
Me, too!

Welcome on board!

patch shows no effect

Posted: Mon 17. May 2010, 16:12
by Nic
Hi,

thanks for this patch and the time you spent writing it, but... it seems to have no effect on my machine (Acer travelmate with tl-58). When I run the patch in a terminal the following appears:
XXXXX@XXXXX:~/Dokumente/energieverwaltung/0.5.2-2/phctool/inc/libs$ sudo patch < phctool-0.5.2-2_amd64.patch
patching file cpuinfo.py
patching file msr.py
patching file voltages.py
patching file phctool.py
Hunk #1 FAILED at 97.
Hunk #2 FAILED at 216.
Hunk #3 FAILED at 225.
Hunk #4 FAILED at 307.
Hunk #5 FAILED at 339.
Hunk #6 FAILED at 355.
Hunk #7 FAILED at 363.
7 out of 7 hunks FAILED -- saving rejects to file phctool.py.rej
XXXX@XXXX:~/Dokumente/energieverwaltung/0.5.2-2/phctool/inc/libs$

when I run phctool afterwards my cpu keeps non recognized. Shut I apply the patch before or after running the install.sh of phctool? I am a linux-newbie and every help is much appreciated, because the fan of my laptop is the only thing that keeps me away from nonstop working in linux instead of windows.

Thanks in advance.

Re: Patch for Athlon64, Opteron, Turion64, DirectTrans, & MSR

Posted: Mon 17. May 2010, 20:41
by the-fallen
Please note that PHCTool is currently not maintained.

I apologize that I still can not provide a new alternative.

I hope someone with some time to spend will take care of a GUI.

Until then you need to use the console tools. They give you all you need (but not a GUI at all :) )

Re: Patch for Athlon64, Opteron, Turion64, DirectTrans, & MSR

Posted: Sun 18. Jul 2010, 09:31
by Gele
@the-fallen,@jasmine: Thank you so much ! You saved me from WinXP + RM Clock. Now XP is virtual.
I`ve applied your patch, but since my CPU wasn`t in, i`ve added a line in voltages.py for it (though I don`t understand python).
(Turion64 MLxx is old single core which benefits from undervolting hugely, mine is ML34 at 1.45v@1.8Ghz underpowered to 1.15V@1.8G thus 35W->25W like MT34 model (same Si) ).
@Nic: For those (like me :) ) who can`t even use patch tool, i put here the whole (AMD) patched version.
phctool-0.5.2-2.tar.gz
(51.06 KiB) Downloaded 1026 times
Ripped the doc folder to meet the 256k limit. One can D/L the original source to get it.
run phctool by typing: path_to/phctool.sh
I`ve did a nasty fix for error i got trying to run phctray.sh It was problem regarding egg.trayicon (no such object or so). Now using gtk.StatusIcon.
@Nic: Do you have phc kernel and phc_k8 kernel module loaded ?
For unknown reason I`ve lost /dev/cpu node, so I couldn`t check if the settings applied from GUI/Analysis tab. To resolve i `ve loaded the msr driver by hand: sudo modprobe msr
hope it helps someone.
@the-fallen: registration here was very challenging due to captcha module. I recognized 1 from 8 tries.

Re: Patch for Athlon64, Opteron, Turion64, DirectTrans, & MSR

Posted: Mon 11. Oct 2010, 02:36
by SpielzeugBomber
Hi Gele,
sadly your patched version of the tools doesn't work.
It crashs with the following error:

Code: Select all

Traceback (most recent call last):
  File "./phctool.py", line 502, in <module>
    app=appgui()
  File "./phctool.py", line 103, in __init__
    self.ShowPHCVIDs()            ##display current VIDs
  File "./phctool.py", line 325, in ShowPHCVIDs
    if self.data[cpu]['voltages']['formula']['name'] == "amd_64":
I can't patch the tool by myself, because i get the same error as Nic.

I have a Turion 64x TL 64.

Hope someone can help me.

Chris

Re: Patch for Athlon64, Opteron, Turion64, DirectTrans, & MSR

Posted: Mon 25. Oct 2010, 23:37
by Gele
SpielzeugBomber wrote:Hi Gele,
sadly your patched version of the tools doesn't work.
................
@Chris: I think that you just didn`t try very hard. For you I`m posting here the
Full Gele`s quick`n dirty PHC Ubuntu Guide:
1. Open a terminal and:
1.1 Add a PHC kernel repository:
sudo su #become SuperUser
add-apt-repository ppa:linux-phc/ppa # it`s in english
2.Update apt sources cache:
apt-get update
3.Install a PHC kernel:
apt-get install linux-preempt-phc
3.1 Install PHC headers:
apt-get install linux-headers-preempt-phc
4. D/L & Install the phc-k8-0.4.2 - PHC kernel driver (for Athlon64); unapck in ~/phc-k8-0.4.2/, (your home dir. maybe /root) then install for DKMS auto-build:
aptitude install dkms # Install DKMS system
From your home (as root) cd into /phc-k8-0.4.2 and execute:
make dkms_install # This will copy the source dir. to /usr/src to be available for DKMS to build the module every time you upgrade the kernel. Then it will compile the module for the running kernel.
5. Download & Install the patched PHC tool:
download(from above), then exit from root mode: exit and
cd in the terminal to /home/Your_user/Downloads # where Patched PHC tool archive is saved.
tar -xvf phctool-0.5.2-2.tar.gz #unpack
Then .... reboot & select the PHC kernel you just installed in grub boot-menu.
Your boot will take a bit longer (for DKMS to rebuild the kernel module for the new kernel).Then open a terminal & run the tray tool:
path/..../phctool-0.5.2-2/phctray.sh # If everything`s O.K. it will ask you for root password to load the drivers & you`ll see the tray icon. Click it.
Enjoy, create launcher, buy someone a beer(I prefer German or Czech beer) & write something in success stories.

Re: Patch for Athlon64, Opteron, Turion64, DirectTrans, & MSR

Posted: Tue 26. Oct 2010, 09:42
by DavidG
Gele wrote:Enjoy, create launcher, buy someone a beer(I prefer German or Czech beer) & write something in success stories.
That's a good idea, I prefer Belgian, Danish or Irish. :D

Re: Patch for Athlon64, Opteron, Turion64, DirectTrans, & MSR

Posted: Fri 29. Oct 2010, 08:52
by SpielzeugBomber
hi gele,
i did already all this steps.
I use not the preempt kernel, but this is the only difference.

Code: Select all

peter@fritzpNotebook:~$ uname -r
2.6.32-25-generic-phc
The phc-k8 patch was already installed:

Code: Select all

peter@fritzpNotebook:~/phc-k8_v0.4.2$ sudo make dkms_install
[sudo] password for peter: 
**********************************************************************
Please remove previous DKMS installs for phc-k8 first:
phc-k8, 0.4.2, 2.6.32-25-generic-phc, x86_64: installed 
For example: dkms remove -m "phc-k8" -v 0.4.0
**********************************************************************

make: *** [dkms_mod_check] Fehler 1
peter@fritzpNotebook:~/phc-k8_v0.4.2$ 

Only thing i wondered about:

Code: Select all

make: *** [dkms_mod_check] Fehler 1
Is this the error message if the kernel patch is already installed?Or is this an error message, that says something is going wrong?

After unpacking and reboot my notebook i started phctray.sh and he asks for my root password to load the kernel moduls.
But then, when i open phctray it says again:

Code: Select all

Traceback (most recent call last):  File "./phctool.py", line 502, in <module>
    app=appgui()
  File "./phctool.py", line 103, in __init__
    self.ShowPHCVIDs()			##display current VIDs
  File "./phctool.py", line 325, in ShowPHCVIDs
    if self.data[cpu]['voltages']['formula']['name'] == "amd_64":
KeyError: 'name'
Anyway, thanks for your answer. :-)

Best Regards,
Chris