Forums

Skip to content

Advanced search
  • Quick links
    • Unanswered topics
    • Active topics
    • Search
  • FAQ
  • Login
  • Register
  • Board index Architectures & Platforms Gentoo on AMD64
  • Search

Longer battery life for Athlon64 and Turion laptops

Have an x86-64 problem? Post here.
Locked
Advanced search
17 posts • Page 1 of 1
Author
Message
Elmo234
n00b
n00b
Posts: 48
Joined: Fri Oct 08, 2004 7:52 pm

Longer battery life for Athlon64 and Turion laptops

  • Quote

Post by Elmo234 » Wed Mar 15, 2006 10:15 pm

Hi!

I started developing a new program. The first version is out now :)
It is a daemon to replace powernowd, cpufreqd, etc...

It is more configurable and it lets you override the voltage of AMD K8 core cpu's (Athlon 64, Opteron and some Semprons) and Pentuim-M (centrino) and Celeron-M from Intel.

After a few test I found that my athlon 64 processor was able to work at 1,2v at 1800Mhz and 0,8v at 800Mhz (AMD it has to work at 1,5 and 1,1v). This makes the cpu run cooler and I have almos 30 minutes more of battery life.

So you can have a try if you want...

www.tuxamito.com.es/cpupw/ Here you will find a lot more of information.

Please, write your comments...
Top
Gnufsh
Guru
Guru
User avatar
Posts: 400
Joined: Sat Dec 28, 2002 5:40 pm
Location: Portland, OR
Contact:
Contact Gnufsh
Website

  • Quote

Post by Gnufsh » Thu Mar 16, 2006 1:04 am

Sounds interesting. Planning on writing an ebuild for it?
Top
mudrii
l33t
l33t
Posts: 789
Joined: Thu Jun 26, 2003 12:27 am
Location: Singapore
Contact:
Contact mudrii
Website

  • Quote

Post by mudrii » Thu Mar 16, 2006 8:23 am

Nice and really cool if you can make an ebuild.

Is it work on Big AMD 64 dual core too ?
www.gentoo.ro
Top
Elmo234
n00b
n00b
Posts: 48
Joined: Fri Oct 08, 2004 7:52 pm

  • Quote

Post by Elmo234 » Thu Mar 16, 2006 8:55 am

Yes it works for dual core cpus. I tested it on mine :)

It is also supposed to work on multi cpu systems and hybrid systems (1 dual core cpu and a single core cpu)... But I haven't tested that...

This is just the first release. Next week I will release a new version that solves some isues. I also want to make some scrips for starting / stopping the daemon.

Then I will try to write and ebuild. The problem is that I have never written one. I hope it is not too difficult :)
Top
Plugin_baby
n00b
n00b
Posts: 26
Joined: Thu Aug 18, 2005 7:16 pm
Location: The Netherlands
Contact:
Contact Plugin_baby
Website

  • Quote

Post by Plugin_baby » Thu Mar 16, 2006 9:15 am

Sounds good, the short battery life of my turion64 laptop really annoys me...

Elmo234, you say you get an extra 30 min. with this, how long do you have in total?
At 800MHz (ondemand) I still only get about 2 hours.
I know that battery life also depends on the model, but I'm curious about what others are able to get ;)
Top
Elmo234
n00b
n00b
Posts: 48
Joined: Fri Oct 08, 2004 7:52 pm

  • Quote

Post by Elmo234 » Thu Mar 16, 2006 9:31 am

My notebook is an ACER 1501 LMI with an Athlon 64 DTR processor. At 800 Mhz I can change voltage from 1,1 to 0,8v. That reduces the energy needed by the cpu in a 47%. This pushes battery life from 2 hours 30 minutes to over 3 hours.

But in a Turion system you won't be able to reach such a high difference because you processor uses lover voltage by default and because Turion uses about half energy that an old Athlon 64 DTR.

But you can try it. Maybe you have 15 or 20 minutes more of battery life. :)
Top
Elmo234
n00b
n00b
Posts: 48
Joined: Fri Oct 08, 2004 7:52 pm

  • Quote

Post by Elmo234 » Sun Mar 19, 2006 10:24 pm

I just released a new version (0.1.1) that solves some bugs. The ebuild will come soon (in two or three days).
Top
Voluspa
n00b
n00b
Posts: 3
Joined: Mon Mar 20, 2006 4:00 pm
Location: Sweden

  • Quote

Post by Voluspa » Mon Mar 20, 2006 11:30 pm

Ever since Linus "stole" my one and only C-state for reducing power usage in kernel 2.6.15 (see http://bugzilla.kernel.org/show_bug.cgi?id=5767 ), I've patched it back with:

Code: Select all

diff -Nur linux-2.6.16-original/drivers/acpi/processor_idle.c linux-2.6.16-patched/drivers/acpi/processor_idle.c
--- linux-2.6.16-original/drivers/acpi/processor_idle.c 2006-03-20 06:53:29.000000000 +0100
+++ linux-2.6.16-patched/drivers/acpi/processor_idle.c  2006-03-20 20:24:10.000000000 +0100
@@ -953,7 +953,7 @@
        for (i = 1; i < ACPI_PROCESSOR_MAX_POWER; i++) {
                if (pr->power.states[i].valid) {
                        pr->power.count = i;
-                       if (pr->power.states[i].type >= ACPI_STATE_C2)
+                       if (pr->power.states[i].type >= ACPI_STATE_C1)
                                pr->flags.power = 1;
                }
        }
But this is merely a trickle gain in comparison with the CPUPW program's undervolting feature. I registered on the ge
ntoo board just to give praise and thanks to the author in a public manner.

The Acer Aspire 1520 (1524) WLMi on my lap is a powerful machine: AMD Athlon64 Processor 3400+, 1 meg L2 cache, NVIDIA GeForce FX Go5700 64 meg and 2 gig system memory. The drawbacks are of course heat, fan noise and a short battery life - some 2 hours doing light work, connected through the builtin wireless LAN device.

CPUPW gives me another 30 minutes! Heat is lower, as could be expected, and the fan never reaches MAX, out of four levels: OFF - only when room temperature is quite chilly, LOW - normal state, MEDIUM - CPU 99% when compiling etc, MAX - previous level when eg playing a demanding game.

Configuration of CPUPW was a breeze, though I'd like to expand on a couple of points not mentioned in the online documentation. First, make sure that PowerNowd or other managers are unloaded. Second, cat the /sys/devices/system/cpu/cpu*/cpufreq/scaling_governor and ensure that it says "userspace". Third, verify that all your voltage settings are adequately high by running eg a very demanding game.

I myself discovered that the value for 2000 MHz needed another 50 mV when Neverwinter Nights kept crashing at a certain spot (a wood with plenty of light beams streaming down through the treetop canopy - think it's called Druids Camp or something such). Finding the culprit speed was simple. I left the 2200 and 800 voltage values as they were - deduced by looking up the powernow-k8 reporting in the kernel log file and comparing it to the CPUPW online examples, while disabling the 2000 and 1800 speed voltages with a -1 value. No crash. I then added back the 1800 value. No crash. Added the 2000 value plus 50 mV. No crash. Done.

CPUPW also has a very good frequency management. When I installed PowerNowd I took that author's defaults on faith. Result was that eg drawing in Gimp could trigger the fan into MEDIUM level. And Neverwinter Nights... well, the fanless GPU reached its slowdown threshold (115C) and CPU fan was constantly on MAX. With CPUPW - run as /usr/sbin/cpupw --config /etc/cpupw.conf --smart --daemonize - both these programs use exactly the CPU speed they need. Gimp drawing always on LOW fan, NWN on MEDIUM and the GPU never reaching the slowdown threshold temperature.

So, in conclusion, the CPUPW program has indeed "made my day". A heartfelt thank you goes to the author Daniel(?). At version 0.1.1 I've only seen one issue. Kernel log file is sprinkled with:

Mar 20 18:07:42 ... powernow-k8: error - out of sync, fix 0x0 0x0, vid 0x1e 0x12
[...]
Mar 20 19:51:49 ... powernow-k8: error - out of sync, fix 0xa 0xa, vid 0x16 0xa
[...]
Mar 20 20:03:28 ... powernow-k8: error - out of sync, fix 0x0 0x0, vid 0x1e 0x12

The more frequency switching, the more of these messages. Below is a table of my machine values followed by the actual cpupw.conf:

Code: Select all

AMD Athlon64 Processor 3400+ defaults:

FID (decimal)   MHz     VID (decimal)   mV
14              2200    2               1500
12              2000    6               1400
10              1800    10              1300
0               800     18              1100

Idle machine running Xorg and KDE at 800 MHz in 24C room temperature:

CPU core 49-50C
CPU env. 48C

After the CPUPW implementation:

FID (decimal)   MHz     VID (decimal)   mV (Values deduced - lower not tested)
14              2200    14              1200
12              2000    16              1150 (50 mV extra to NeverWinter Nights)
10              1800    22              1000
0               800     30              800

Idle machine running Xorg and KDE at 800 MHz in 24C room temperature:

CPU core 46-47C
CPU env. 45-47C
1
1
304
4
2200000 14 -1 -1
2000000 16 -1 -1
1800000 22 -1 -1
800000 30 -1 -1
1
Mvh
Mats Johannesson
Top
Elmo234
n00b
n00b
Posts: 48
Joined: Fri Oct 08, 2004 7:52 pm

  • Quote

Post by Elmo234 » Tue Mar 21, 2006 6:20 pm

Thank you Voluspa for such a great comment to the program. And thanks for thanking me :)
Voluspa wrote: The Acer Aspire 1520 (1524) WLMi on my lap is a powerful machine: AMD Athlon64 Processor 3400+, 1 meg L2 cache, NVIDIA GeForce FX Go5700 64 meg and 2 gig system memory. The drawbacks are of course heat, fan noise and a short battery life - some 2 hours doing light work, connected through the builtin wireless LAN device.

CPUPW gives me another 30 minutes! Heat is lower, as could be expected, and the fan never reaches MAX, out of four levels: OFF - only when room temperature is quite chilly, LOW - normal state, MEDIUM - CPU 99% when compiling etc, MAX - previous level when eg playing a demanding game.
I have an Acer Aspire 1501LMi (Athlon 64 DTR 3000+) with 2.5 hours of battery life (3 with CPUPW, and, like in you laptop, it never reaches MAX fan speed).
Voluspa wrote: Configuration of CPUPW was a breeze, though I'd like to expand on a couple of points not mentioned in the online documentation. First, make sure that PowerNowd or other managers are unloaded. Second, cat the /sys/devices/system/cpu/cpu*/cpufreq/scaling_governor and ensure that it says "userspace". Third, verify that all your voltage settings are adequately high by running eg a very demanding game.
I know that the making a configuration file is a bit difficult. When I started this program I didn't want to lose time making a parser for a more complex and easy to read (and write) configuration file. But in the future I will change it...
I will also write that information in the webpage. It is very useful for other users to know.
Voluspa wrote: Finding the culprit speed was simple. I left the 2200 and 800 voltage values as they were - deduced by looking up the powernow-k8 reporting in the kernel log file and comparing it to the CPUPW online examples, while disabling the 2000 and 1800 speed voltages with a -1 value. No crash. I then added back the 1800 value. No crash. Added the 2000 value plus 50 mV. No crash. Done.
This has to be done for each computer :( Nobody knows which are the lowest values of voltage for a CPU to work stable...
Voluspa wrote: So, in conclusion, the CPUPW program has indeed "made my day". A heartfelt thank you goes to the author Daniel(?).
Thank you very much :) I coded this program for myself and for fun. But I am glad to know that it is useful to other people. Yes, my name is Daniel.
Voluspa wrote: At version 0.1.1 I've only seen one issue. Kernel log file is sprinkled with:

Mar 20 18:07:42 ... powernow-k8: error - out of sync, fix 0x0 0x0, vid 0x1e 0x12
[...]
Mar 20 19:51:49 ... powernow-k8: error - out of sync, fix 0xa 0xa, vid 0x16 0xa
[...]
Mar 20 20:03:28 ... powernow-k8: error - out of sync, fix 0x0 0x0, vid 0x1e 0x12

The more frequency switching, the more of these messages. Below is a table of my machine values followed by the actual cpupw.conf:
I know this... and I think I know why this happens. I am trying to fix it (in fact the change from version 0.1.0 to 0.1.1 reduces this by an 80% aprox).

Now I am really busy with university, but in a week I will release a new version with a few bug fixed and new features.
Top
Voluspa
n00b
n00b
Posts: 3
Joined: Mon Mar 20, 2006 4:00 pm
Location: Sweden

  • Quote

Post by Voluspa » Fri Mar 24, 2006 5:01 am

I've read the interesting (and long-running) gentoo AMD64 thread on undervolting, where hopes of a kernel or at least a distributor patch acceptance is expressed. That will probably never happen. Operating out of spec, even if it is a user choice, would place them in a most unwanted liability. Consider for example the powersaving AMDK7 patch that has been floating around since 2002. Len Brown, the ACPI maintainer from Intel, had some final strong words:

[PATCH] amd76x_pm: C3 powersaving for AMD K7
Thread start http://marc.theaimsgroup.com/?l=linux-a ... 729153&w=2
--quote Len Brown http://marc.theaimsgroup.com/?l=linux-a ... 522773&w=2 --
[...]
How about if we put it this way...
If the ACPI maintainer were an AMD employee,
and he accepted a patch like this specific to Intel hardware --
a patch that rejects whatever validation Intel, the BIOS
vendor and the board vendor have put into the product --
I'd call for his expulsion for ineptitude.

If somebody from AMD steps forth and says that hey, their hardware
is broken if used in the standard way, but that this "logic around"
is a valid model-specific workaround -- then we have something
that MAYBE we can work with. Otherwise, do whatever works for your
own system, but it would be reckless of us to put stuff like this
in the upstream kernel and then ask distros to support it.
--end quote--

Undervolting has a strong aura of "recklessness" and a userspace tool like CPUPW could well be the only patch-free avenue for the foreseeable future.

Speaking of which, Daniel, when university has eased its grip could you contemplate a runtime switch along the line of "--maxfreq <frequency>"? When trying out voltages my 2200 and 800 MHz speeds posed no problems. The 800 could be had by using your "--laptop" switch and doing an "echo -n '1'>/proc/sys/vm/laptop_mode", but the intermediate speeds 2000 and 1800 really had me stumped for awhile. Experiments caused a lot of "ignoring illegal change in lo freq table-0 to 0x0 -- transition frequency failed" in /var/log/syslog until I finally could clamp the speed AND retain correct voltage by doing:

echo -n "1800000">/sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq
(using this cpupw.conf)
1
1
304
4
2200000 22 -1 -1
2000000 22 -1 -1
1800000 22 -1 -1
800000 30 -1 -1
1

echo -n "2000000">/sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq
(using this cpupw.conf)
1
1
304
4
2200000 16 -1 -1
2000000 16 -1 -1
1800000 22 -1 -1
800000 30 -1 -1
1

Not pretty ;-) If we want to find _stable_ voltages, testing each level is a must. And, as it turns out, that requires quite some work. Taking a hint from the other undervolting thread, I downloaded GIMPS (mprime) http://www.mersenne.org/freesoft.htm and ran the torture test (-t). Heh... my value for 2200 MHz, which was stable in Neverwinter Nights, miscalculated after a mere two minutes. Fixed by upping it another 50 mV. I then ran each speed - deleting local.ini in between - the recommended minimum of six hours without errors.

But, and this really underscores the need for multiple test-tools, entering Neverwinter Nights again I experienced a crash while loading an area. Knowing that this is more disk than CPU bound I guessed that the lower frequencies also needed a little extra juice. Giving both 800 and 1800 speeds another 50 mV and walking around the map for an hour finally convinced me of machine stability.

Examining by "cat /sys/devices/system/cpu/cpu*/cpufreq/stats/trans_table" (cpufreq_stats and freq_table modules loaded or builtin) after the game is another must to verify that you've really exercised all the CPU speeds.

Final cpupw.conf for me, and me only :-)

1
1
304
4
2200000 12 -1 -1
2000000 16 -1 -1
1800000 20 -1 -1
800000 28 -1 -1
1

Ergo:

Code: Select all

FID (decimal)   MHz     VID (decimal)   mV ("mprime -t" and NWN game confirmed)
14              2200    12              1250
12              2000    16              1150
10              1800    20              1050
0               800     28              850
Using these extra 50 mV also seem to have decreased the "out of sync" in /var/log/messages. Coming back from NWN there was only one. Go figure...
Mvh
Mats Johannesson
Top
octapus
n00b
n00b
Posts: 35
Joined: Mon Mar 10, 2003 12:37 pm

  • Quote

Post by octapus » Fri Mar 24, 2006 11:28 am

Very useful program indeed.

I have an AMD 64 3200+ and the following working configuration:

1
1
304
3
2000000 16 -1 -1 <= 1150mV from 1500mV
1800000 20 -1 -1 <= 1050mV from 1400mV
1000000 24 -1 -1 <= 950mV from 1150mV
1

Even under full load the second fan is never activated which lowers the amount of noise the laptop generates.

I didn't extensively test the stability but there are no problems till now.

Let me also say that there were messages similar to what was mentioned before ("powernow-k8: error - out of sync.....") from time to time.
Top
widan
Veteran
Veteran
User avatar
Posts: 1512
Joined: Tue Jun 07, 2005 4:26 pm
Location: Paris, France

  • Quote

Post by widan » Fri Mar 24, 2006 10:27 pm

Voluspa wrote:Kernel log file is sprinkled with:

Code: Select all

Mar 20 18:07:42 ... powernow-k8: error - out of sync, fix 0x0 0x0, vid 0x1e 0x12
Mar 20 19:51:49 ... powernow-k8: error - out of sync, fix 0xa 0xa, vid 0x16 0xa
Mar 20 20:03:28 ... powernow-k8: error - out of sync, fix 0x0 0x0, vid 0x1e 0x12
The powernow driver keeps track of the current fid/vid it sets. Before a transition, it checks to see if the parameters are still what it thinks they are, and gives the out of sync message if something changed (here the vid). AFAIK the frequency transition is still done, this is only a warning message. The messages appear because the cpupw program does the voltage change from userspace (by writing to FID/VID control MSR) and the powernow driver is not notified of the vid change.

Fixing that would require modifying the powernow driver to set the proper voltages directly when it does the frequency transition, rather than modifying them later from userspace. There are patches to do this in the main undervolting thread.
Voluspa wrote:Experiments caused a lot of "ignoring illegal change in lo freq table-0 to 0x0 -- transition frequency failed" in /var/log/syslog
Either keep the lowest frequency in the table at standard voltage, or force a transition to a higher frequency, then back down to the low frequency to have the correct voltage set. This appears because the powernow driver refuses to do transitions between low FIDs and doesn't allow a voltage-only transition for low FIDs (it thinks the transition is between two different low FIDs, which is not allowed).
Top
superwutze
Tux's lil' helper
Tux's lil' helper
User avatar
Posts: 137
Joined: Thu Dec 09, 2004 8:02 pm
Location: Europe/Vienna

  • Quote

Post by superwutze » Sat May 20, 2006 1:03 pm

i have some trouble using cpupw.

my system is a tyan s2875 k8w and i have two opterons 246 on it.
cpupw -s gives the following:

Code: Select all

System has 1 physical CPU's
CPU 0-> voltage: 1.550000 v, VID: 0, frequency: 800 Mhz, FID: 0
which is wrong in every single point.
1 have two cpus
they run at 1.2v
they run at 1ghz

but now to my real question: can cpupw change the frequency table too?
i tried several cpupw.conf variations but not a single one showed any alteration to my system.
per default my system has 3 steps (1 1.8 and 2ghz) and i want to change them to 0.8 1.2 1.6 and 2ghz which runs fine in windows with rmclock. could cpupw do this?

i have another question that no one was able to answer so far:
why do i need a daemon to change frequencies?
where is the difference to:

Code: Select all

echo "ondemand" > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor
echo "ondemand" > /sys/devices/system/cpu/cpu1/cpufreq/scaling_governor
so far i have used the kernel patch to change voltages but the links to the patches (and the last ones could change the frequency table also) are down, so i have to look for another possibility to do that. and a userspace program is by far better than patching every kernel.
bill who? micro what?
Top
pagaman
n00b
n00b
User avatar
Posts: 25
Joined: Fri Jan 23, 2004 10:11 pm
Location: London

  • Quote

Post by pagaman » Fri Jun 02, 2006 9:49 pm

Just a quick note to say thanks.
I've got an Acer aspire 1520 something, and I've just knocked 200mV off all 3 of my settings.
This is great ;)
I can probably knock more off too...

My config:
1
1
304
3
1800000 10 -1 -1
1600000 14 -1 -1
800000 26 -1 -1
1
History only remembers great people by forgetting their mistakes.
Top
Elmo234
n00b
n00b
Posts: 48
Joined: Fri Oct 08, 2004 7:52 pm

  • Quote

Post by Elmo234 » Wed Jun 07, 2006 9:17 pm

I just released a new version... cpupw 0.2.0. But I haven't test it much. The main new things are:

- It is supposed tu run on multiprocessor computers (the other versions didn't, there was a bug) and I say supposed because I don't have a multiprocessor system to test.
- Possibility to adjust VID and FID manually.
- Detects which governor is running and gives warnings if it is not "userspace".
- Now the FSB frequency is detected (the theoretical and the real one).
- You can modify the VID by a constant, passed as a parameter. This let's you decrease, for example, 0.2v in every step without creating a config file.

the web page is the same: http://tuxamito.com.es/cpupw/

please, give me your reports

thanks
Top
kristoffer
Tux's lil' helper
Tux's lil' helper
Posts: 85
Joined: Sun Oct 05, 2003 11:54 am

  • Quote

Post by kristoffer » Thu Jun 08, 2006 3:24 pm

This program is great! I'm using it on all of my computers now. I do, however, want to be able to set a bound for the frequency values, i.e. something equivalent to scaling_max_freq and scaling_min_freq, so I did a little hack to add that functionality. In order to apply the hack, put the code below in a patch file in the cpupw-0.2.0/src directory, apply the patch to cpupw.c and compile:

Code: Select all

--- cpupw.c	2006-06-08 17:10:29.000000000 +0200
+++ ../src.mod/cpupw.c	2006-06-08 17:05:32.000000000 +0200
@@ -169,6 +169,8 @@
 int p_changevid = 0;
 int p_governor = 0;
 int p_governor_cpu = -1;
+int p_max_freq = -1;
+int p_min_freq = -1;
 char *s_governor;
 
 /* This controls the loop time and when to exit it */
@@ -797,7 +799,7 @@
 void decide_change (void)
 {
   int i, j;
-  int max, average;
+  int max, average, current;
 
   for(i=0;i<numpcpus;i++)
     {
@@ -824,15 +826,27 @@
 		  max = (int)average/j;
 		}
 
-	      if(max > cpus[i].scaling_table[cpus[i].now].up &&
-		 cpus[i].scaling_table[cpus[i].now].up >= 0)
+	      current = get_actual_speed(i, 2);
+
+	      if (p_max_freq != -1 && current > p_max_freq)
+		  change_speed(-1, i);
+	      else if (p_min_freq != -1 && current < p_min_freq)
+		  change_speed(1, i);
+	      else if(max > cpus[i].scaling_table[cpus[i].now].up &&
+		 cpus[i].scaling_table[cpus[i].now].up >= 0 && (p_max_freq == -1 ||
+		 cpus[i].scaling_table[cpus[i].now - 1].speed <= p_max_freq))
 		change_speed(1, i);
 	      else if(max < cpus[i].scaling_table[cpus[i].now].down &&
-		      cpus[i].scaling_table[cpus[i].now].down >= 0)
+		      cpus[i].scaling_table[cpus[i].now].down >= 0 && (p_min_freq == -1 ||
+		      cpus[i].scaling_table[cpus[i].now + 1].speed >= p_min_freq))
 		change_speed(-1, i);
-	      else if (max > speed_up && cpus[i].scaling_table[cpus[i].now].up<0)
+	      else if (max > speed_up && cpus[i].scaling_table[cpus[i].now].up<0 &&
+		       (p_max_freq == -1 ||
+		       cpus[i].scaling_table[cpus[i].now - 1].speed <= p_max_freq))
 		change_speed(1, i);
-	      else if (max < speed_down && cpus[i].scaling_table[cpus[i].now].down<0)
+	      else if (max < speed_down && cpus[i].scaling_table[cpus[i].now].down<0 &&
+		       (p_min_freq == -1 ||
+		       cpus[i].scaling_table[cpus[i].now + 1].speed >= p_min_freq))
 		change_speed(-1, i);
 	    }
 	}
@@ -1119,9 +1133,11 @@
   printf("                            increase the cpu frequency\n");
   printf("    -D, --down ARG          set ARG to be the default percentage of use to\n");
   printf("                            decrease the cpu frequency\n");
-  printf("    -V, --voltage ARG1 ARG2 set ARG2 as the new VID, expressed as a decimal value\n");
-  printf("                            for physical CPU number ARG1\n");
-  printf("    -F, --freq ARG1 ARG2    set ARG2 as the new frequency, expressed in Mhz\n");
+  printf("    -M, --max_freq ARG      set the maximum frequency to ARG, expressed in KHz\n");
+  printf("    -m, --min_freq ARG      set the minimum frequency to ARG, expressed in KHz\n");
+  printf("    -V, --voltage ARG1 ARG2 set ARG2 as the new VID, expressed as a decimal\n");
+  printf("                            value for physical CPU number ARG1\n");
+  printf("    -F, --freq ARG1 ARG2    set ARG2 as the new frequency, expressed in KHz\n");
   printf("                            for physical CPU number ARG1\n");
   printf("    -l, --laptop            activate the laptop mode check\n");
   printf("    -C, --changevid ARG     increase the VID in ARG for all speed steps. ARG can\n");
@@ -1181,6 +1197,24 @@
       else if(strcmp(argv[i],"-l")==0 || strcmp(argv[i],"--laptop")==0)
 	p_laptop = 1;
 
+      else if(strcmp(argv[i],"-m")==0 || strcmp(argv[i],"--min_freq")==0)
+	{
+	  i++;
+	  if(i>=argc)
+	    return -9;
+	  p_min_freq = atoi(argv[i]);
+	}
+
+      else if(strcmp(argv[i],"-M")==0 || strcmp(argv[i],"--max_freq")==0)
+	{
+	  i++;
+	  if(i>=argc)
+	    return -9;
+	  p_max_freq = atoi(argv[i]);
+          if(p_max_freq < p_min_freq)
+	    return -9;
+	}
+
       else if(strcmp(argv[i],"-a")==0 || strcmp(argv[i],"--autoconfig")==0)
 	{
 	  p_autoconfig = 1;
@@ -1324,6 +1358,9 @@
 	case -8:
 	  printf("bad values for governor arguments\n");
 	  break;
+        case -9:
+          printf("bad frequency bound\n");
+          break;
 	}
       return -1;
     }
The new syntax is included in the -h/--help output. It should work for multiple processors, although the bound is set to the same value for all of them.

Elmo234: You may of course include this in the official source if you find it to be useful.

[edit]Forgot to mention that my patch also includes two fixes to the original --help output:
1) -F takes the frequency in KHz, not MHz, and
2) -V had a line that was longer than 80 columns, which made the output ugly.[/edit]
I have to return some videotapes
Top
/carlito
Guru
Guru
User avatar
Posts: 451
Joined: Fri Dec 31, 2004 2:00 am
Location: Belgium

  • Quote

Post by /carlito » Thu Jun 08, 2006 3:32 pm

I really can't understand this program. I own an MSI megabook S270 which hosts a Turion MT30 cpu.

Code: Select all

# cpupw -s
readmsr, in read: Invalid argument
readmsr, in read: Invalid argument
System has 1 physical CPUs and 1 logial CPUs
readmsr, in read: Invalid argument
CPU 0-> voltage: 1.350000 v, VID: 8, frequency: 1200 Mhz, FID: 4
        Theorical bus speed: 19.000000
        Real bus speed: 100.000000
readmsr, in read: Invalid argument
        Real cpu speed: 5500.000000
        Governor: userspace

Code: Select all

# cpupw -a
readmsr, in read: Invalid argument
readmsr, in read: Invalid argument
1
1
304
2
800000 -1 -1 -1
1600000 -1 -1 -1
1
Can someone assist me on how to test and set my VID?

.O.
..O
OOO
Top
Locked

17 posts • Page 1 of 1

Return to “Gentoo on AMD64”

Jump to
  • Assistance
  • ↳   News & Announcements
  • ↳   Frequently Asked Questions
  • ↳   Installing Gentoo
  • ↳   Multimedia
  • ↳   Desktop Environments
  • ↳   Networking & Security
  • ↳   Kernel & Hardware
  • ↳   Portage & Programming
  • ↳   Gamers & Players
  • ↳   Other Things Gentoo
  • ↳   Unsupported Software
  • Discussion & Documentation
  • ↳   Documentation, Tips & Tricks
  • ↳   Gentoo Chat
  • ↳   Gentoo Forums Feedback
  • ↳   Duplicate Threads
  • International Gentoo Users
  • ↳   中文 (Chinese)
  • ↳   Dutch
  • ↳   Finnish
  • ↳   French
  • ↳   Deutsches Forum (German)
  • ↳   Diskussionsforum
  • ↳   Deutsche Dokumentation
  • ↳   Greek
  • ↳   Forum italiano (Italian)
  • ↳   Forum di discussione italiano
  • ↳   Risorse italiane (documentazione e tools)
  • ↳   Polskie forum (Polish)
  • ↳   Instalacja i sprzęt
  • ↳   Polish OTW
  • ↳   Portuguese
  • ↳   Documentação, Ferramentas e Dicas
  • ↳   Russian
  • ↳   Scandinavian
  • ↳   Spanish
  • ↳   Other Languages
  • Architectures & Platforms
  • ↳   Gentoo on ARM
  • ↳   Gentoo on PPC
  • ↳   Gentoo on Sparc
  • ↳   Gentoo on Alternative Architectures
  • ↳   Gentoo on AMD64
  • ↳   Gentoo for Mac OS X (Portage for Mac OS X)
  • Board index
  • All times are UTC
  • Delete cookies

© 2001–2026 Gentoo Foundation, Inc.

Powered by phpBB® Forum Software © phpBB Limited

Privacy Policy