This website is not maintained anymore. If you want to keep track of me or my projects (or hire me) check www.conveniencefactory.com or follow me @conveniencedev

Ruwebit
HARDWARE REVIEWS, DIY PROJECTS, IN-DEPTH ARTICLES
Start DIY projectsReviewsHow-to'sNewsAutomotiveAbout the websiteArchive | Most popularLast updatedTags Sitemap
amdbloghow-to'slinux
Wrapper script for k10ctl (v0.05)
Download article as PDF
By Maurice on March 25, 2010 (update on April 16, 2010) popularity:
k10ctl is a tool to configure your Phenom II (K10) processor from a Linux commandline. You can use it to change the frequency and voltage of the CPU and NorthBridge for each 'powerstate'. It's a very powerful tool. However it's also a little hard, thus error prone, to use.
!!! DISCLAIMER !!!

THE USE OF K10CTL AND K10CTL_WRAPPER CAN DAMAGE YOUR HARDWARE. IF YOU DON'T KNOW WHAT OVERCLOCKING AND OVERVOLTING MEANS, GET OUT OF HERE NOW. IF YOU DAMAGE YOUR HARDWARE DON'T START WHINING.

And that's why I wrote a little shellscript, and if the disclaimer above didn't scare you off it's here for you to make your life a bit easier.

Prerequisites

Download k10ctl here at sourceforge
Take note of the fact that Stefan Ziegenbalg is the author of k10ctl
Read about the requirements for k10ctl at the developer's site and install k10ctl on your system
Read that manual and try to understand the formulas, it can be very educational
To fully take advantage of frequency scaling (ak throttling) be sure that the cpufreq utils are installed on your system
Keep in mind that P0 is the highest powerstate, P3 is the lowest powerstate
Please note that the script only works for the serial VID interface - more info

Download and installation

Download the wrapper script here: k10ctl_wrapper.v0.05.tar.gz

Revision history

# 0.01 Initial version
# 0.02 Fixed lower multipliers
# 0.03 NB divider, not multiplier ;-)
# 0.04 Made NB settings optional
# 0.05 Fixed half multipliers

Unpack it:

tar -zxvf k10ctl_wrapper.v0.04.tar.gz

Copy both k10ctl_wrapper and k10_overview to /usr/bin or something:

cd k10ctl_wrapper.v0.04
cp * /usr/bin


k10_wrapper usage:

Use: powermode k10ctl_wrapper cpu_voltage cpu_multiplier 


Where:

powermode Powermode (0=P0, 1=P1.. 3=P3, P3=lowest)
cpu_voltage CPU voltage in mV (eg. 1100)
cpu_multiplier CPU multiplier (eg. 12.5, >= 2)
nb_voltage NorthBridge voltage ( eg. 1100), optional
nb_divider NorthBridge divider (1 or 2, where 2 is half speed), optional

Note 1: the script applies the settings to all cores of the processor
Note 2: the script doesn't check if the power values are valid, caution!
Note 3: changes are not reflected in cpufreq-info
Note 4: according to Stefan Ziegenbalg (the author of k10ctl) the voltage and divider of the
current Phenoms and Phemom IIs on the market cannot be changed after booting (Q1 2010).
Doing it anyway can result in unspecified behaviour.

Example usage:

k10ctl_wrapper 3 800 2

This will cause the processor's cores to run on 2x the reference speed (normally 2x 200 =
400 MHz in P3 powermode. In this mode the CPU will run on 1.0V.


k10_wrapper examples:

Don't copy paste these examples blindly, they work with my processor (AMD Phenom II 965 BE) and motherboard (Asus M3A78 Pro) combination, but can damage yours!

About my system
I'm running a Phenom II 965 C3 Black Edition on an Asus M378 Pro board. Using 2x 2GB Kingston DDR2 800 MHz ECC memory. This is our home server, running 24/7 (on openSUSE 11.2 linux). Besides on overclocking and overvolting I mainly focus on underclocking and undervolting to get the system's idle power consumption as low as possible.

I use k10ctl by the way mostly for underclocking and undervolting my 24/7 home server.

For powerstate P3 set the CPU to 400 MHz (assuming that your reference speed is 200 MHz) and 0.9V. Set the NorthBridge multiplier to 1x (I assume that this is a different NB multiplier than found in the BIOS, setting it to 2x crashed my system) at 0.9V:

k10ctl_wrapper 3 900 2 900 1

For powerstate P0 overclock the processor to 4 GHz at 1.55V, keeping the NorthBridge at 1x at 0.9V.

k10ctl_wrapper 0 1550 20 900 1

Quite an overclock right? Superpi 20 in 13.833 seconds And I have to say that I put the HT and NB speed in the BIOS at the LOWEST possible (don't know the setting by hearth at the moment).

k10_overview

To make use of frequency scaling you should ensure that the governor is set to 'ondemand' or 'powersave' (I recommend 'ondemand'). See:

man cpufreq-set

Note that the cpufreq utils don't update the frequencies when they are set through k10ctl. Also the bogomips count (cat /proc/cpuinfo) is not updated. I created a script to view the current frequencies of all cores, it's also in the tar.gz file above: k10_overview.

The output of the script is as follows (note that I have a Phenom II stepping C3 processor which supports indepent scaling of frequencies per core):

Core 0: 3800 2800 2000 [400]
Core 1: 3800 [2800] 2000 400
Core 2: 3800 2800 2000 [400]
Core 3: [3800] 2800 2000 400

Run it in a watch to see how the load is distributed over the cores:

watch k10_overview

Thoughts, tips, findings, notes

Tip: you can create shellscripts for different system profiles
I don't know what the 1x and 2x NorthBridge multiplier exactly does, 2x crashed my system
I accidently swapped P0 and P3 states once (thus the speed @ P3 > P2 > P1 > P0 instead of the other way around) and it crahsed my system
I can get my 965 BE C3 stable in P0 on 400 MHz @ 800 mV (thats the 2x multiplier). A higher voltage (like 900 mV) crashes the system
When I set the CPU NorthBridge voltage in the BIOS for my 965 BE C3 it is only set for P0 (checked with k10ctl 0-3)
When I set the NB voltage (NBvid) to an absurdly low voltage of 600 mV for my 965 BE C3 my system crashes. That's good news, because it looks like that it's possible to change the voltage after booting! This crash was probably cause for other reasons
When I set the NB voltage for my 965 BE C3 to 900 mV for all powerstates, the system doesn't get instable That's because the voltage can't be changed
NB voltage and divider cannot be changed after booting, behaviour after changing it anyway is unspecified so I recommend against it
With my 965 BE C3, keeping the NB speed in the BIOS at auto (2000 MHz) and setting the HT speed to 400 MHz doesn't seem to affect any (non video-related) benchmarks. 200 MHz HT didn't boot.
The cpufreq utils don't detect any changes of frequency (made with k10ctl). However when a core is disabled and enabled again, the changes are reflected
Frequency scaling causes voltage drops/spikes. This means, when overclocking or undervolting you can reach higher speeds and lower voltages when 'Cool n Quiet' is turned off (or when the cpufreq governor is set to performance). As and example: on 3.6 GHz I reached 1.125V stable with the performance governor, and 'only' 1.3V stable with the ondemand governor. However, I wouldn't recommend turning Cool 'n Quiet off.

Last update notes

Latest scripts can be found here, no support

Copyright © 1999-2010 by Maurice de Bijl. This article was published on 2010-03-25, the last update was done on 2010-04-16 in amd  blog  how-to's  linux

Was this article useful to you? Please help me by using the toolbar below to tweet the article, give it an eKudo or add it to Hyves, Facebook, Delicous, Digg or another site. Thanks!

Download article as PDF

POPULAR TAGS
Show all tags
SEARCH KEYWORD
FOLLOW ME
Twitter