Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Howto: Dynamic CPU speed with Athlon XP and nForce2 boards
View unanswered posts
View posts from last 24 hours

Goto page Previous  1, 2, 3, 4, 5, 6  Next  
Reply to topic    Gentoo Forums Forum Index Documentation, Tips & Tricks
View previous topic :: View next topic  
Author Message
bgradid
Apprentice
Apprentice


Joined: 21 Mar 2005
Posts: 162

PostPosted: Mon Mar 28, 2005 3:05 am    Post subject: Reply with quote

Code:

bash-2.05b# dmesg | grep cpufreq; egrep 'CPU_?FREQ' /usr/src/linux/.config
cpufreq: Detected nForce2 chipset revision C1
cpufreq: FSB changing is maybe unstable and can lead to crashes and data loss.
cpufreq: FSB currently at 167 MHz, FID 9.5
CONFIG_CPU_FREQ=y
# CONFIG_CPU_FREQ_DEBUG is not set
# CONFIG_CPU_FREQ_DEFAULT_GOV_PERFORMANCE is not set
CONFIG_CPU_FREQ_DEFAULT_GOV_USERSPACE=y
# CONFIG_CPU_FREQ_GOV_PERFORMANCE is not set
# CONFIG_CPU_FREQ_GOV_POWERSAVE is not set
CONFIG_CPU_FREQ_GOV_USERSPACE=y
# CONFIG_CPU_FREQ_GOV_ONDEMAND is not set
# CONFIG_CPU_FREQ_TABLE is not set
CONFIG_X86_CPUFREQ_NFORCE2=m
[/code]
Back to top
View user's profile Send private message
michael3
n00b
n00b


Joined: 17 Aug 2004
Posts: 34

PostPosted: Mon Mar 28, 2005 12:43 pm    Post subject: Reply with quote

Quote:

You need the userspace governor, then you will get scaling_setspeed.

Kernel config:
Code:

CONFIG_CPU_FREQ_DEFAULT_GOV_USERSPACE=y
CONFIG_CPU_FREQ_GOV_PERFORMANCE=m
CONFIG_CPU_FREQ_GOV_POWERSAVE=m
CONFIG_CPU_FREQ_GOV_USERSPACE=y


Thanks, it works without any problems!
Back to top
View user's profile Send private message
bgradid
Apprentice
Apprentice


Joined: 21 Mar 2005
Posts: 162

PostPosted: Tue Mar 29, 2005 10:49 pm    Post subject: Reply with quote

bump, any idea why I can't change my frequency?
Back to top
View user's profile Send private message
micmac
l33t
l33t


Joined: 28 Nov 2003
Posts: 996

PostPosted: Wed Mar 30, 2005 3:17 pm    Post subject: Reply with quote

Hi all,

I'm not sure yet but I think disabling C1 Disconnect while using cpufreq_nfoce2 and atxp1 is a good idea and makes the whole setup more stable.
I've made an init-script for autocpufreq. If you want to use it be warned there's no guarantee and you have to adapt the numbers/paths and also check if autocpufreq.py fits your system (thx to woZa). Also the script needs the modules already to be loaded.

/etc/init.d/autocpufreq
#!/sbin/runscript

depend() {
after localmount
}

start() {
ebegin "Starting autocpufreq"
echo `cat $VCORE` > $OLDVCORE
echo $MAXVCORE > $VCORE
echo $(( $MINFSB * $FID * 100)) > $CPUFREQ/scaling_setspeed
echo $MINVCORE > $VCORE
start-stop-daemon --start \
--background \
--make-pidfile \
--pidfile $PIDFILE \
--exec $DAEMON
eend $? "Failed to start autocpufreq."
}

stop() {
ebegin "Stopping autocpufreq"
start-stop-daemon --stop --pidfile $PIDFILE
rm $PIDFILE
echo $(( $MINFSB * $FID * 100)) > $CPUFREQ/scaling_setspeed
echo `cat $OLDVCORE` > $VCORE
echo $(( $BOOTFSB * $FID * 100)) > $CPUFREQ/scaling_setspeed
eend $? "Failed to stop autocpufreq"
}

/etc/conf.d/autocpufreq

# daemon to start
DAEMON=/usr/local/bin/autoCpuFreq.py
PIDFILE=/var/run/autocpufreq.pid
OLDVCORE=/var/run/autocpufreq-oldVCore
#
# ! adjust values !
#
BOOTFSB=133
MAXFSB=133
MAXVCORE=1600
MINFSB=70
MINVCORE=1100
FID=110
VCORE=/sys/bus/i2c/devices/5-0037/cpu0_vid
CPUFREQ=/sys/devices/system/cpu/cpu0/cpufreq


Last edited by micmac on Wed Mar 30, 2005 4:55 pm; edited 3 times in total
Back to top
View user's profile Send private message
woZa
Guru
Guru


Joined: 18 Nov 2003
Posts: 340
Location: The Steel City - UK

PostPosted: Wed Mar 30, 2005 3:59 pm    Post subject: Reply with quote

Good work micmac. That script works a treat for me now... 8)

Don't forget to change the autocpufreq.py file to suite your own needs... Unlike me! Lots of head scratching. I am sure I had done it once already!
_________________
A few months struggling with gentoo is better than a lifetime struggling with windoze!
Back to top
View user's profile Send private message
micmac
l33t
l33t


Joined: 28 Nov 2003
Posts: 996

PostPosted: Wed Mar 30, 2005 4:53 pm    Post subject: Reply with quote

woZa wrote:
Good work micmac. That script works a treat for me now... 8)

Don't forget to change the autocpufreq.py file to suite your own needs... Unlike me! Lots of head scratching. I am sure I had done it once already!


Thx!

What about MAXtemp in the .py-script? Per default it shows true degrees celsius. But I get (true degree celsius * 1000) while doing this:

cat /sys/bus/i2c/devices/4-0290/temp2_input
36000
cat /sys/bus/i2c/devices/4-0290/temp1_input
33000

Should I use something like

MAXtemp=[ 50, 40]
BUFtemp=[ 3, 2]

Or should I use

MAXtemp=[ 50000, 40000]
BUFtemp=[ 3000, 2000]
?

Cheers

mic
Back to top
View user's profile Send private message
woZa
Guru
Guru


Joined: 18 Nov 2003
Posts: 340
Location: The Steel City - UK

PostPosted: Wed Mar 30, 2005 5:06 pm    Post subject: Reply with quote

Code:
MAXtemp=[ 55, 39]
BUFtemp=[  3,  2]


is how I have mine... Haven't tested these yet though. Will give it a go and let you know.



[Edit] - Max temp on cpu works fine. hits the value and lowers the fsb and voltage straight away. [/Edit]
_________________
A few months struggling with gentoo is better than a lifetime struggling with windoze!


Last edited by woZa on Wed Mar 30, 2005 5:18 pm; edited 1 time in total
Back to top
View user's profile Send private message
micmac
l33t
l33t


Joined: 28 Nov 2003
Posts: 996

PostPosted: Wed Mar 30, 2005 5:14 pm    Post subject: Reply with quote

Btw without C1 Disconnect my system doesn't freeze with atxp1/cpufreq_nforce2 (well, until now at least ;-)). Furthermore C1 Disconnect seems redundant while using atxp1/cpufreq_nforce2, the analog out of my soundcard sounds much better without it and my system doesn't feel laggy anymore while running at low speed (1.1V & 770MHz here).

Cheers

mic
Back to top
View user's profile Send private message
PrakashP
Veteran
Veteran


Joined: 27 Oct 2003
Posts: 1249
Location: C.C.A.A., Germania

PostPosted: Wed Mar 30, 2005 10:19 pm    Post subject: Reply with quote

C1 Halt disconnect is not redundant, but with lower frqu the effect is also lower.
Back to top
View user's profile Send private message
woZa
Guru
Guru


Joined: 18 Nov 2003
Posts: 340
Location: The Steel City - UK

PostPosted: Thu Mar 31, 2005 9:51 am    Post subject: Reply with quote

Big thanks to Hasw (the modules), alexejfink (autocpufreq) and micmac (startup scripts). I now have a system that automagically increases/decreases cpu speed and vcore depending on cpuload. Ranges from 1.4Ghz @ 1.1v to 2.5Ghz @ 1.75v.

Now when my new powerbook arrives, this desktop system will become my new server.

All that I need now of for hasw to get off his a*se and write a vdimm module! :wink:
_________________
A few months struggling with gentoo is better than a lifetime struggling with windoze!
Back to top
View user's profile Send private message
Dreameen
n00b
n00b


Joined: 22 Nov 2004
Posts: 7

PostPosted: Sat Apr 02, 2005 6:20 pm    Post subject: Reply with quote

Code:
 LD      init/built-in.o
  LD      vmlinux
drivers/built-in.o(.text+0x8af66): In function `atxp1_detect':
: undefined reference to `i2c_which_vrm'
drivers/built-in.o(.text+0x8ae7e): In function `atxp1_attach_adapter':
: undefined reference to `i2c_detect'
make: *** [vmlinux] Error 1
==> ERROR: Build Failed.  Aborting...


...and the kernel compilation stops. Any idea how to fix this? I've patched the kernel with atxp1-0.6.patch and i2c-vid-vrm90.patch.
Back to top
View user's profile Send private message
woZa
Guru
Guru


Joined: 18 Nov 2003
Posts: 340
Location: The Steel City - UK

PostPosted: Sat Apr 02, 2005 7:54 pm    Post subject: Reply with quote

Using atxp1-0.3 here. Works fine. Undefined symbol reference with 0.6
_________________
A few months struggling with gentoo is better than a lifetime struggling with windoze!
Back to top
View user's profile Send private message
Dreameen
n00b
n00b


Joined: 22 Nov 2004
Posts: 7

PostPosted: Sat Apr 02, 2005 9:27 pm    Post subject: Reply with quote

woZa wrote:
Using atxp1-0.3 here. Works fine. Undefined symbol reference with 0.6


atxp1-0.3 works for me as well. I've stumbled across some problems with the autocpufreq thingy now:

Code:

Traceback (most recent call last):
  File "./autoCpuFreq.py", line 373, in ?
    main()
  File "./autoCpuFreq.py", line 326, in main
    cpufreq = CpuFreqInterface( file_vcore, FID, FSB_vCore)
  File "./autoCpuFreq.py", line 228, in __init__
    self.checkIntegrity()
  File "./autoCpuFreq.py", line 251, in checkIntegrity
    raise RuntimeError, "FSB_vCore pair has invalid FSB-entry"
RuntimeError: FSB_vCore pair has invalid FSB-entry
Back to top
View user's profile Send private message
micmac
l33t
l33t


Joined: 28 Nov 2003
Posts: 996

PostPosted: Sun Apr 03, 2005 3:15 pm    Post subject: Reply with quote

Hi!

At last I think I've found what was really causing the freezing. I have to set the CPU frequency setting to a specific value instead of auto in my bios in order for the atxp1 driver to be able to change the voltage. I had set it to 1600, because I thought my 1700+ defaults to 1,6V when running at full speed. Then I came about this page and it seems there are also 1700+ cpus using only 1,5V. So I set the VCore in the bios the 1500 instead and I've never had a freeze since. For now I've
Code:
append="elevator=deadline cpufreq_nforce2.min_fsb=60"
in my /etc/lilo.conf,
Code:
echo 660000 > /sys/devices/system/cpu/cpu0/cpufreq/scaling_setspeed
echo 1100 > /sys/bus/i2c/devices/2-0037/cpu0_vid
in my /etc/conf.d/local.start and
Code:
echo 1500 > /sys/bus/i2c/devices/2-0037/cpu0_vid
echo 1463000 > /sys/devices/system/cpu/cpu0/cpufreq/scaling_setspeed
in my /etc/conf.d/local.stop and it works. With 1500 it doesn't matter if I en- or disable C1 Disconnect (STPGNT) in the bios. But I disable it anyway, allthough my cpu gets even cooler with it being enabled, because it produces a little noise at my soundcards analog output.

Cheers

micmac
Back to top
View user's profile Send private message
mikeraach
Apprentice
Apprentice


Joined: 20 Jan 2003
Posts: 168

PostPosted: Tue Apr 12, 2005 6:49 am    Post subject: Reply with quote

Does anyone know why my NF7-S board would create prime errors (and program crashes) after changing only a mere 100mhz (10fsb)?

I've tried different bios's and all result with the same thing.
Back to top
View user's profile Send private message
PrakashP
Veteran
Veteran


Joined: 27 Oct 2003
Posts: 1249
Location: C.C.A.A., Germania

PostPosted: Fri May 13, 2005 3:34 pm    Post subject: Reply with quote

I made a patch to cpufreqd to switch Vcore, too. I called it "nvfreqd", which you can find here: http://punnoor.de
Back to top
View user's profile Send private message
micmac
l33t
l33t


Joined: 28 Nov 2003
Posts: 996

PostPosted: Thu May 19, 2005 9:02 pm    Post subject: Reply with quote

PrakashP wrote:
I made a patch to cpufreqd to switch Vcore, too. I called it "nvfreqd", which you can find here: http://punnoor.de


Thanks!

Works here. Does is change vcore before frequency when speed is increased and the other way around when speed is lowered?

Cheers

mic
Back to top
View user's profile Send private message
PrakashP
Veteran
Veteran


Joined: 27 Oct 2003
Posts: 1249
Location: C.C.A.A., Germania

PostPosted: Thu May 19, 2005 10:15 pm    Post subject: Reply with quote

Of course. :)
Back to top
View user's profile Send private message
micmac
l33t
l33t


Joined: 28 Nov 2003
Posts: 996

PostPosted: Fri May 20, 2005 11:01 am    Post subject: Reply with quote

HI PrakashP!

Thanks. But something is wrong on my system. I have 3 different freq/vcore modes. But while doing something cpu intensive cpufreqd doesn't switch to max_power.

Code:
[General]
pidfile=/var/run/cpufreqd.pid
poll_interval=1
pm_type=acpi #(acpi, apm or pmu)
# Uncomment the following line to enable ACPI workaround (see cpufreqd.conf(5))
# acpi_workaround=1
vcore_path=/sys/bus/i2c/devices/6-0037/cpu0_vid
vcore_default=1500
verbosity=4 #(if you want a minimal logging set to 5)

[Profile]
name=max_power
minfreq=1463000
maxfreq=1463000
vcore=1500
policy=userspace

[Profile]
name=med_power
minfreq=1188000
maxfreq=1188000
vcore=1350
policy=userspace

[Profile]
name=min_power
minfreq=913000
maxfreq=913000
vcore=1200
policy=userspace

[Rule]
name=min
cpu_interval=0-40
profile=min_power

[Rule]
name=med
cpu_interval=30-70
profile=med_power

[Rule]
name=max
cpu_interval=60-100
programs=oggenc,mencoder
profile=max_power


Like when I encode music the med_power setting is applied. I'd think cpufreqd would switch to max_power because the encoder takes every bit of cpu it can get. Even
Code:
programs=oggenc,mencoder
doesn't help. Any idea?

While using oggenc I get this instead:
Code:
cat scaling_min_freq cpuinfo_max_freq cpuinfo_min_freq scaling_setspeed
1188000
1232000
1463000
913000
913000


I mean this is weired. First of, it should be max_power. Then scaling_min_freq and scaling_max_freq should be the same. And when both are set to 1188000 and 1232000 why is the actual cpu frequency set to 913000?

Cheers

mic

Cheers

mic
Back to top
View user's profile Send private message
PrakashP
Veteran
Veteran


Joined: 27 Oct 2003
Posts: 1249
Location: C.C.A.A., Germania

PostPosted: Fri May 20, 2005 11:06 am    Post subject: Reply with quote

I also had troubles with policy userspace. Try performance. But the target freq will deviate from your stettings, so you need to do trial and error.

Oh, if you want max_power every time with your progs, set cpu to 0-100 and maybe make a seperate rule for max for dynamic adjust.
Back to top
View user's profile Send private message
micmac
l33t
l33t


Joined: 28 Nov 2003
Posts: 996

PostPosted: Fri May 20, 2005 2:33 pm    Post subject: Reply with quote

Hi!

I've found out why it didn't get full speed while encoding. oggenc was 'niced'. Putting niceness to 0 was the solution. Now it goes all the way up.
I also tried switching the governor to performance. But the mid_power setting still uses different scaling_min_freq and scaling_max_freq from time to time. Well, I guess I got to live it or ask somebody on the lkml, because I take it it's a kernel thing that has nothing to do with cpufreqd.

Anyway

Thank!

mic
Back to top
View user's profile Send private message
micmac
l33t
l33t


Joined: 28 Nov 2003
Posts: 996

PostPosted: Fri May 20, 2005 2:55 pm    Post subject: Reply with quote

Hi again,

on the other hand switching frequencies manually works fine. I don't even have to bother with scaling_setspeed while echoing the same number into scaling_max_freq and scaling_min_freq. So it seems more likely that cpufreqd echoes the number 1232000, allthough I never wrote this number in its config file. With
Code:
minfreq=1188000
maxfreq=1188000

I want cpufreq (nvfreq) to echo 1188000 into scaling_max_freq and scaling_min_freq, not 1232000 :)

Cheers

mic
Back to top
View user's profile Send private message
PrakashP
Veteran
Veteran


Joined: 27 Oct 2003
Posts: 1249
Location: C.C.A.A., Germania

PostPosted: Fri May 20, 2005 3:20 pm    Post subject: Reply with quote

I also observed the thing with niceness. Nevertheless my suggestion would help and you could still nice the process.
Back to top
View user's profile Send private message
Dreameen
n00b
n00b


Joined: 22 Nov 2004
Posts: 7

PostPosted: Sat Jun 18, 2005 5:08 pm    Post subject: Reply with quote

Hm, the atxp module doesn't compile cleanly with the newest stable kernel 2.6.12

Here are the errors:

Code:

LD      init/built-in.o
LD      vmlinux
drivers/built-in.o(.text+0x8fee0): In function `atxp1_detect':
: undefined reference to `i2c_which_vrm'
drivers/built-in.o(.text+0x8fdf6): In function `atxp1_attach_adapter':
: undefined reference to `i2c_detect'
make: *** [vmlinux] Błąd 1
==> ERROR: Build Failed.  Aborting...


I didn't know who to contact, but maybe the author of atxp patch is reading this board and he could fix things up.
Back to top
View user's profile Send private message
Hasw
n00b
n00b


Joined: 31 Dec 2004
Posts: 68
Location: Germany

PostPosted: Sat Jun 18, 2005 10:31 pm    Post subject: Reply with quote

Which version of the ATXP1 module are you using? Are you using the kernel patch? It should be fixed, otherwise it
doesn't cleanly work with 2.6.12. Also the i2c-vid-vrm90.patch needs to be applied.

Can you please PM or mail me:

Code:

grep I2C kernelsource/.config
grep SENSORS kernelsource/.config


The module is missing the two functions i2c_which_vrm and i2c_detect, which are there in 2.6.12. So it's possible that
it hasn't compiled in the i2c_sensor functions (is I2C enabled in your kernel config).

Also the ATXP1 module is in 2.6.12-rc6, it waits to get merged with the stable kernel.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Documentation, Tips & Tricks All times are GMT
Goto page Previous  1, 2, 3, 4, 5, 6  Next
Page 4 of 6

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum