Bakul Shah wrote:Takuya Ooura's pi_css5 program on the Raspi computes the first million digits of Pi in under 79 seconds (compared to under 3s on a 3.6Ghz AMD FX). So I'd say the Raspi is plenty fast!
Bakul - thank you for coming to the aid of a fellow engineer. If anyone who can read actually goes and looks at the honorable Ooura-san's source (http://left404.com/misc/files/pi_css5/pi_css5_src.tgz
), they will see references to FFT, which a few folks here should recognize as the Fast Fourier Transform. In particular, there is a curious note about "Number of Floating Point Operations", and further reading will show that log base 2 and square root functions are called. If I'm not mistaken, those can be performed on FP hardware a LOT faster than any integer hardware of the same class (e.g., a class would be a typical microprocessor, an SoC, a massively-parallel supercomputer, etc.). There are other notes about "DBL_ERROR_MARGIN" and "FFT+machine+compiler's tolerance", which correspond precisely to the avoidance of rounding errors by only using unrounded bits as I posted about earlier. I am listening for the church keys opening some nice, fresh cans of crow to be consumed in large quantities.
Bakul Shah wrote:And Jim, AFAIK programs computing first N digits of π don't benefit by using a GPU!
I'll show you when I see you at the Maker Faire this weekend, assuming you're going again. Maybe between you, Eben, a few other geeks, and I scribbling on napkins at lunch, we can produce the implementation in much less time than it would take for any of us to do it alone. I don't expect the uninformed here to be of much help.
OtherCrashOverride wrote:The PI uses OpenGL ES 2.0 with few extensions. The impact of this is that there is no way to get data out of the vertex shader stage directly since transform feedback would be required (part of GL ES 3). The PI also lacks floating point texture support so that means input to the vertex shader is limited to sequential vertex data (no random access from floating point textures) and output from the pixel shader stage is limited to 4 values each with 8 bits. Additionally, since GL ES 2 does not support Pixel Buffer Objects (PBO) there is no clearly defined way to get the computational results back to the CPU. In short, GPGPU on the PI is a one way trip and of limited practical use.
Well, I disagree completely and if we can establish the confab noted in the previous paragraph, I believe we will have proof that this is quite feasible. I haven't looked closely at the OGLES 3 spec yet, but is there anything in there that the Pi GPU won't be able to support? I can't imagine that being the case since the A series SoCs in Apple's iOS products and Exynos/Tegra/whatever SoCs in Android devices have essentially the same functional properties as the VideoCore IV architecture used in the Pi's GPU.
As for extensions, well, they're not exactly standard now, are they? However, that does suggest another approach if there really is no access to computational results - it should be relatively simple for someone with access to the Broadcom toolset to break out intermediate results, assuming the pipeline hardware isn't so tightly-wound that the successive stages can only feed each other from start to finish. We only need a few functions such as scaling to be able to do some quite useful computational things.
Again, I heartily disagree - WebGL is a chicken-and-egg situation precisely because so few people really understand what *GL* (in all its various forms, hence the stars) is about. I cut my teeth on the Original Flavor GL on SGI hardware when it was first using a 16 ~ 33MHz MC68020 CPU, so I understand what you're trying to say. However, there's a prime example of a relatively weak CPU acting as a traffic cop for a kick-butt (for 1986) GPU in the form of the original Geometry Pipeline architecture - 30,000 Gouraud-shaded polygons per second, no waiting!
The Pi isn't alone when it comes to a lack of a WebGL-compatible browser - Safari on iOS and even Google's own Chrome browser on Android also suffer this fate, but it's not because it can't be done, the resources just haven't been applied. Even Microsloth hasn't bothered implementing WebGL in Internet Exploiter but, then again, they're so far behind in useful browser features that this is not exactly news. If a lack of content were really a barrier, then commercial radio and TV should never have gotten off the ground, should they? Why should Gutenberg have invented the movable type printing press since monks had produced plenty of religious texts by hand for millennia up until that point? I mean, really? However, I shouldn't be surprised since it took Edison about 20 years to wean people off of gas lamps, despite all of the demonstrable advantages of electric lights - oh, like the elimination of an open flame in heavily-draped rooms and around excessively-draped people!
As for content that has "large texture memory and geometry requirements", we can easily find web content that will bring any browser to its knees on any typical consumer computing platform because of all of the dynamic trash that's thoughtlessly attempted to be crammed through the Internet. There are plenty of WebGL-based interactive animations with quite reasonable 3-D resource needs that would be wonderful to be able to show and interact with in educational environments, and if we can do it on a Pi, then we will have arrived at that intersection between Heaven, Nirvana, Shangri-La, and other forms of Paradise. Schools block lots of content exactly because they require more bandwidth than their networks and even many of their computers can handle (ever heard of YouBoob, I mean YouTube? It's not available in many K-12 schools, so we teachers have to capture it and bring it in on removable media).
As for the personality thing, I come from a military background (and aviation, at that), and we like to horse around in competitive jousts to relieve the stress, so I apologize to the more sensitive ladies in the room if I have offended them (oh, darn, they're going to send me right back into the touchy-feely sessions, aren't they?
). I really get my dander up when people always assume that you have to have all of the bells and whistles on everything all of the time or it's not worthwhile pursuing something. That's why the economy wound up in such a big pinch - gluttony begot poverty for many because they really didn't deserve a five-bedroom house filled with six-foot diagonal HDTVs and a three-car garage stuffed with suburban assault vehicles.
The entire philosophy of the Pi is all about making reasonable trade-offs between the best available this week and what was quite acceptable just a couple of years ago that now costs a pittance. That's why I get so animated and vociferous about the poppycock being bandied about not just in this thread, but in many others. The nerdocracy needs to back off and comprehend what the Pi was really designed for, stop trying to make the poor little ARM CPU do things it's just not capable of, and consider how the GPU can be put to better use, as it clearly does have advantages that haven't been exploited much at all, much less fully.
Great things have never happened because a committee of like-minded intellectuals sat around a big table and pontificated upon the lint in their navels. They happened because some lunatics burst into the room, set the drapes on fire while excitedly waving sparklers around, and knocked over the punch bowl. This quite accidentally put out said drapes ala flambé, which coincidentally allowed sunbeams to enter the room through the newly-bared windows and cast the problems under consideration in literally an entirely new light. I don't even consider myself one of those lunatics - I've worked with some brilliant ones though, and if you think I'm over-the-top, you really don't want to leave your comfortable surroundings and venture out into their world. It's filled with all sorts of scary things like glaring electric lights, supposedly cancer-inducing radio waves, intertubes filled with all manner of strange visual and audible over-stimulation, etc.
Don't take things so personally. I was never attacking the OP's efforts from a nostalgic perspective, but he cited performance numbers and that's a sure-fire way to attract unwanted attention. I'm just trying to point out to his responders that the Pi's ARM CPU "... is not the droid you're looking for." Here's some words of wisdom from Edna St. Vincent Millay: “My candle burns at both ends; it will not last the night; but ah, my foes, and oh, my friends -- it casts a lovely light.” Or, you can take Shakespeare at his words: "There are more things in Heaven and Earth, Horatio, than are dreamt of in your philosophy." Then again, Dan Aykroyd kinda summed up the joys of witty, intentionally-provocative banter on an early "Saturday Night Live" episode with: "Jane, you ignorant slut ... "