Page 1 of 1

Underclock and Overclock - dynamic performance & efficiency

Posted: Mon Jul 28, 2014 1:32 pm
by Lope
I'm running a standard 512MB Model B, with the latest Raspbian image 2014-06-20 installed and dist-upgraded.

I need burst (dynamic) performance
My RbPi doesn't work hard most of the time. So a CPU freq of 200mhz is fast enough. But when I do maintenance on it, or use the GUI, it's quite slow. So the dynamic overclocking option really appeals to me, with underclocking enabled also.

Dynamic Under/Over clocking working well so far
I just OC'd my RbPi using the raspi-config utility.
I've confirmed that my CPU freq scales dynamically according to use, but I can't confirm my memory speed or voltage are adjusting also.

#/boot/config.txt settings set by raspi-config
arm_freq=1000
core_freq=500
sdram_freq=600
over_voltage=6

#underclocking options added by me
arm_freq_min=200
core_freq_min=200
sdram_freq_min=200

I wanted to make sure that neither my underclocking nor my overclocking settings are going to cause instability.
I have run the above config headless (needing VNC access at the moment only) for a few minutes and it seems great. But I've read that if one of the freqs is <= 200mhz the screen won't work properly and the SD card can be corrupted.

SD card corruption caused by under/overclocking
What is the current status of this issue? I've read that Raspbian has made sd-card fixes to prevent corruption. Have they succeeded for all clock speeds? or just a range of clock speeds?

What are the recommended min/max for each speed?
arm_freq
core_freq
sdram_freq

How many steps are used in between min and max freqs?
Does it only switch between min and max speed?
I'm wondering if I can safely use over_voltage_min with a negative value to undervolt for my 200mhz speed without affecting my overvolted 1000mhz performance.

What will happen with my config if the core exceeds 85 degrees?
I've read that the RbPi will automatically reduce the voltage and frequency if it overheats. What voltage and freq would that be? The minimums? or does it just drop down gradually?

Re: Underclock and Overclock - dynamic performance & efficie

Posted: Mon Jul 28, 2014 2:04 pm
by dom
Lope wrote: What is the current status of this issue? I've read that Raspbian has made sd-card fixes to prevent corruption. Have they succeeded for all clock speeds? or just a range of clock speeds?
I'm not aware of any sdcard corruption issue caused by overclock or underclock.
Lope wrote: What are the recommended min/max for each speed?
The defaults are the ones guaranteed to work. Anything else you'll have to test yourself.
Lope wrote: How many steps are used in between min and max freqs?
Does it only switch between min and max speed?
Yes, the default performance governor switches between min and max.
Lope wrote: I'm wondering if I can safely use over_voltage_min with a negative value to undervolt for my 200mhz speed without affecting my overvolted 1000mhz performance.
Yes, should be possible.
Lope wrote: What will happen with my config if the core exceeds 85 degrees?
I've read that the RbPi will automatically reduce the voltage and frequency if it overheats. What voltage and freq would that be? The minimums? or does it just drop down gradually?
It will switch to min settings (but in reality virtually never happens).

You may want to explain why you want to underclock?
It probably makes no measurable difference to cost of electricity used, or lifespan of the chip.

Re: Underclock and Overclock - dynamic performance & efficie

Posted: Mon Jul 28, 2014 3:15 pm
by Jessie
I did some experements about a year agao to see if I could save power with a in-car media server and it wasn't worth it. I don't recall the clocks and undervolt I ended up with but I recall only saving 0.1W. What I did was set up a samba share and connected 2 tablets to it streaming movies. After that I ran the R Pi's clocks down until my logs read about 90 to 95% CPU use. Then undervolted to the max that was stable.

The problem is that you can't affect the ethernet/usb chip or vreg or any other components consumption. If you read some of the old blogs of the weather baloon guys they found the same results I did.

Re: Underclock and Overclock - dynamic performance & efficie

Posted: Mon Jul 28, 2014 9:05 pm
by Lope
My pi is currently running a VNC server (with no client connected) and an IRC client logging a channel.
That is pretty much it's main function at the moment. I just checked the CPU speed:
cat /sys/devices/system/cpu/cpu0/cpufreq/cpuinfo_cur_freq
200000

So it does drop to the min.

I hear what you guys are saying about not saving any significant amount of power. I guess the value is in the skills/experience of doing it.

As long as 200mhz (at stock volts) isn't going to corrupt anything it's all good.

If you do a google search for (underclock|overclock) raspberry pi sd card corruption you'll find a fair amount of people talking about it. I've not seen any thoroughly documented tests though.

Is there any reason not to underclock?

Re: Underclock and Overclock - dynamic performance & efficie

Posted: Mon Jul 28, 2014 9:28 pm
by AndrewS
Lope wrote:Is there any reason not to underclock?
dom wrote:The defaults are the ones guaranteed to work. Anything else you'll have to test yourself.
;)

Re: Underclock and Overclock - dynamic performance & efficie

Posted: Mon Jul 28, 2014 9:28 pm
by dom
Lope wrote:Is there any reason not to underclock?
There is some latency between the core becoming busy and the higher clock speed being engaged. This will reduce performance a small amount.

Re: Underclock and Overclock - dynamic performance & efficie

Posted: Tue Jul 29, 2014 8:28 am
by Lope
The other reason I thought underclocking is good, is to cool down the core so it's less likely to hit 85c and get throttled.

How easily do the cores hit 85c? (at the default turbo settings of 1000mhz with default overvolt of 6)

Is the RAM also guaranteed to work at 600mhz under the standard turbo settings?

Re: Underclock and Overclock - dynamic performance & efficie

Posted: Tue Jul 29, 2014 8:34 am
by jamesh
Lope wrote:The other reason I thought underclocking is good, is to cool down the core so it's less likely to hit 85c and get throttled.

How easily do the cores hit 85c? (at the default turbo settings of 1000mhz with default overvolt of 6)

Is the RAM also guaranteed to work at 600mhz under the standard turbo settings?
I'm not sure anyone outside a lab has ever hit 85 (and I think that required a hot air gun blowing on the SoC). Someone has reported 80, in a closed unventilated case, running GPU and CPU full tilt (a very unlikely scenario) in ambient of I think 25.

There are no guarantees on anything when you overclock.

Underclocking doesn't really make any difference to core temperature.

Re: Underclock and Overclock - dynamic performance & efficie

Posted: Tue Jul 29, 2014 8:41 am
by RaTTuS
there is no guarantee on speed other than stock YMMV
85deg C is hard to achieve - I've nerver got more than 58 on mine [in a very hot office]

a long time ago I ran it at very low speeds - to try an find what the minimum was - it took a long time to boot - ;-p

but you will not save any power that way [well nothing useful]

Re: Underclock and Overclock - dynamic performance & efficie

Posted: Tue Jul 29, 2014 7:30 pm
by Jessie
The other thing people tend to miss is that the faster a task completes the quicker a SOC can return to an idle power saving state. You can only save power with under-clocking/volting is if you plan on having persistent use.

Re: Underclock and Overclock - dynamic performance & efficie

Posted: Wed Jul 30, 2014 6:22 am
by Lope
So does 700mhz at idle use less power than 50% busy at 200mhz?

Re: Underclock and Overclock - dynamic performance & efficie

Posted: Wed Jul 30, 2014 7:41 am
by RaTTuS
Lope wrote:So does 700mhz at idle use less power than 50% busy at 200mhz?
possibly about the same...
the SOC will switch things off on the chip if it's not doing anything - so the GPU's are mostly quiet all the time unless you are using them
the ARM is a small part of the chip..
the LAN951[2-4] will eat up a shed load and the VR unless you are on a B+

Re: Underclock and Overclock - dynamic performance & efficie

Posted: Fri Jan 09, 2015 11:03 pm
by Vetals
I have model B, and i have set from default params the following:

Code: Select all

arm_freg=500
sdram_freg=200
and then rebooted PI

I have noticed that speed of PI now a little bit increased, so how that can be true?
I did downclock for powersaving purposes, and saving even 0.1W is good for me.

Re: Underclock and Overclock - dynamic performance & efficie

Posted: Sat Jan 10, 2015 9:16 am
by qhiming
if you put enough together, maybe you can surpass other cpus on the market. :)

Re: Underclock and Overclock - dynamic performance & efficie

Posted: Sat Jan 10, 2015 11:20 am
by dom
Vetals wrote:I have model B, and i have set from default params the following:

Code: Select all

arm_freg=500
sdram_freg=200
and then rebooted PI

I have noticed that speed of PI now a little bit increased, so how that can be true?
Note you have typos in those two lines so they will have no effect.
If you believe performance is improved with locwer clock speed, then provide some evidence (e.g. before and after benchmarks like nbench).

Re: Underclock and Overclock - dynamic performance & efficie

Posted: Sat Jan 10, 2015 11:47 am
by pluggy
I read a blog on sending Pi's up with weather balloons and running the things on as small a battery as possible (less weight). All kinds of hardware mods & software stuff to shave milliamps off the load, his conclusion that underclocking was a waste of time, it made practically no difference to the electrical load. It makes sense because the Pi's SOC is 90+ % GPU and the CPU is a very minor player. Obviously the B/B+ was a non starter for current consumption. Electrical load is directly related to temperature. Any form of computer will ultimately turn all the electrical power into heat.

Re: Underclock and Overclock - dynamic performance & efficie

Posted: Sun Jan 11, 2015 12:20 pm
by Vetals
nbench cant finish this task.

I got:

Code: Select all

CPU:NNET--error in opening file
@ pluggy Thanks for the info.

Re: Underclock and Overclock - dynamic performance & efficie

Posted: Sun Jan 11, 2015 12:24 pm
by dom
Vetals wrote:nbench cant finish this task.

I got:

Code: Select all

CPU:NNET--error in opening file
nbench requires two data files in the current directory NNET.DAT and COM.DAT - do you have those?

Re: Underclock and Overclock - dynamic performance & efficie

Posted: Sun Jan 11, 2015 2:46 pm
by Vetals
@ dom

Yes, i put 2 of those files in /usr/local/bin and still error.

Okay, i give up on this.

My info was based on visual basis only. And since i put info of my config.txt anyone can provide info from that app.

Its strange to me, that, with Raspi Default config apps like: screen, mocp, ssh sometimes work faster, sometimes slower. And after i downclocked Pi it seemed to me that Pi started to work a little bit faster.