Let’s say you’re at a gathering – maybe a cocktail party or a crowded club – and some buff athlete shows up on crutches. He immediately becomes the center of attention as he recounts the story of his injury: “Dude, it was gnarly… total sick shred. Now I’m waitin’ on the MRI results. The docs think I might never shred again, but I’m stoked to get back out there.”

Is there any way that you, a computer geek, can get the conversational focus back where it belongs –  on you? Sure you can; just say this:  “Really? You’re waiting? They can do MRIs in real time now, and not just an image, but a whole movie. Like better than YouTube, yo… here’s how it works…”

At last week’s GPU Technology Conference in San Jose, researchers from Cal Berkeley and the Max Planck Institute showed how MRI images can now be processed so quickly and accurately that they can be shown as full-motion, real-time videos instead of static, printed output. First, a little background:


MRI machines use magnets arranged in coils to create strong magnetic fields around the body. This field, along with radio waves that are sent at the same time, causes the protons in our bodies to align themselves. When they’re aligned, the protons absorb energy from the waves and release this energy in the form of return radio signals. These return signals are captured by the machine and, after processing, create the 3D MRI picture.

A typical MRI machine has four coils ranging around the circumference of the machine, each of which is sending out its own unique field and collecting the resulting radio waves. Reconstructing this output into an accurate and useful image is a difficult problem. Each coil is seeing a different picture due to its location and its unique properties. Reconciling these differences into a clear and accurate picture of slimy internal body parts requires a lot of long mathematical formulas that utilize operators I’ve never seen before.

While it’s a complex computation, it’s highly parallel in nature, which makes it a great candidate for using accelerators like GPUs to speed processing. What does it take to turn MRIs into a real movie? You have to parallelize the problem so that all the math can be run very quickly and concurrently.

But for this to become a truly useful invention, it has to be performed with computing equipment that is readily available and doesn’t require the budget of a national lab to procure. Our presenters have found that a 12.7 Teraflop/s, two-socket Xeon system with 96GB RAM and four GTX 580 (total of 8 GPUs) will do the trick.

Their first implementation revealed that they could push around four frames per second (FPS) with a single GPU, with speed-up of 1.7x using dual GPUs. However, adding a fourth GPU only yielded around 2.2x speed-up, meaning they were topping out at around 8-10 FPS on reasonably  complicated scans.

The problem was rooted in one of their algorithm pieces, but was also due to slower inter-GPU communication. When data was transferred between GPU0 or GPU1 to GPU2 or GPU3, the data had to pass through the CPU, slowing it to a relatively pokey 2.5 GB/s.

By changing the way the algorithm transferred memory to and from the GPU, and also the amount of memory it needed to actually transfer, they decreased overall transfer times by 3.5x compared to their previous best result. While they didn’t actually use the term RDMA (Remote Direct Memory Access) in their slides or accompanying dialog, I think that’s what they were doing. But given the complexity of the problem, just using RDMA wasn’t enough to provide the real-time performance the researchers needed.

In working through multi-GPU optimization, they realized that they needed a multi-GPU programming library. So they built one, and now it’s available to the community. It allows users to write identical code to run on one, two, four, or more GPUs – and, according to the researchers, “It just works.” (You can find their library here.)

Full motion, real-time MRI has a huge range of medical benefits because doctors can get a much better picture of exactly what’s happening in the body at any given point. They’ll get that information faster and more clearly than ever before. And, as outlined above, there are advantages even for those of us who aren’t patients or doctors; we can use this conversation about real-time MRIs to steal back the spotlight from that snowboarding dude with the cast on his leg.

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>