dom
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 5370
Joined: Wed Aug 17, 2011 7:41 pm
Location: Cambridge

Determining how fast your Pi really is

Sun Jul 20, 2014 3:40 pm

I've discovered how to use the ring oscillator to measure how fast or slow the silicon in your particular Pi is.

Latest (rpi-update) firmware includes a new gencmd:

Code: Select all

$ vcgencmd read_ring_osc
read_ring_osc(2)=2.947MHz (@1.20V)
The number returned is proportional to the fastness of the silicon.
I believe that it varies from around 2.5MHz for slow silicon up to around 3.25MHz for fast silicon.

Having a higher number implies a higher level of overclock is possible.
So, if you are unable to achieve a high overclock and the ring oscillator shows a low value, then you are probably limited by the silicon.
So, if you are unable to achieve a high overclock and the ring oscillator shows a high value, then the problem is probably down to the power supply.

In theory it could be possible to create an sdcard image that picks an optimal overclock based on this reading.

Note, the number increases with core_voltage, so it's best to measure this with overclock/overvolt disabled, so everyone is on the same scale.

I'd be intested if overclockers can post their ring oscillator value (at 1.2V), and the highest stable overclock settings, and we'll see what the pattern is.

On by B+ I get:
read_ring_osc(2)=2.947MHz (@1.20V)

arm_freq=1100
core_freq=600
sdram_freq=600
over_voltage=8

seems stable, so this Pi seems pretty fast.

fruitoftheloom
Posts: 21054
Joined: Tue Mar 25, 2014 12:40 pm
Location: Delightful Dorset

Re: Determining how fast your Pi really is

Sun Jul 20, 2014 6:02 pm

No overclock

vcgencmd read_ring_osc
read_ring_osc(2)=2.911MHz (@1.20V)

950 0verclock

vcgencmd read_ring_osc
read_ring_osc(2)=2.920MHz (@1.20V)
Retired disgracefully.....
This at present is my daily "computer" https://www.asus.com/us/Chrome-Devices/Chromebit-CS10/

User avatar
Gert van Loo
Posts: 2486
Joined: Tue Aug 02, 2011 7:27 am
Contact: Website

Re: Determining how fast your Pi really is

Sun Jul 20, 2014 6:15 pm

The ring oscillator will not change when you over-clock.
It will only change if you vary the voltage.

jdb
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 2152
Joined: Thu Jul 11, 2013 2:37 pm

Re: Determining how fast your Pi really is

Sun Jul 20, 2014 6:49 pm

My B+:

Code: Select all

Over_volt	MHz	Volts
-2		2.582	1.150
-1		2.720	1.175
0		2.858	1.200
1		2.942	1.225
2		3.056	1.250
3		3.118	1.275
4		3.284	1.300
5		3.366	1.325
6		3.508	1.350
Rockets are loud.
https://astro-pi.org

KTWS
Posts: 75
Joined: Thu Dec 27, 2012 8:01 am

Re: Determining how fast your Pi really is

Sun Jul 20, 2014 6:52 pm

Stable overclocks using the same sd card and usb peripherals:

-----------------------------------
Model B, 512MB Rev2
-----------------------------------
read_ring_osc(2)=3.005MHz (@1.20V)

arm_freq=1150
core_freq=600
sdram_freq=600
over_voltage=8

-----------------------------------
Model B, 256MB
-----------------------------------
read_ring_osc(2)=2.974MHz (@1.20V)

arm_freq=1150
core_freq=600
sdram_freq=550*
over_voltage=8
over_voltage_sdram=6

* 450 max without over_voltage_sdram=6. Unable to reach 600.
Ubeify Desktop Media Player For Raspberry Pi Zero, 1, 2 & 3
http://www.ubeify.co.uk/

MaxK1
Posts: 1043
Joined: Sun Aug 26, 2012 11:34 pm

Re: Determining how fast your Pi really is

Sun Jul 20, 2014 8:04 pm

I'm getting different readings between 2.996 and 3.001 on back to back runs of vcgencmd with 2.999 being about average - is that "expected" or not?
You are in a maze of twisty little passages, all alike.
When General Failure and Major Disaster get together, Private Parts usually suffers.

drgeoff
Posts: 9915
Joined: Wed Jan 25, 2012 6:39 pm

Re: Determining how fast your Pi really is

Sun Jul 20, 2014 8:17 pm

MaxK1 wrote:I'm getting different readings between 2.996 and 3.001 on back to back runs of vcgencmd with 2.999 being about average - is that "expected" or not?
If you are an engineer you expect it. If you are a scientist, you get excited about it. :lol:

(Apologies to any offended scientists.)

MaxK1
Posts: 1043
Joined: Sun Aug 26, 2012 11:34 pm

Re: Determining how fast your Pi really is

Sun Jul 20, 2014 9:21 pm

It was more of a fishing expedition to find out if there is anything else that influences the frequency reported. I just hope I can come up with a more suitable acronym than the one I have so far -
Calibrated Over Clockers Kit.... ;-)
You are in a maze of twisty little passages, all alike.
When General Failure and Major Disaster get together, Private Parts usually suffers.

User avatar
redhawk
Posts: 3465
Joined: Sun Mar 04, 2012 2:13 pm
Location: ::1

Re: Determining how fast your Pi really is

Sun Jul 20, 2014 9:27 pm

Shouldn't that be how fast your Pi "could" be rather than really "is" ??

Well I guess I'm not so lucky my CPU ringer is 2.88MHz tops but nevertheless 2 years solid with same micro SD card (and lots of hammering) it's still tick-a-dee-boo. :)

Just out of curiosity is there a Linpack Benchmark program or equivalent that runs under Raspbian??

Richard S.

asandford
Posts: 1997
Joined: Mon Dec 31, 2012 12:54 pm
Location: Waterlooville

Re: Determining how fast your Pi really is

Sun Jul 20, 2014 10:48 pm

is this bad?

Code: Select all

[email protected] ~ $ vcgencmd read_ring_osc
error=1 error_msg="Command not registered"
[email protected] ~ $ sudo vcgencmd read_ring_osc
error=1 error_msg="Command not registered"
[email protected] ~ $ uname -a
Linux sandford 3.12.24+ #694 PREEMPT Tue Jul 15 17:34:35 BST 2014 armv6l GNU/Linux

ShiftPlusOne
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 6074
Joined: Fri Jul 29, 2011 5:36 pm
Location: The unfashionable end of the western spiral arm of the Galaxy

Re: Determining how fast your Pi really is

Sun Jul 20, 2014 10:49 pm

asandford wrote:is this bad?

Code: Select all

[email protected] ~ $ vcgencmd read_ring_osc
error=1 error_msg="Command not registered"
[email protected] ~ $ sudo vcgencmd read_ring_osc
error=1 error_msg="Command not registered"
[email protected] ~ $ uname -a
Linux sandford 3.12.24+ #694 PREEMPT Tue Jul 15 17:34:35 BST 2014 armv6l GNU/Linux
You probably didn't run rpi-update?

asandford
Posts: 1997
Joined: Mon Dec 31, 2012 12:54 pm
Location: Waterlooville

Re: Determining how fast your Pi really is

Sun Jul 20, 2014 11:01 pm

ShiftPlusOne wrote:
asandford wrote:is this bad?

Code: Select all

[email protected] ~ $ vcgencmd read_ring_osc
error=1 error_msg="Command not registered"
[email protected] ~ $ sudo vcgencmd read_ring_osc
error=1 error_msg="Command not registered"
[email protected] ~ $ uname -a
Linux sandford 3.12.24+ #694 PREEMPT Tue Jul 15 17:34:35 BST 2014 armv6l GNU/Linux
You probably didn't run rpi-update?
I did a few hours ago, but having done it again:

Code: Select all

[email protected] ~ $ uname -a
Linux sandford 3.12.24+ #694 PREEMPT Tue Jul 15 17:34:35 BST 2014 armv6l GNU/Linux
[email protected] ~ $ vcgencmd read_ring_osc
read_ring_osc(2)=3.027MHz (@1.20V)
Is there a command that says what firmware is being used?

User avatar
redhawk
Posts: 3465
Joined: Sun Mar 04, 2012 2:13 pm
Location: ::1

Re: Determining how fast your Pi really is

Sun Jul 20, 2014 11:07 pm

Is there a command that says what firmware is being used?
vcgencmd version

Richard S.

ShiftPlusOne
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 6074
Joined: Fri Jul 29, 2011 5:36 pm
Location: The unfashionable end of the western spiral arm of the Galaxy

Re: Determining how fast your Pi really is

Sun Jul 20, 2014 11:15 pm

Be sure to do a proper restart. Shut down, remove power, and power it up again.

shuckle
Posts: 565
Joined: Sun Aug 26, 2012 11:49 am
Location: Finland

Re: Determining how fast your Pi really is

Mon Jul 21, 2014 6:25 am

My old model B (Revision 000e) (no overvoltage) ringer varies:
read_ring_osc(2)=2.837MHz (@1.20V) - read_ring_osc(2)=2.850MHz (@1.20V)

I I have used stable overclock to
arm_freq=1100
core_freq=500
sdram_freq=450
over_voltage=6

User avatar
AndyD
Posts: 2333
Joined: Sat Jan 21, 2012 8:13 am
Location: Melbourne, Australia
Contact: Website

Re: Determining how fast your Pi really is

Mon Jul 21, 2014 6:56 am

ShiftPlusOne wrote:Be sure to do a proper restart. Shut down, remove power, and power it up again.
This is new to me. I have always just used sudo reboot after rpi-update updates the firmware and I always use the latest firmware release (as I have raised a number of issues on github in the past for the firmware). The firmware appears to restart with just a reboot (i.e. rainbow screen appears). Is it really necessary to remove the power after a firmware update? Happy to be educated, just surprised that a power cycle is required.
Last edited by AndyD on Mon Jul 21, 2014 8:17 am, edited 1 time in total.

User avatar
r3d4
Posts: 968
Joined: Sat Jul 30, 2011 8:21 am
Location: ./

Re: Determining how fast your Pi really is

Mon Jul 21, 2014 8:06 am

AndyD wrote: Happy to be educated, just surprised that a power cycle is required.
http://www.youtube.com/watch?v=C2Ph8zwpNyI

;P
Real life is, to most, a long second-best, a perpetual compromise between the ideal and the possible.
-
Meanwhile, the sysadmin who accidentally nuked the data reckons "its best not run anything more with sudo today"
-
what about spike milligan?

ShiftPlusOne
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 6074
Joined: Fri Jul 29, 2011 5:36 pm
Location: The unfashionable end of the western spiral arm of the Galaxy

Re: Determining how fast your Pi really is

Mon Jul 21, 2014 8:32 am

AndyD wrote:
ShiftPlusOne wrote:Be sure to do a proper restart. Shut down, remove power, and power it up again.
This is new to me. I have always just used sudo reboot and I always use the latest firmware release (as I have raised a number of issues on github in the past for the firmware). The firmware appears to restart with just a reboot (i.e. rainbow screen appears). Is it really necessary to remove the power after a firmware update? Happy to be educated, just surprised that a power cycle is required.
It's a "just in case" paranoid sort of thing. I've just asked and the firmware should indeed be re-read when you reboot.

mikerr
Posts: 2784
Joined: Thu Jan 12, 2012 12:46 pm
Location: UK
Contact: Website

Re: Determining how fast your Pi really is

Mon Jul 21, 2014 8:46 am

Rev1 - Revision 0002
not much luck overclocking at all

Code: Select all

 vcgencmd read_ring_osc
read_ring_osc(2)=3.072MHz (@1.20V)
Rev2 - 000e
Can run Turbo

Code: Select all

vcgencmd read_ring_osc
read_ring_osc(2)=2.895MHz (@1.20V)
Rev2 - 000e (different one)
Best is HIgh

Code: Select all

vcgencmd read_ring_osc
read_ring_osc(2)=2.898MHz (@1.20V)
Android app - Raspi Card Imager - download and image SD cards - No PC required !

User avatar
RaTTuS
Posts: 10498
Joined: Tue Nov 29, 2011 11:12 am
Location: North West UK
Contact: Twitter YouTube

Re: Determining how fast your Pi really is

Mon Jul 21, 2014 9:51 am

read_ring_osc(2)=2.793MHz (@1.20V)
Revision : 0002

read_ring_osc(2)=2.962MHz (@1.20V)
Revision : 000d

read_ring_osc(2)=2.887MHz (@1.20V)
Revision : 000e

read_ring_osc(2)=3.006MHz (@1.20V)
Revision : 0010

[edit] added My Model A
read_ring_osc(2)=3.021MHz (@1.20V)
Revision : 0008
Last edited by RaTTuS on Mon Jul 21, 2014 11:18 am, edited 1 time in total.
How To ask Questions :- http://www.catb.org/esr/faqs/smart-questions.html
WARNING - some parts of this post may be erroneous YMMV

1QC43qbL5FySu2Pi51vGqKqxy3UiJgukSX
Covfefe

User avatar
AndyD
Posts: 2333
Joined: Sat Jan 21, 2012 8:13 am
Location: Melbourne, Australia
Contact: Website

Re: Determining how fast your Pi really is

Mon Jul 21, 2014 10:08 am

ShiftPlusOne wrote:It's a "just in case" paranoid sort of thing. I've just asked and the firmware should indeed be re-read when you reboot.
Thanks.

User avatar
Burngate
Posts: 6091
Joined: Thu Sep 29, 2011 4:34 pm
Location: Berkshire UK Tralfamadore
Contact: Website

Re: Determining how fast your Pi really is

Mon Jul 21, 2014 10:24 am

Can someone explain what "the ring oscillator" is used for?
That phrase implies there's only one, which immediately leads to two questions: why not more? and why not zero?
And the result ("read_ring_osc(2)=2.947MHz (@1.20V)") raises two more wonderings: does the (2) imply we could get a different answer, e.g. "read_ring_osc(34159)=...."? and ,with various other quoted frequencies being in the hundreds of MHz, what earthly use is something as slow as ~3MHz?

jamesh
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 24129
Joined: Sat Jul 30, 2011 7:41 pm

Re: Determining how fast your Pi really is

Mon Jul 21, 2014 10:44 am

Burngate wrote:Can someone explain what "the ring oscillator" is used for?
That phrase implies there's only one, which immediately leads to two questions: why not more? and why not zero?
And the result ("read_ring_osc(2)=2.947MHz (@1.20V)") raises two more wonderings: does the (2) imply we could get a different answer, e.g. "read_ring_osc(34159)=...."? and ,with various other quoted frequencies being in the hundreds of MHz, what earthly use is something as slow as ~3MHz?
http://en.wikipedia.org/wiki/Ring_oscillator
Principal Software Engineer at Raspberry Pi (Trading) Ltd.
Contrary to popular belief, humorous signatures are allowed. Here's an example...
“I think it’s wrong that only one company makes the game Monopoly.” – Steven Wright

dom
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 5370
Joined: Wed Aug 17, 2011 7:41 pm
Location: Cambridge

Re: Determining how fast your Pi really is

Mon Jul 21, 2014 10:46 am

Burngate wrote:Can someone explain what "the ring oscillator" is used for?
That phrase implies there's only one, which immediately leads to two questions: why not more? and why not zero?
And the result ("read_ring_osc(2)=2.947MHz (@1.20V)") raises two more wonderings: does the (2) imply we could get a different answer, e.g. "read_ring_osc(34159)=...."? and ,with various other quoted frequencies being in the hundreds of MHz, what earthly use is something as slow as ~3MHz?
There appear to be 3

Code: Select all

vcgencmd read_ring_osc 0
vcgencmd read_ring_osc 1
vcgencmd read_ring_osc 2
You can pass in other numbers, but they don't lock, and so don't produce an answer. Without a paramater it defaults to 2 which appears to be the more interesting one.

Gert may be able to explain how the other two ring oscillators differ.

jdb
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 2152
Joined: Thu Jul 11, 2013 2:37 pm

Re: Determining how fast your Pi really is

Mon Jul 21, 2014 10:56 am

dom wrote:
Burngate wrote:Can someone explain what "the ring oscillator" is used for?
That phrase implies there's only one, which immediately leads to two questions: why not more? and why not zero?
And the result ("read_ring_osc(2)=2.947MHz (@1.20V)") raises two more wonderings: does the (2) imply we could get a different answer, e.g. "read_ring_osc(34159)=...."? and ,with various other quoted frequencies being in the hundreds of MHz, what earthly use is something as slow as ~3MHz?
There appear to be 3

Code: Select all

vcgencmd read_ring_osc 0
vcgencmd read_ring_osc 1
vcgencmd read_ring_osc 2
You can pass in other numbers, but they don't lock, and so don't produce an answer. Without a paramater it defaults to 2 which appears to be the more interesting one.

Gert may be able to explain how the other two ring oscillators differ.
I would wager that they are in different physical locations on the chip. They may also be constructed differently to have differing sensitivities to process variation parameters. The low single-digit MHz is probably because the "ring" is running at several hundred MHz and has an output divider to get a reasonable system cycle count per oscillator period.

There's a thesis that goes into this in ridiculous detail:

http://www-mtl.mit.edu/researchgroups/M ... Thesis.pdf
Rockets are loud.
https://astro-pi.org

Return to “Advanced users”