Raspberry Pi Pico Parallel Mandelbrot Computation

Several Raspberry Pi Picos connected to each other

The Mandelbrot set is — when visualized with some colors — an interesting shape with infinite detail. While the patterns are immediately obvious to the human eye, anyone who’s run one can tell you that they’re pretty computationally expensive to produce. Fortunately, as with many things in graphics, rendering the Mandelbrot set can be easily parallelized.

That’s what [rak277] and [ir93] demonstrate in their RP2040-based finals project. Computron, as they call it, is a network of Raspberry Pi Picos that work together to compute a visualization of the Mandelbrot set and show it on a VGA display. The Computron is made of two or more “math units” and one “projection unit”. The math units communicate over a shared I²C bus with the projection unit to first divide the workload and then compute their share of the work.

This project shows both the strengths and limitations of parallel computation. It makes use of multiple math units on a highly parallelizable workload, but as more math units are added there are diminishing performance gains due to the increased communications load on the network, which [rak277] and [ir93] suspect to be the current bottleneck in the Computron.

If you’re fresh out of Pi Picos, and don’t mind waiting awhile, you could always crank out a Mandelbrot set on your trusty Atari 800 in BASIC.

11 thoughts on “Raspberry Pi Pico Parallel Mandelbrot Computation

  1. If you add two or more “manager units” they could each control multiple math units.

    Assuming your diminished returns start around eight, then eight managers (with eight math units each) gives you 64 math units at the cost of 1 hierarchy level.

  2. The Mandelbrot set should be very suitable for parallel computing. Each tile can be computed fully independent. The only bottleneck is the transmission of the result. I wonder that they use I2C which is slow compared to SPI. They could have use also the PIO which enables even faster transmissions.

    Another question is: The RP2040 is a dual core. Did they use both cores of each PiPico?

    1. Lewis: was the death instant ?
      Morse: The coffee is instant, Lewis, death is instantaneous.
      Like each tile, they can be computed independently of each other. It doesn’t look like they are using both cores, but they may post the code at some point :).

  3. Come on. Let’s calculate that in fractions, so having exact results and put those results into a world wide data base. Maybe it can even be turned into a proof-of-work hurdle as spam blocker. Win-win!

    …but don’t look surprised about how long it takes to get those iterations done in a “lossless” number representation and calculation! Instead imagine all those only approximately calculated Mandelbrot set images in the nets! Floats are the MP3s of the numbers! Let’s finally do it right! Full fidelity! Quotients of thousands of digits and more if needed!

  4. Steve Ciarcia had an article in Byte in the late ’80s describing a DIY Mandelbrot engine with 64 8751 cards calculating and feeding data to PC/AT for displaying.

    Today probably a single RasPi Pico has more computing power than the 64 8751 cards and AT combined.

    1. In the late 80s I took over a college computing lab and ran a parallel Mandelbrot over a Novell network. The most impressive part was that I had no documentation, so it was all baling wire and tape. I later learned enough FORTRAN to run on the local microvax, which was faster than the ~20 PCs. And a few years later someone got an SGI which did it all in real time.

Leave a Reply

Please be kind and respectful to help make the comments section excellent. (Comment Policy)

This site uses Akismet to reduce spam. Learn how your comment data is processed.