TurionPowerControl 0.44-rc1 is out...

tear

[H]ard|DCer of the Year 2011
Joined
Jul 25, 2011
Messages
1,568
G'day,

I took liberty of putting new version of TurionPowerControl out there (0.44-rc1) --
hopefully blackshard doesn't kill me :-o

It's available at: http://code.google.com/p/turionpowercontrol/

It includes fixes and many improvements in F10h and F15h departments and practically
deprecates all versions that have been flying out there (esp. my svn snapshots).

Feel free to check it out and report any problems!


tear

P.S.
Special thanks to Jaeger for dev work and dcds1 and sc0tty8 for gobs of testing assistance
 
Downloaded the shiny new code, followed directions to install from Musky's post (with new file name), got this:

Code:
Server5:~/tpc/tpc-0.44-rc1/src$ make
mkdir -p obj/x86_64
/bin/sh: svn: not found
/bin/sh: svnversion: not found
g++ -O2   -MMD -MF obj/x86_64/.TurionPowerControl.d -MT obj/x86_64/TurionPowerControl.o -c -o obj/x86_64/TurionPowerControl.o TurionPowerControl.cpp
g++ -O2   -MMD -MF obj/x86_64/.config.d -MT obj/x86_64/config.o -c -o obj/x86_64/config.o config.cpp
config.cpp: In member function âint CfgManager::consumePStateSection()â:
config.cpp:49: warning: ignoring return value of âchar* fgets(char*, int, FILE*)â, declared with attribute warn_unused_result
config.cpp:87: warning: ignoring return value of âchar* fgets(char*, int, FILE*)â, declared with attribute warn_unused_result
config.cpp:89: warning: ignoring return value of âint fscanf(FILE*, const char*, ...)â, declared with attribute warn_unused_result
config.cpp:91: warning: ignoring return value of âint fscanf(FILE*, const char*, ...)â, declared with attribute warn_unused_result
config.cpp:93: warning: ignoring return value of âint fscanf(FILE*, const char*, ...)â, declared with attribute warn_unused_result
config.cpp:99: warning: ignoring return value of âint fscanf(FILE*, const char*, ...)â, declared with attribute warn_unused_result
config.cpp:101: warning: ignoring return value of âint fscanf(FILE*, const char*, ...)â, declared with attribute warn_unused_result
config.cpp:103: warning: ignoring return value of âint fscanf(FILE*, const char*, ...)â, declared with attribute warn_unused_result
config.cpp:105: warning: ignoring return value of âint fscanf(FILE*, const char*, ...)â, declared with attribute warn_unused_result
config.cpp: In member function âint CfgManager::consumeGeneralSection()â:
config.cpp:181: warning: ignoring return value of âchar* fgets(char*, int, FILE*)â, declared with attribute warn_unused_result
config.cpp:190: warning: ignoring return value of âint fscanf(FILE*, const char*, ...)â, declared with attribute warn_unused_result
config.cpp:193: warning: ignoring return value of âint fscanf(FILE*, const char*, ...)â, declared with attribute warn_unused_result
config.cpp:197: warning: ignoring return value of âint fscanf(FILE*, const char*, ...)â, declared with attribute warn_unused_result
config.cpp:200: warning: ignoring return value of âint fscanf(FILE*, const char*, ...)â, declared with attribute warn_unused_result
config.cpp:203: warning: ignoring return value of âint fscanf(FILE*, const char*, ...)â, declared with attribute warn_unused_result
config.cpp:206: warning: ignoring return value of âint fscanf(FILE*, const char*, ...)â, declared with attribute warn_unused_result
config.cpp:213: warning: ignoring return value of âint fscanf(FILE*, const char*, ...)â, declared with attribute warn_unused_result
config.cpp:216: warning: ignoring return value of âint fscanf(FILE*, const char*, ...)â, declared with attribute warn_unused_result
config.cpp:220: warning: ignoring return value of âint fscanf(FILE*, const char*, ...)â, declared with attribute warn_unused_result
config.cpp:224: warning: ignoring return value of âint fscanf(FILE*, const char*, ...)â, declared with attribute warn_unused_result
config.cpp: In member function âint CfgManager::consumeScalerSection()â:
config.cpp:258: warning: ignoring return value of âchar* fgets(char*, int, FILE*)â, declared with attribute warn_unused_result
config.cpp:267: warning: ignoring return value of âint fscanf(FILE*, const char*, ...)â, declared with attribute warn_unused_result
config.cpp:270: warning: ignoring return value of âint fscanf(FILE*, const char*, ...)â, declared with attribute warn_unused_result
config.cpp:278: warning: ignoring return value of âint fscanf(FILE*, const char*, ...)â, declared with attribute warn_unused_result
config.cpp:282: warning: ignoring return value of âint fscanf(FILE*, const char*, ...)â, declared with attribute warn_unused_result
config.cpp: In member function âint CfgManager::parseCfgFile()â:
config.cpp:318: warning: ignoring return value of âchar* fgets(char*, int, FILE*)â, declared with attribute warn_unused_result
config.cpp:327: warning: ignoring return value of âint fscanf(FILE*, const char*, ...)â, declared with attribute warn_unused_result
config.cpp:341: warning: ignoring return value of âchar* fgets(char*, int, FILE*)â, declared with attribute warn_unused_result
g++ -O2   -MMD -MF obj/x86_64/.cpuPrimitives.d -MT obj/x86_64/cpuPrimitives.o -c -o obj/x86_64/cpuPrimitives.o cpuPrimitives.cpp
g++ -O2   -MMD -MF obj/x86_64/.Griffin.d -MT obj/x86_64/Griffin.o -c -o obj/x86_64/Griffin.o Griffin.cpp
g++ -O2   -MMD -MF obj/x86_64/.K10Processor.d -MT obj/x86_64/K10Processor.o -c -o obj/x86_64/K10Processor.o K10Processor.cpp
g++ -O2   -MMD -MF obj/x86_64/.Brazos.d -MT obj/x86_64/Brazos.o -c -o obj/x86_64/Brazos.o Brazos.cpp
g++ -O2   -MMD -MF obj/x86_64/.Llano.d -MT obj/x86_64/Llano.o -c -o obj/x86_64/Llano.o Llano.cpp
g++ -O2   -MMD -MF obj/x86_64/.Interlagos.d -MT obj/x86_64/Interlagos.o -c -o obj/x86_64/Interlagos.o Interlagos.cpp
g++ -O2   -MMD -MF obj/x86_64/.MSRObject.d -MT obj/x86_64/MSRObject.o -c -o obj/x86_64/MSRObject.o MSRObject.cpp
g++ -O2   -MMD -MF obj/x86_64/.MSVC_Round.d -MT obj/x86_64/MSVC_Round.o -c -o obj/x86_64/MSVC_Round.o MSVC_Round.cpp
g++ -O2   -MMD -MF obj/x86_64/.PCIRegObject.d -MT obj/x86_64/PCIRegObject.o -c -o obj/x86_64/PCIRegObject.o PCIRegObject.cpp
g++ -O2   -MMD -MF obj/x86_64/.PerformanceCounter.d -MT obj/x86_64/PerformanceCounter.o -c -o obj/x86_64/PerformanceCounter.o PerformanceCounter.cpp
g++ -O2   -MMD -MF obj/x86_64/.Processor.d -MT obj/x86_64/Processor.o -c -o obj/x86_64/Processor.o Processor.cpp
Processor.cpp: In member function âvoid Processor::setProcessorStrId(const char*)â:
Processor.cpp:238: warning: format â%dâ expects type âintâ, but argument 2 has type âlong unsigned intâ
g++ -O2   -MMD -MF obj/x86_64/.K10PerformanceCounters.d -MT obj/x86_64/K10PerformanceCounters.o -c -o obj/x86_64/K10PerformanceCounters.o K10PerformanceCounters.cpp
g++ -O2   -MMD -MF obj/x86_64/.scaler.d -MT obj/x86_64/scaler.o -c -o obj/x86_64/scaler.o scaler.cpp
g++ -O2   -MMD -MF obj/x86_64/.Signal.d -MT obj/x86_64/Signal.o -c -o obj/x86_64/Signal.o Signal.cpp
g++ -O2   -MMD -MF obj/x86_64/.sysdep-linux.d -MT obj/x86_64/sysdep-linux.o -c -o obj/x86_64/sysdep-linux.o sysdep-linux.cpp
sysdep-linux.cpp:2: fatal error: term.h: No such file or directory
compilation terminated.
make: *** [obj/x86_64/sysdep-linux.o] Error 1
 
Looks like you are missing the ncurses devel package. What OS and version are you running? That will help determine the exact package you need to install.


Also happy to report it builds cleanly and runs fine on Fedora 17 x76_64. Good work everyone :)
 
I am running Ubuntu 10.10 as per musky's install guide.
 
Yes, ncurses is a new dependency, we'll cover that in release notes/documentation.
Sorry about that.

In the mean time...
Code:
sudo apt-get install ncurses-dev
and then re-try the build, please.
 
G'day,

I took liberty of putting new version of TurionPowerControl out there (0.44-rc1) --
hopefully blackshard doesn't kill me :-o

It's available at: http://code.google.com/p/turionpowercontrol/

It includes fixes and many improvements in F10h and F15h departments and practically
deprecates all versions that have been flying out there (esp. my svn snapshots).

Feel free to check it out and report any problems!


tear

P.S.
Special thanks to Jaeger for dev work and dcds1 and sc0tty8 for gobs of testing assistance

And everyone thank tear for all his hard work in the improvments to TPC. Without all his hair pulling experience, this release with fixes and improvments wouldn't be out.
 
Not totally sure if this is my error or not, but if i set CPU freq using the a command like

sudo TurionPowerControl set node all core all pstate 0 frequency 2400

It runs for a little while (~1 min) and reboots. 2400MHZ should be fully stable at 1.100v AFAIK, and the same thing happens if i raise it to 1800MHz. I do not think the frequency is actually set, as I got a wattmeter plugged into the wall socket, and a 50% frequency bump should mean a decent wattage bump as well - and there's no difference at all. No reboot if I set the CPU voltage, but again - I'm sure it doesn't really change based on the power consumption.

The fact that I added "sudo" at the beginning is because I do get a bunch of 'permission denied' errors without it, all related to MSR and PCI register.
 
It runs for a little while (~1 min) and reboots.
I don't know anything about your CPUs.

2400MHZ should be fully stable at 1.100v AFAIK
Reality won't change simply because you don't accept it :p
Something is wrong.

sudo TurionPowerControl set node all core all pstate 0 frequency 2400
Firstly, actual command line parameter is -set (with a dash, not a plain set).
Unfortunately, current TPC's command line parsing code design makes it impossible to
tell that you made a mistake.
In other words, the command line you're quoting does exactly nothing.
You should always double check your settings with TurionPowerControl -l.

Secondly, "node all core all pstate 0" are redundant and can be omitted (they are the
defaults anyway).

Thirdly, P-State changes take effect only on CPU's transition to the P-State of interest.
In other words, manipulating P-State 0 while CPU is continuously in P-State 0 does nothing.
Also, with PowerNow enabled, Linux power management can change P-States behind
your back -- it's something you don't usually want.

That said, general recommendations when dealing with MC ES chips are:

1. Disable PowerNow in the BIOS _or_ set "performance" scaling governor _or_
  set "userspace" scaling governor and set maximal possible frequency

2. Using TPC, set desired P-State's 0 frequency and voltage for each CPU

3. Transition all cores to non-zero P-State (I recommend using low P-State)

4. Transition all cores to P-State 0


For instance (a simple form):
Code:
TurionPowerControl -set freq 3000 vcore 1.25
TurionPowerControl -fo 4
sleep 1
TurionPowerControl -fo 0

With IL ES chips things are a bit more complicated due to Turbo/CPB -- example available there: http://hardforum.com/showpost.php?p=1039116320&postcount=7
 
I don't know anything about your CPUs.


Reality won't change simply because you don't accept it :p
Something is wrong.

Forgot to say I tried upping the frequency just one notch, to 1800Mhz, and the same thing happened.

Firstly, actual command line parameter is -set (with a dash, not a plain set).
Unfortunately, current TPC's command line parsing code design makes it impossible to
tell that you made a mistake.
In other words, the command line you're quoting does exactly nothing.
You should always double check your settings with TurionPowerControl -l.

I did that here, but not when I was messing with the pstates :p

Secondly, "node all core all pstate 0" are redundant and can be omitted (they are the
defaults anyway).

Thanks for the tip ;) saved me a bit of typing.

Thirdly, P-State changes take effect only on CPU's transition to the P-State of interest.
In other words, manipulating P-State 0 while CPU is continuously in P-State 0 does nothing.
Also, with PowerNow enabled, Linux power management can change P-States behind
your back -- it's something you don't usually want.

THIS IS WHAT I MISSED! I forgot to change the p-states - NOW it's working. Let's see if it reboots or not... trying 3GHz at 1.35v. Poor thing consumes 250w more power now. If I'm lucky I'll even make the deadline on this WU :p

That said, general recommendations when dealing with MC ES chips are:

1. Disable PowerNow in the BIOS _or_ set "performance" scaling governor _or_
  set "userspace" scaling governor and set maximal possible frequency

2. Using TPC, set desired P-State's 0 frequency and voltage for each CPU

3. Transition all cores to non-zero P-State (I recommend using low P-State)

4. Transition all cores to P-State 0


For instance (a simple form):
Code:
TurionPowerControl -set freq 3000 vcore 1.25
TurionPowerControl -fo 4
sleep 1
TurionPowerControl -fo 0

With IL ES chips things are a bit more complicated due to Turbo/CPB -- example available there: http://hardforum.com/showpost.php?p=1039116320&postcount=7

Thanks. I'll save a link to your post so I know what to do when my SM 4P boards arrive... got a set of IL chips as well... which seem gooood.
 
I used this on ubuntu 12.04 with 6276 ES cpus and work great... Let me know if you still want some test or report
 
Thanks for checking it out.

I'd say, just use it normally -- there are no outstanding tests to perform at this time.

If no new issues are reported I hope to make 0.44 happen before 2013 :)
 
NB Freq adjustments are already available using the NBFID command, example: /usr/bin/TurionPowerControl -nbfid 8

Because the base rate is different for different systems, it doesn't take the input in MHz, but you can view the result with -spec. Example:
Code:
TurionPowerControl -spec
TurionPowerControl Interlagos-r112M (Turion Power States Optimization and Control - by blackshard)
Northbridge Power States table:
------ Node 0
NbVid 33 (1.1375V) NbDid 0 NbFid 8 NbCOF 2400 MHz
 
NB Freq adjustments are already available using the NBFID command, example: /usr/bin/TurionPowerControl -nbfid 8

Because the base rate is different for different systems, it doesn't take the input in MHz, but you can view the result with -spec. Example:
Code:
TurionPowerControl -spec
TurionPowerControl Interlagos-r112M (Turion Power States Optimization and Control - by blackshard)
Northbridge Power States table:
------ Node 0
NbVid 33 (1.1375V) NbDid 0 NbFid 8 NbCOF 2400 MHz

Ah, thanks. I read somewhere that it wasn't supported as it was in a different registry... but cool to see it's been added. Probably not the most recent post I dug up on the interwebs:p
 
FYI -- NBFID isn't applied until warm reset (sudo reboot or similar).

This works on MC chips but I don't believe it worked for IL chips here (it was long time ago).

You may want to double check application on IL chips (make sure to do warm reset post setup).

Possible verification techniques include:
- power draw comparison on a reference load (for instance, a reference WU that's started from scratch each time)
- comparison of MaxRdLatencies from TurionPowerControl -dram (the higher the NCLK, the higher MaxRdLatency should be)
 
Last edited:
- comparison of MaxRdLatencies from TurionPowerControl -dram (the higher the NCLK, the higher MaxRdLatency should be)

I'll try it out at stock/overclock and post results here (with the fixed version of -dram that works for IL)
 
FYI -- NBFID isn't applied until warm reset (sudo reboot or similar).

This works on MC chips but I don't believe it worked for IL chips here (it was long time ago).

You may want to double check application on IL chips (make sure to do warm reset post setup).

Possible verification techniques include:
- power draw comparison on a reference load (for instance, a reference WU that's started from scratch each time)
- comparison of MaxRdLatencies from TurionPowerControl -dram (the higher the NCLK, the higher MaxRdLatency should be)

Yeah... I also noticed that whenever I change the nbvid, the -spec command shows me that the pstate 0 value is set at 1.55v :p can I ignore this?
 
How do you change it? Where do you see 1.55V? Please paste full command lines and outputs.

Side note -- don't change NBVID initially; first make sure that you can control NBFID.

EDIT: yes, there's a bug in setting NBVID (on IL) -- it actually corrupts some other register; power-cycle your machine and do not set NBVID until it's resolved

EDIT2: still, this shouldn't have manifested unless you modified the source; did you do any source code modifications? if so, what did you change?

EDIT3: are these MC or IL CPUs?

EDIT4: heh, ok, I see what you might have done wrong, you probably swapped the arguments to -nbvid ... it should be -nbvid <p-state> <nbvid> so... -nbvid 0 38 *not* -nbvid 38 0
&#8194;&#8194;&#8194;&#8194;&#8194;&#8194;&#8196;next time please make sure to provide all relevant data ahead of time
 
Last edited:
I definately set it the wrong way (think I used a command like tpc -pstate 0 nbvid 28).

The 1.55v NB voltage is what I read at pstate 0 when running tpc -spec
 
Can you paste your commands and their results verbatim from the terminal?
 
How do you change it? Where do you see 1.55V? Please paste full command lines and outputs.

Side note -- don't change NBVID initially; first make sure that you can control NBFID.

EDIT: yes, there's a bug in setting NBVID (on IL) -- it actually corrupts some other register; power-cycle your machine and do not set NBVID until it's resolved

EDIT2: still, this shouldn't have manifested unless you modified the source; did you do any source code modifications? if so, what did you change?

EDIT3: are these MC or IL CPUs?

EDIT4: heh, ok, I see what you might have done wrong, you probably swapped the arguments to -nbvid ... it should be -nbvid <p-state> <nbvid> so... -nbvid 0 38 *not* -nbvid 38 0
&#8194;&#8194;&#8194;&#8194;&#8194;&#8194;&#8196;next time please make sure to provide all relevant data ahead of time

Yep, noticed that. Thought I had to use the -pstate command. Not sure if it's applied or not, but at least it confirms the clock and voltage are set in some way. Not sure if the increase in power draw from the NB is so high that it's possible to notice it on my wattmeter.

For the record, MC. And I'll provide all relevant information, as long as I realize it's important :p still trying to get used to the terminal commands.
 
If there are issues with TPC (functional or usability), I'd like to find them and possibly fix them before finalizing 0.44.

For that I need your help.

Need to know _exactly_ how you interacted with TPC and how it responded.
 
sudo tpc -nbvid 28 -nbvid 28 -pstate 26

TurionPowerControl export (Turion Power States optimization and Control - by blackshard)
PState.cpp: Wrong PState 28, assuming default PState 0

Done.

sudo tpc -spec
TurioNpowerControl export (Turion Power States Optimization and Control - by blackshard)
Northbridge Power States table
------ Node 0
PState 0 - NbVid 0 (1.5500V) NbDid 0 NbFid 4
PState 1 - NbVid 32 (1.1500V) NbDid 0 NbFid 4
PState 2 - NbVid 32 (1.1500V) NbDid 0 NbFid 4
PState 3 - NbVid 32 (1.1500V) NbDid 0 NbFid 4
PState 4 - NbVid 32 (1.1500V) NbDid 0 NbFid 4
Northbridge Maximum frequency: no maximum frequency, unlocked NB multiplier

Core 0 C1E CMP halt bit is disabled
Core 1 C1E CMP halt bit is disabled
Core 2 C1E CMP halt bit is disabled
Core 3 C1E CMP halt bit is disabled
Core 4 C1E CMP halt bit is disabled
Core 5 C1E CMP halt bit is disabled

Voltage Regulator Slamming time register: 4
Voltage Regulator Step Up Ramp Time: 6
Voltage Regulator Sted Down Ramp Time: 6
Processor PState identifier: 0x0
Processor is using Serial VID Interface (probably Dual Plane mode)
PSI_L bit not enabled
------ Node 1-3
[same as above]

Done.

**********************

So, basically, if you screw it up like this it ignores the -pstate part looking for that 2nd parameter. Why it sets NbVid to 0 I do not know.
 
Sweet :) Thank you!

I've already committed changes to make tpc more resilient to input like that.
Now, I get:
Code:
$ sudo ./TurionPowerControl sudo  -nbvid 28 -nbvid 28 -pstate 26
TurionPowerControl 0.44-rc1 (trunk-r116:120)
Turion Power States Optimization and Control - by blackshard
K10Processor.cpp: PState allowed range: 0-4

Done.
$
(so it refuses to act due to out of range P-state).

Though TPC should have actually failed earlier: -nbvid on Fam10h takes two arguments
and it seems that TPC parses second "-nbvid" as number.

In other words: "-nbvid 28 -nbvid" is an invalid construct on Fam10h and should've failed
at that point... I'll take a look.
 
Perhaps you could add some comments to the readme files on using this tool with IL chips? Doesn't include much info at the moment. Dunno if there are any important differences. Disabling CPB?
 
Yeah, official documentation is lacking quite a lot nowadays.

Contributions are always welcome, though :)
 
If I knew hot to make this thing OC properly I wouldn't mind contributing. I have no clue what i'm doing wrong :p Swapped to my IL's, and it's been nothing but PAIN so far. Glad my 4P boards are on the way...
 
"this thing" -- MCs?

Start a new thread, describe in detail where you are -- we'll see what we can do...
 
http://hardforum.com/showpost.php?p=1039116320&postcount=7 - I'll give this a shot first. :)

Edit: No need for a new thread, it seems like I got it working... I just changed all the pstates to what I wanted it to run at, as well as adding a fan over the hottest set of VRMs. Feels rather stable so far. I'll just leave it at that, until I get my 4P rigs up - then I'll swap CPUs again anyway.
 
Last edited:
I'm trying to setup TPC on Ubuntu 12.04. I did install the "ncurses-dev" before I tried the following. What am I missing?

edward2@TYAN:~$ cd tpc-0.44-rc1/src
edward2@TYAN:~/tpc-0.44-rc1/src$ make
/bin/sh: 1: svn: not found
/bin/sh: 1: svnversion: not found
g++ -O2 -MMD -MF obj/x86_64/.TurionPowerControl.d -MT obj/x86_64/TurionPowerControl.o -c -o obj/x86_64/TurionPowerControl.o TurionPowerControl.cpp
make: g++: Command not found
make: *** [obj/x86_64/TurionPowerControl.o] Error 127
 
C++ compiler.

Code:
sudo apt-get install g++
 
I ran the "sudo apt-get install g++" and then the rest of the TPC install procedure. At first, I thought it was going to work, but now I get the following error when I run "sudo tpc -temp".

TurionPowerControl export (Turion Power States Optimization and Control - by blackshard)
cpuid: open: No such file or directory
cpuid: open: No such file or directory
cpuid: open: No such file or directory
cpuid: open: No such file or directory
cpuid: open: No such file or directory
No supported processor detected, sorry.

If I try to re-make TPC, I get the following error.

edward2@TYAN:~/tpc-0.44-rc1/src$ make
/bin/sh: 1: svn: not found
/bin/sh: 1: svnversion: not found
Build Completed
 
It works !!!

Thanks musky. I forgot about that thread and all of the required packages.
 
Ignore svn error; build completed fine.

You need two modules loaded for TPC operation: cpuid and msr.

It's best if you add them to /etc/modules per musky's guide so
they get loaded automatically.
 
Back
Top