![]() |
Dynamic Throttling
So before I get yelled at I did read the recently posted throttling topic, but it didn't seem to provide the solution I was looking for.
My problem is this; I run mprime on my laptop, which is my current primary machine, but I don't want it running it all out (due to both heat and power issues). The processor is a Core 2 Duo P8700 (2.53 Ghz dual core) which can heat up a decent amount if run all out (~95 degrees Celsius). I enabled throttling, as discussed on the aforementioned thread, at 25% and 50% to observe performance. Now maybe this is just me being naive but I had expected throttle to casue mprime to only use that percentage of the idle processor time. Instead it seems to run the processor all out at 2.53 Ghz for 5 seconds, stop working for 5 seconds then resume (this is at 50% throttle). What I'm ideal looking for is a way to casue mprime to fill up idle processor time with out bumping up the clock speed, but to utilize the extra time available on the slower speeds. For example while writing this the processor is just at an easy 800 MHz (for each core) with an occasional kick to 1.6 GHz for a background process. Would it be possible to setup mprime to use a low priority thread as it does now with out escalating the processor speed? (and to let the processor still slow down when it normally would?) And if that is stupid is there a way to switch mprime to a constant duty cycle, but not doing as much at once, instead of the 50% duty cycle it has with the throttle? I do understand that being able to do this would result in slower computations (and I'm sorry) but this is my primary work machine for now so I can't just leave it sitting plugged in like some of my desktops (those can sit on at 100% all day :smile:) And if this is a stupid/unclear idea let me know. (I can take criticism) |
I'm not sure if there's a way to do what you're asking, (more info on what exactly is underclocking the CPU when idle to save power/heat would help) but if the problem is running out of power when using the battery (as you mention near the end), you can uncheck the Options > Preferences > "Run program even when using laptop battery power" check box. Then it'll be full-on (plugged in) or full-off, (on battery power) and when you're using battery power, the automatic underclocking will still function to give the best life possible.
|
[QUOTE=spaz;196075]
What I'm ideal looking for is a way to casue mprime to fill up idle processor time with out bumping up the clock speed, but to utilize the extra time available on the slower speeds.[/QUOTE] AFAIK, the OS doesn't provide the hooks to do this. As to your other question, there is no way to make the current version of mprime use a finer granularity of throttling. |
[quote=Prime95;196084]AFAIK, the OS doesn't provide the hooks to do this.
As to your other question, there is no way to make the current version of mprime use a finer granularity of throttling.[/quote] You could code a cpu scheduler but it doesn't really make sense. Fix your cooling and you will be fine. |
If you are running 2 copies and want to tweak your CPU utilization to more than 50% but less than 100%, a low-tech solution is to drop to running just one copy - memory-subsystem contention means that 1 copy usually provides 60% (sometimes more) the total throughput of 2 copies running simultaneously.
If that drops your CPU temperature back to within a safe range and you want a little more utilization, you could try running one one copy all-out and a 2nd throttled. |
Actually, this is possible to do on Linux. What you need to do is set your system's CPU throttling governor so that it won't "count" lowest-priority apps like mprime when deciding whether or not to throttle. This is an option in most distributions, and in fact some versions of Ubuntu had this as the default.
Right now I can't recall where I found this option before, but I think it was somewhere in the /sys directory. If I get the chance I'll reboot my machine (dual-boot) into Linux and see if I can find it. |
mdettweiler you are a genius! I Hadn't thought to look to see if there's a way to do that under linux itself I just assumed it had to be done within mprime.
So the solution is to take advantage of the fact that mprime utilizes nice so nicely. So to make it such that mprime can monopilize free processor time without escalating the cpu speed it to remove the nice programs from the calculations for when the speed should be changed. The critical change is located in; [code]/etc/sysconfig/cpuspeed[/code]there's a section of that that looks like this; [code]### NICE PROCESS HANDLING ### # Let background (nice) processes speed up the cpu # default value: 0 (background process usage can speed up cpu) # alternate value: 1 (background processes will be ignored) IGNORE_NICE=0[/code]by changing IGNORE_NICE to be 1 we ignore the nice process completely. Refrences for this [URL]http://www.flatmtn.com/article/green-boinc[/URL] was shere i found the reference to this. I also installed cpufrequtils before doing this change I don't believe that was necessary but it may have helped. Only possible downside is some applications might have components set to low nice levels that don't get down fast enough cause they don't change the clock speed, but so far the system runs fine, and mprime is using all the free processor time without bumping up the clock spee (which still goes up and down on demand). Again thanks for giving me advice on where to look, hoepit helps any one else in a similar situation. |
[quote=spaz;196109]mdettweiler you are a genius! I Hadn't thought to look to see if there's a way to do that under linux itself I just assumed it had to be done within mprime.
So the solution is to take advantage of the fact that mprime utilizes nice so nicely. So to make it such that mprime can monopilize free processor time without escalating the cpu speed it to remove the nice programs from the calculations for when the speed should be changed. The critical change is located in; [code]/etc/sysconfig/cpuspeed[/code]there's a section of that that looks like this; [code]### NICE PROCESS HANDLING ### # Let background (nice) processes speed up the cpu # default value: 0 (background process usage can speed up cpu) # alternate value: 1 (background processes will be ignored) IGNORE_NICE=0[/code]by changing IGNORE_NICE to be 1 we ignore the nice process completely. Refrences for this [URL]http://www.flatmtn.com/article/green-boinc[/URL] was shere i found the reference to this. I also installed cpufrequtils before doing this change I don't believe that was necessary but it may have helped. Only possible downside is some applications might have components set to low nice levels that don't get down fast enough cause they don't change the clock speed, but so far the system runs fine, and mprime is using all the free processor time without bumping up the clock spee (which still goes up and down on demand). Again thanks for giving me advice on where to look, hoepit helps any one else in a similar situation.[/quote] Yes, that was it, I'd just forgotten the path to the file that needed to be changed. Glad to be of service! :smile: BTW, one thing you'll want to keep in mind: if I remember correctly, this option is reset every time the system is rebooted. That could just be something specific to the distribution I was using (Ubuntu), but I'd recommend keeping a close eye on it next time you reboot. If it does get reset, you may want to put a command to fix it in a shell script, then put the shell script in root's crontab to run at system startup. Ironically enough, I came across this while looking for a solution to the exact opposite problem. Ubuntu, as of version 8.04, had the IGNORE_NICE option set to 1 by default, whereas earlier versions had it set to 0. It proved to be rather annoying how every time I rebooted my computer, I had to manually set it to "Performance" mode using the CPU Frequency Scaling Monitor applet to keep this from impacting the performance of my prime search applications (a rather sizeable slowdown--about half of full speed, as I recall). I believe I ended up going a different route to fix the problem in the end, but nontheless this was one of the possible solutions. |
[url]http://cpufreqd.sourceforge.net/manpages/cpufreqd.conf.5.shtml[/url]
[quote]ignore_nice, ignore_nice_load Whether ‘nice’ processes should be considered as CPU usage by the governor. This is a boolean value (e.g. value is either 0 or 1). When set to 1 ‘nice’ processes will not be counted as CPU usage by the governor. Note: ‘ignore_nice’ was renamed to ‘ignore_nice_load’ in kernel version 2.6.16. Both names are accepted in cpufreqd.conf, regardless the version of the running kernel.[/quote] |
Hmm...something interesting I just noticed about this. In Ubuntu (and presumably other Debian-based distros as well), there is no /etc/sysconfig/cpuspeed file--in fact, there's no /etc/sysconfig directory at all. That would explain why that pathname didn't quite ring a bell when I saw it in spaz's post.
After a little digging on Google, it seems that in Debian-based systems, the file is located at /etc/cpufreqd.conf. If it's not present (which seems to be the default in general) it's read from /etc/defaults/cpufreqd. However, I can't find either file on either of two different Ubuntu machines that I have access to, one running 8.04 and the other 9.04. Does anyone know where this file is supposed to be located on those distros? |
I have a laptop with Ubuntu 9.04 installed, and I am using "CPU Frequency Scaling Monitor 2.26.1", which allows me to choose among several settings: 1.8 GHz, 1.2 GHz, 800 MHz, Conservative, Ondemand, Performance, Powersave :tu:
BTW: CPU = Core 2 Duo @ 1.8 GHz. |
| All times are UTC. The time now is 05:53. |
Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2021, Jelsoft Enterprises Ltd.