You are not logged in.

#1 2005-09-20 10:00:10

Beresford
Member
Registered: 2005-07-31
Posts: 23

I need an expert - CPU Scaling - AthlonXP-M [SOLVED]

Ok, I know this has been asked a million times before, but I've just can't figure out how get cpu scaling working. It's mainly the cpu fan running the whole time that is driving me insane.
Can someone please take the time and help me out with this, I would really appreciate it?

Specs:
Asus A2D
Athlon XP -M CPU

I'm running Arch 0.7, which I upgrade with pacman -Su.
I'm on the stock kernel, 2.6.12 I think.
The fan does go off when I unplug the AC adapter and then only comes on infrequently, a lot like it does in WindowsXP. Except in Windows I can leave my laptop plugged into the mains.

Let me know if more information is required, and if you can what commands I need to type.

Thank you.
Beresford

Offline

#2 2005-09-20 20:11:41

phrakture
Arch Overlord
From: behind you
Registered: 2003-10-29
Posts: 7,879
Website

Re: I need an expert - CPU Scaling - AthlonXP-M [SOLVED]

First, you need to load up the proper cpufreq module.  I'm not sure if you need the k7 one or nforce, so I'll guess  :?

modprobe powernow-k7

Next you need to load your governor.  I use "ondemand"

modprobe cpufreq-ondemand

Other options include "userspace", "powersave", "performance", and maybe something I missed.

If you load more than one governor, you need to tell the system which governor to use.

echo -n "ondemand" > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor

Then you set the minimum and maximim frequencies

echo -n 1250000 > /sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq
echo -n 3000000 > /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq

In addition, the cpufrequtils in the [community] repo is a layer on top of this stuff, allowing you to set these values like so:

cpufreq-set -g ondemand -d 1250MHz -u 3GHz

I have also added a startup script which will automate this task on boot for you.  It should also save you the task of modprobing the proper governor, but I think that part is broken (I will fix later).

This page might also be of assistance:
http://www.ovro.caltech.edu/~abeard/FC3 … rnors.html

Offline

#3 2005-09-20 21:33:22

Blind
Member
From: Desert mountain
Registered: 2005-02-06
Posts: 386

Re: I need an expert - CPU Scaling - AthlonXP-M [SOLVED]

Hey phracture,

Maybe you can add this into a nice script altoghether? Or is it not needed?

#!/bin/sh
#
# description: Switches the fan control on

. /etc/rc.conf
. /etc/rc.d/functions

case "$1" in
    start)
      stat_busy "Starting fan control"
      # Turn fans on
      echo -n 0 > /proc/acpi/fan/FN1/state
      echo -n 0 > /proc/acpi/fan/FN2/state
      # Format: Critical:Hot:Passive:Active0:Active1
      echo -n "80:70:65:55:50" > /proc/acpi/thermal_zone/THRM/trip_points
      # Activate the kernel's temperature control system
      echo 60 > /proc/acpi/thermal_zone/THRM/polling_frequency
      # Turn fans off
      echo -n 3 > /proc/acpi/fan/FN1/state
      echo -n 3 > /proc/acpi/fan/FN2/state
      stat_done
      ;;
    stop)
      stat_busy "Stopping fan control"
      # Turn fans on
      echo -n 0 > /proc/acpi/fan/FN1/state
      echo -n 0 > /proc/acpi/fan/FN2/state
      stat_done
      ;;
    status)
      echo -n "Fan 1 "
      cat /proc/acpi/fan/FN1/state
      echo -n "Fan 2 "
      cat /proc/acpi/fan/FN2/state
      ;;
    restart)
      $0 stop
      $0 start
      ;;
    *)
      echo "usage: $0 {start|restart|stop|status}"
esac

exit 0

That is something I put together after some internet research. It turns the fans on according to the trip points set.

Cheers,
Blind

Offline

#4 2005-09-20 21:46:01

Beresford
Member
Registered: 2005-07-31
Posts: 23

Re: I need an expert - CPU Scaling - AthlonXP-M [SOLVED]

Thanks for the reply.

I've tried the modprobe powernow-k7 (that was also my guess), but I get an error hardware doesn't exist. I'm not at my laptop at the moment so I can't give you the exact error. I will do that tonight.

I was leaning towards there being something missing in the standard kernel, maybe cpuid, I can't remember off by hand since I'm new to this kind of thing.
I'm hoping this is not the case because I'm not very good at compiling kernels.

Offline

#5 2005-09-20 21:49:13

phrakture
Arch Overlord
From: behind you
Registered: 2003-10-29
Posts: 7,879
Website

Re: I need an expert - CPU Scaling - AthlonXP-M [SOLVED]

Beresford wrote:

Thanks for the reply.

I've tried the modprobe powernow-k7 (that was also my guess), but I get an error hardware doesn't exist. I'm not at my laptop at the moment so I can't give you the exact error. I will do that tonight.

I was leaning towards there being something missing in the standard kernel, maybe cpuid, I can't remember off by hand since I'm new to this kind of thing.
I'm hoping this is not the case because I'm not very good at compiling kernels.

try cpufreq-nforce

Offline

#6 2005-09-20 21:52:14

phrakture
Arch Overlord
From: behind you
Registered: 2003-10-29
Posts: 7,879
Website

Re: I need an expert - CPU Scaling - AthlonXP-M [SOLVED]

Blind wrote:

Maybe you can add this into a nice script altoghether? Or is it not needed?

...snip...

That is something I put together after some internet research. It turns the fans on according to the trip points set.

OMG, you're my hero.  I'm going to test this out tonight.  I don't think it belongs in the cpufrequtils package, but it might be a nice addition to the acpi package.... I'll see what I can do

Offline

#7 2005-09-20 23:31:16

Blind
Member
From: Desert mountain
Registered: 2005-02-06
Posts: 386

Re: I need an expert - CPU Scaling - AthlonXP-M [SOLVED]

smile
Naah, I have just been experimenting. What would be really nice is that you kinda look for battery and chose your governor accordingly - at least when you start the computer. I will look into that.
Cheers,
Blind

Offline

#8 2005-09-21 00:45:10

Beresford
Member
Registered: 2005-07-31
Posts: 23

Re: I need an expert - CPU Scaling - AthlonXP-M [SOLVED]

This is the error I'm getting:
FATAL: Error inserting powernow_k7 (/lib/modules/linux-2.6.12-ARCH/kernel/arch/i386/kernel/cpu/cpufreq/powernow_k7.ko): no such device.

This happens with any module I try, I've tried all the modules listed under
/lib/modules/linux-2.6.12-ARCH/kernel/arch/i386/kernel/cpu/cpufreq
and everytime I get the same error.

If I try cpufreq-nforce, it says module doesn't exist. I don't think this will work anyway because I've got a SiS chipset.

Offline

#9 2005-09-21 03:09:12

phrakture
Arch Overlord
From: behind you
Registered: 2003-10-29
Posts: 7,879
Website

Re: I need an expert - CPU Scaling - AthlonXP-M [SOLVED]

Blind wrote:

smile
Naah, I have just been experimenting. What would be really nice is that you kinda look for battery and chose your governor accordingly - at least when you start the computer. I will look into that.
Cheers,
Blind

turns out I can't control my laptop fan via acpi 8(

Offline

#10 2005-09-21 03:42:58

Blind
Member
From: Desert mountain
Registered: 2005-02-06
Posts: 386

Re: I need an expert - CPU Scaling - AthlonXP-M [SOLVED]

That is strange, though. :?
Do you have
/proc/acpi/fan/FN?/state
?
Cause it turns out that - in order to control the fan - you first have to turn them 'on' (echo -n 0 ...) and then 'off' (echo -n 3 ...) at the first time (as done in the script).
The other thing is that you can fool around with the trip points and see if they do something for you - but be careful, or your CPU will be fried.
Good luck,
Blind

Offline

#11 2005-09-21 09:27:44

stasiek
Member
Registered: 2005-07-10
Posts: 16

Re: I need an expert - CPU Scaling - AthlonXP-M [SOLVED]

The problem with powernow-k7 has been discussed here:
http://bbs.archlinux.org/viewtopic.php?t=13669

Best regards
Michal Stanislawski

Offline

#12 2005-09-23 10:43:09

Beresford
Member
Registered: 2005-07-31
Posts: 23

Re: I need an expert - CPU Scaling - AthlonXP-M [SOLVED]

Thanks for that. I will have a read. I've actually moved back to Windows now  :oops: I just got tired of struggling.

But I will keep it in mind the next time I try to go Linux.

Thanks for everyone's help and time.

Offline

Board footer

Powered by FluxBB