View previous topic :: View next topic |
Author |
Message |
Albert_Alligator Apprentice
Joined: 12 May 2004 Posts: 193 Location: Okefenokee Swamp
|
Posted: Sat Dec 18, 2004 5:34 am Post subject: Getting AMD64 powernow up and working under Gentoo |
|
|
This is from the German forums and I thought that I would post it here in AMD64 to help those get cool-n-quiet running. It worked beautifully for me, and my system now powers down to 801.00MHz when not running anything that needs CPU, and up to 2004.604MHz when compiling.
PS. I've translated this with an online translator, then fixed up the grammar only a little...I hope. If RealGeizt would like to make any corrections, I welcome them. Thanks for your help.
Another thing, I've seen smidgens of this on this site, but nothing this complete except on the German page...so...here it is.
RealGeizt wrote: | hi!
Here is a mini How-to for getting AMD's powernow to work on AMD64.
1) kernel: here is how your kernel config should look
Code: |
[*] Power Management support
CPU Frequency scaling --->
[*] CPU Frequency scaling
< > /proc/cpufreq interface (deprecated)
Default CPUFreq governor (performance) --->
--- 'performance' governor
<*> 'powersave' governor
<*> 'userspace' governor for userspace frequency scaling
[ ] /proc/sys/cpu/ interface (2.4. / OLD)
<*> CPU frequency table helpers
--- CPUFreq processor drivers
<*> AMD Opteron/Athlon64 PowerNow! |
2)emerge cpudyn:
3)Add cpudyn to the default run level, so that it is directly activated when your system boots.
Code: | rc-update add cpudyn default |
4)Modify your cpudyn: in this config you can specify everything exactly to your filesystem
Code: | # Cpudyn configure options
################################################
# COMMON OPTIONS
################################################
#
# Internal between idle ratio tests in 1/10 sec increments
#
INTERVAL=1
################################################
# CPUFREQ OPTIONS
################################################
#
# CPU idle work ratio to speed up
#
CPU_UP=0.5
#
# CPU idle work ratio to speed down
#
CPU_DOWN=0.9
#
# when using cputhrottling, what state to switch when speeding down
#
THROTTLING_LOW=7
#
# Count also niced process in CPU usage. Default is no.
#
#NICE=yes
################################################
# DISK OPTIONS
# (disabled by default)
################################################
#
# Timeout to put the disk in standby mode if there was no
# io during that period (in seconds)
#
TIMEOUT=600
#
# Specified disks to spindown (comma separated devices)
#
DISKS=/dev/hda,/dev/hdb,/dev/hdc
################################################
# Special Startup Options
# (you shouldn't need to change these)
################################################
# cpufreq sources for 2.4 kernels
CPUFREQ_24="/proc/cpufreq"
# cpufreq sources for 2.5/2.6 kernels
CPUFREQ_25="/sys/devices/system/cpu/cpu0/cpufreq /sysfs/devices/system/cpu/cpu0/cpufreq"
# pure acpi cpufreq
CPUFREQ_ACPI="/proc/acpi/processor/CPU0/throttling" |
5)start cpudyn:
Code: | /etc/init.d/cpudyn start |
With
You can monitor your cpu frequency. Mine shows 800MHz in normal mode, 2000MHz under load.
So here is how mine looks:
a)cpu under no load
Code: |
chris@cKy : 2 files 814Kb $ cat /proc/cpuinfo
processor : 0
vendor_id : AuthenticAMD
cpu family : 15
model : 4
model name : AMD Athlon(tm) 64 Processor 3000+
stepping : 8
cpu MHz : 800.059
cache size : 512 KB
fpu : yes
fpu_exception : yes
cpuid level : 1
wp : yes
flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 syscall nx mmxext lm 3dnowext 3dnow
bogomips : 1576.14
TLB size : 1088 4K pages
clflush size : 64
cache_alignment : 64
address sizes : 40 bits physical, 48 bits virtual
power management: ts fid vid ttp |
b)under load situation
Code: | chris@cKy : 2 files 814Kb $ cat /proc/cpuinfo
processor : 0
vendor_id : AuthenticAMD
cpu family : 15
model : 4
model name : AMD Athlon(tm) 64 Processor 3000+
stepping : 8
cpu MHz : 2000.148
cache size : 512 KB
fpu : yes
fpu_exception : yes
cpuid level : 1
wp : yes
flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 syscall nx mmxext lm 3dnowext 3dnow
bogomips : 3940.35
TLB size : 1088 4K pages
clflush size : 64
cache_alignment : 64
address sizes : 40 bits physical, 48 bits virtual
power management: ts fid vid ttp |
Code: | dmesg | grep powernow |
Here you can see whether or not it was activated under your kernel.
Code: | powernow-k8: Found 1 AMD Athlon 64 / Opteron processor(version 1.00.09b)
powernow-k8: 0 : fid 0xc (2000 MHz), vid 0x2 (1500 mV)
powernow-k8: 1 : fid 0xa (1800 MHz), vid 0x6 (1400 mV)
powernow-k8: 2 : fid 0x0 (800 MHz), vid 0xa (1300 mV)
powernow-k8: cpu_init done, current fid 0xc, vid 0x2 |
|
I did this for mine and it works great.
Thanks again to RealGeizt for the walk through.
By the way, here is my powernow specs...
Code: |
powernow-k8: Found 1 AMD Athlon 64 / Opteron processors (version 1.00.09e)
powernow-k8: 0 : fid 0xc (2000 MHz), vid 0x8 (1350 mV)
powernow-k8: 1 : fid 0xa (1800 MHz), vid 0xc (1250 mV)
powernow-k8: 2 : fid 0x8 (1600 MHz), vid 0xe (1200 mV)
powernow-k8: 3 : fid 0x0 (800 MHz), vid 0x17 (975 mV)
|
I seem to have one extra powerlevel than he has shown. And my system seems to be far more power efficient than his...my assumptions are that his isn't an AMD64 mobile.
However, my CPU does seem to be very similar to his;
Code: |
processor : 0
vendor_id : AuthenticAMD
cpu family : 15
model : 28
model name : Mobile AMD Athlon 64 Processor 3000+
stepping : 0
cpu MHz : 801.841
cache size : 512 KB
fpu : yes
fpu_exception : yes
cpuid level : 1
wp : yes
flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmovpat pse36 clflush mmx fxsr sse sse2 pni syscall nx mmxext fxsr_opt lm 3dnowext 3dnow
bogomips : 1579.41
TLB size : 1088 4K pages
clflush size : 64
cache_alignment : 64
address sizes : 40 bits physical, 48 bits virtual
power management: ts fid vid ttp
|
Cheers,
Al _________________ As Socrates once said "I drank what?" |
|
Back to top |
|
|
dangertools Apprentice
Joined: 29 Dec 2003 Posts: 278 Location: Saalfelden, Austria
|
Posted: Sat Dec 18, 2004 11:40 am Post subject: |
|
|
would be interesting to know why you want to use a usersapce tool for scaling the speeds. Since 2.6.9 there is a new power-governour in the vanilla-sources called ondemand which is able to do all of the work without any usertools. |
|
Back to top |
|
|
PC_Freak n00b
Joined: 29 Dec 2003 Posts: 63
|
Posted: Sat Dec 18, 2004 1:41 pm Post subject: |
|
|
Thanks for the guide. I have the same CPU as you, and that config works very well.
Code: | # dmesg | grep powernow
powernow-k8: Found 1 AMD Athlon 64 / Opteron processors (version 1.00.09b)
powernow-k8: 0 : fid 0x0 (800 MHz), vid 0xa (1300 mV)
powernow-k8: 1 : fid 0xa (1800 MHz), vid 0x6 (1400 mV)
powernow-k8: 2 : fid 0xc (2000 MHz), vid 0x2 (1500 mV)
powernow-k8: cpu_init done, current fid 0xc, vid 0x2 |
This is the speed it's running on under normal working conditions:
Code: | # cat /proc/cpuinfo
processor : 0
vendor_id : AuthenticAMD
cpu family : 15
model : 4
model name : AMD Athlon(tm) 64 Processor 3000+
stepping : 8
cpu MHz : 798.250
cache size : 512 KB
fpu : yes
fpu_exception : yes
cpuid level : 1
wp : yes
flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 syscall nx mmxext lm 3dnowext 3dnow
bogomips : 1582.69
TLB size : 1088 4K pages
clflush size : 64
cache_alignment : 64
address sizes : 40 bits physical, 48 bits virtual
power management: ts fid vid ttp |
Als, I changed the TIMEOUT value in the cpudyn config file to 3600 so the hard drive will go in standby after an hour without disk activity (however I doubt this will occur very happen since cronjobs are being runt on the system). |
|
Back to top |
|
|
danyer Tux's lil' helper
Joined: 25 Nov 2004 Posts: 86 Location: Bucharest, Romania/EU
|
Posted: Sat Dec 18, 2004 2:49 pm Post subject: ondemand governor |
|
|
I agree with dangertools.
The guide Albert_Alligator provided is good, but since kernel 2.6.9 the usage of cpudyn is obsolete. The ondemand governor is the new way.
I have ondemand governor compiled in kernel and set up as the default governor, and my amd64 works cool'n quiet (1000, 1800, 2000, 2200 mhz and the voltage changing from 1.06 to 1.46V) without any userspace tools.
echo ondemand > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor
(everything on one line) and you are set to go.
Warning: make sure that the ondemand governor is compiled in the kernel by typing:
cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_available_governors
on my computer I get: ondemand powersave userspace performance |
|
Back to top |
|
|
sharmaravi n00b
Joined: 05 Apr 2004 Posts: 29
|
Posted: Sat Dec 18, 2004 3:37 pm Post subject: |
|
|
I get these messages when I enable powernow-k8 in my kernel.
powernow-k8: invalid freq entries 3300000 kHz vs. 2147483048 kHz
powernow-k8: invalid freq entries 3300000 kHz vs. 2147483048 kHz
powernow-k8: invalid freq entries 3300000 kHz vs. 2147483048 kHz
powernow-k8: invalid freq entries 3300000 kHz vs. 2147483048 kHz
powernow-k8: invalid freq entries 3300000 kHz vs. 2147483048 kHz
powernow-k8: invalid freq entries 3300000 kHz vs. 2147483048 kHz
powernow-k8: invalid freq entries 3300000 kHz vs. 2147483048 kHz
powernow-k8: 0 : fid 0xc (2000 MHz), vid 0x2 (1500 mV)
powernow-k8: 1 : fid 0xa (1800 MHz), vid 0x6 (1400 mV)
powernow-k8: 2 : fid 0x0 (800 MHz), vid 0xa (1300 mV)
powernow-k8: cpu_init done, current fid 0xc, vid 0x0
Due to this I never tried setting it up fully... right now I have it removed from kernel and living with 2000MHz. |
|
Back to top |
|
|
PC_Freak n00b
Joined: 29 Dec 2003 Posts: 63
|
Posted: Sat Dec 18, 2004 3:50 pm Post subject: Re: ondemand governor |
|
|
danyer wrote: | I agree with dangertools.
The guide Albert_Alligator provided is good, but since kernel 2.6.9 the usage of cpudyn is obsolete. The ondemand governor is the new way.
I have ondemand governor compiled in kernel and set up as the default governor, and my amd64 works cool'n quiet (1000, 1800, 2000, 2200 mhz and the voltage changing from 1.06 to 1.46V) without any userspace tools.
echo ondemand > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor
(everything on one line) and you are set to go.
Warning: make sure that the ondemand governor is compiled in the kernel by typing:
cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_available_governors
on my computer I get: ondemand powersave userspace performance | Thanks, that works too. The frequency is also about 800 MHz in normal conditions, so it does practically the same.
Edit: any idea how I can set the scaling governor to ondemand automatically at startup or in the kernel? After a restart it it reset to performance. |
|
Back to top |
|
|
dangertools Apprentice
Joined: 29 Dec 2003 Posts: 278 Location: Saalfelden, Austria
|
Posted: Sat Dec 18, 2004 4:25 pm Post subject: |
|
|
insert the line to /etc/conf.d/local.start |
|
Back to top |
|
|
PC_Freak n00b
Joined: 29 Dec 2003 Posts: 63
|
Posted: Sat Dec 18, 2004 4:36 pm Post subject: |
|
|
dangertools wrote: | insert the line to /etc/conf.d/local.start | Thanks |
|
Back to top |
|
|
tnt Veteran
Joined: 27 Feb 2004 Posts: 1222
|
Posted: Sun Dec 19, 2004 4:30 am Post subject: |
|
|
Most of CPU-s need much less voltage than it's specified. I use Athlon64 3000+ (Newcatle core, 2000MHz default at 1.5V, C'n'Q 1000MHz at 1.1V default) and here are minimum voltages it can stable operate on (tested by several hours of "primeing"):
http://www.aaen.edu.yu/~tnt/graf.png
|
|
Back to top |
|
|
robet l33t
Joined: 06 Sep 2004 Posts: 807 Location: Earth/NorthAmerica/USA/NY
|
|
Back to top |
|
|
user124 Tux's lil' helper
Joined: 02 May 2002 Posts: 86
|
Posted: Sat Jan 15, 2005 5:11 pm Post subject: |
|
|
@robet: i've added some to the wiki-page.
someone should re-read it because english is'nt my default language |
|
Back to top |
|
|
[loki] n00b
Joined: 07 Jul 2002 Posts: 29 Location: Granby / Québec
|
Posted: Sun Jan 16, 2005 7:25 pm Post subject: |
|
|
I have a weird problem whenever I try to use frequency scaling on my computer : the sound output (using Alsa) is muted and there's nothing I can do about it.
I have an Athlon64 2800+ with a AOpen AK86-L motherboard using the VIA K8T800 chipset. The audio controller is (according to lspci) :
Code: | 0000:00:11.5 Multimedia audio controller: VIA Technologies, Inc. VT8233/A/8235/8237 AC97 Audio Controller (rev 60) |
Any toughts? _________________ « L'absurdité est surtout le divorce de l'homme et du monde. »
-Albert Camus (L'étranger) |
|
Back to top |
|
|
robet l33t
Joined: 06 Sep 2004 Posts: 807 Location: Earth/NorthAmerica/USA/NY
|
Posted: Sun Jan 16, 2005 9:09 pm Post subject: |
|
|
user124 wrote: | @robet: i've added some to the wiki-page.
someone should re-read it because english is'nt my default language | Will do.
@[loki]: No clue, but I know that VIA soundcard has a few issues, in general. _________________ no software patents in europe! | adopt an unanswered post. |
|
Back to top |
|
|
robet l33t
Joined: 06 Sep 2004 Posts: 807 Location: Earth/NorthAmerica/USA/NY
|
|
Back to top |
|
|
Greven Tux's lil' helper
Joined: 28 Jul 2002 Posts: 138
|
Posted: Fri Jan 21, 2005 10:23 pm Post subject: |
|
|
Has anyone had problems with losing there keyboard?
I trying trying to see if it's the governors or some other problem. _________________ veritas vos liberabit...
Linux User Number: 346805
Wine-Wiki
AMD 64 3500+ | MSI "K8T NEO2-FIR" | mushkin Dual Channel DDR 400 |
|
Back to top |
|
|
emes Tux's lil' helper
Joined: 29 Jul 2004 Posts: 87
|
Posted: Sat Jan 22, 2005 9:33 pm Post subject: |
|
|
I have a sempron, but these instructions work for it too (though i had to apply this kernel patch).
I dont have an amd64, but I assume the precedure would be the same... how do I lower the cpu fan speed when the cpu is running at its lower speed? I have an asus K8V. |
|
Back to top |
|
|
TL_Amitola n00b
Joined: 25 Jan 2004 Posts: 69 Location: Utah, USA
|
Posted: Fri Feb 25, 2005 6:41 am Post subject: |
|
|
It is my understanding that most fan speed control is done on the Motherboard level... For my system at least (MSI K8N Neo2 Plat. AMD64 3500+) the fans automatically scale their speed based on temperature or load or something.... either way I can hear them kick up the speed when alot of work is being done... _________________ :-/ |
|
Back to top |
|
|
Teh Penguin D00d n00b
Joined: 31 Dec 2004 Posts: 35 Location: Tampa, FL
|
Posted: Fri Feb 25, 2005 9:59 pm Post subject: Hmm... |
|
|
...i'm assuming this is mostly for laptops. As I find people runnig their desktops at low speeds a bit...well...whatever...
...anywho...how much of an increase in battery life are we talking about with the underclock. To drop 1000 MHz seems like it would allow for a significant increase in battery life...I've heard about mobile A64's only having a life of 2 - 3 hours.
Reguarding the remark about an Athlon 64 Mobile chip...I didn't think that they existed. I thought A64 Mobile = Turion. And turion is slated for an April 16th release...
Also, if I was correct, and these are laptops; which type? I'm hunting a laptop. My wants are that all the hardware is Linux supported, 64 bit processor, nice battery life, and wireless promiscous mode supported by the card. |
|
Back to top |
|
|
hvengel Guru
Joined: 19 Sep 2004 Posts: 515
|
Posted: Sun Feb 27, 2005 3:33 am Post subject: |
|
|
All amd64 other than the Opterons have speed scaling as a standard feature. Many desktop users of the amd64s setup their machines to speed scale because it reduces power consumption, heat and (if the fan is speed controlled) noise.
If your motherboard allows for the control of fan speeds by an external program you can use lm-sensors to implement this. Lm-sensors has a set of bash scripts for configuring fan control and then to control the fan using the resulting configuration. |
|
Back to top |
|
|
Karsten from Berlin Guru
Joined: 28 Feb 2004 Posts: 446 Location: Berlin/Germany
|
Posted: Sun Feb 27, 2005 4:02 am Post subject: |
|
|
Yes, would be nice, if everything would work 'from the scratch'.
Guys, take a look what the kernel offers you. You normaly have only to say 'YES'' to the governor mentioned obove. That will work fine. There's absolutely no need anymore to make a lot of work.
Never forget: AMD __NEVER__ said aboud something getting down the fan speed! The whole magic of 'Cool'n'Quiet' is, from AMD's point of view, that the mainboard-manufacturer is able to program a mechanism to slow down the fans. The point that is delivered by AMD is, that it is granted, that the __CPU__ (not the fan__!!!__) will slow down when idle and therefore will produce less heat. But here was never anger about 'my fans will not lower it's speed'. 'Cool'n'Quiet' only says: "When idle, I will consume not so much power." The fan-thing belongs to the manufacturer of the motherboard. If they can't get the fan-thing to work, it's not the fault of AMD.
I know the problem, my MoBo is a MSI's one. C'n'Q works fine so far (frequency is changing), but the fan-control is still not working. _________________ Heaven: The police are British, the chefs Italian, the mechanics German, the lovers French and it's organized by the Swiss.
Hell: The police are German, the chefs British, the mechanics French, the lovers Swiss and it's organized by the Italians. |
|
Back to top |
|
|
TerranAce007 Apprentice
Joined: 13 Dec 2004 Posts: 281 Location: Texas
|
Posted: Sun Feb 27, 2005 5:37 am Post subject: |
|
|
With KDE 3.3.2, just enabling the cpu throttling in the kernel config, then setting the governers in the KDE control panel -> laptop battery section works for me. KDE also dims my LCD automatically when I unplug. Didn't have to change anything in xorg.conf either. At first, I couldn't figure out why cpufreqd wouldn't work, then I discovered KDE was already using clock throttling. I setup the runlevel switching and laptop-mode scripts with acpid, and also used the power management script for the wifi card, and have a great power management setup. _________________ It's all funny until someone gets hurt.
Then it's hilarious. |
|
Back to top |
|
|
infract n00b
Joined: 14 Aug 2003 Posts: 10
|
Posted: Sun Feb 27, 2005 6:48 am Post subject: |
|
|
Excellent tutorial, thanks. I loaded this up with my 2.6.10-ck3 kernel. (which I compiled about 20 minutes ago, and has noticably sped up the boot sequence, might I add)
Code: | starkravingmad root # dmesg | grep powernow
powernow-k8: Found 1 AMD Athlon 64 / Opteron processors (version 1.00.09e)
powernow-k8: 0 : fid 0xe (2200 MHz), vid 0x2 (1500 mV)
powernow-k8: 1 : fid 0xc (2000 MHz), vid 0x6 (1400 mV)
powernow-k8: 2 : fid 0xa (1800 MHz), vid 0xa (1300 mV)
powernow-k8: 3 : fid 0x2 (1000 MHz), vid 0x12 (1100 mV) |
|
|
Back to top |
|
|
xordan Tux's lil' helper
Joined: 30 Aug 2004 Posts: 148
|
Posted: Sun Feb 27, 2005 12:32 pm Post subject: |
|
|
heh, my PC locks up after a few minutes of using this |
|
Back to top |
|
|
hvengel Guru
Joined: 19 Sep 2004 Posts: 515
|
Posted: Mon Feb 28, 2005 2:46 am Post subject: |
|
|
tnt wrote: | Most of CPU-s need much less voltage than it's specified. I use Athlon64 3000+ (Newcatle core, 2000MHz default at 1.5V, C'n'Q 1000MHz at 1.1V default) and here are minimum voltages it can stable operate on (tested by several hours of "primeing"):
http://www.aaen.edu.yu/~tnt/graf.png
|
What I would like to know is what I need to change to get ondemand to use non-default voltages. I am running a 3500 Winchester core and the default voltages are stable but probably higher than they need to be. Lower voltage has way more impact on CPU heat than does freq. The relationship is that power consumption changes in proportion to the change in freq and in proportion to the square of the change in voltage. So very small reductions in voltage will have a significant impact on how much power the cpu needs.
So were is this set and how do I change this? |
|
Back to top |
|
|
TerranAce007 Apprentice
Joined: 13 Dec 2004 Posts: 281 Location: Texas
|
Posted: Mon Feb 28, 2005 3:00 am Post subject: |
|
|
But with lower voltages, you risk instability. The cpu might be able to operate at a certian clockspeed with a lower voltage, but once a load gets applied, you need that power. For conserving power, it is a good idea, but leave the voltage at default for the max scaling speed so the power is there when you need it. _________________ It's all funny until someone gets hurt.
Then it's hilarious. |
|
Back to top |
|
|
|