Jeff Geerling's PiG Makes It Easier to Experiment with PCIe Add-In Boards on the Raspberry Pi CM4

Effectively a reverse PCIe card, the PiG works with a passive base to link the Raspberry Pi Compute Module 4 to PCIe add-in boards.

Gareth Halfacree
1 year agoHW101

Jeff Geerling is continuing to fight for high-performance graphics on the Raspberry Pi, and now has a new tool on his side: the PiG, a Raspberry Pi Compute Module 4 carrier board designed to make it easier to test GPU add-in boards on the platform.

The project builds on Geerling's work on getting an AMD Radeon add-in board graphics card working on the Raspberry Pi Compute Module 4, taking advantage of the exposed PCI Express lane reserved on the Raspberry Pi 4 single-board computer for the USB 3.0 controller. "What we found is the BCM2711's PCIe root complex is fundamentally broken," Geerling concluded in April last year, two years into the effort, "at least when it comes to some memory operations on 64-bit Linux."

A PCIe card designed to plug into PCIe cards, the PiG is an unusual carrier board for the Raspberry Pi CM4. (📹: Jeff Geerling)

That hasn't stopped Geerling from wanting to experiment with high-performance graphics cards and other add-in boards on the Raspberry Pi Compute Module 4, though — and that's where his latest creation comes in. Teaming up with hardware designer Mirek Folejewski, Geerling has produced a carrier board for the CM4 module that turns it into the "PiG" — which can only be described as a reverse PCI Express card.

"Last year I floated the idea of a custom PCB to 'plug a computer into a graphics card' to Mirek. He didn't immediately say 'no', so I started pursuing the idea, coming up with this quite basic post-it note illustration," Geerling recalls. "Miraculously, through a series of emails, we refined that concept into a working PCB design. Mirek had it printed by JLCPCB, soldered on a bunch of SMD components, and shipped the PCBs (along with some metal brackets he had his friend Adam fabricate) by February."

The board design looks, at first glance, like it's built to insert the Raspberry Pi CM4 into a desktop PC as a coprocessor module, taking as it does the form of a PCI Express 4x add-in card. That's not the case, though, and inserting it into a motherboard's PCIe slot will likely end badly. "It can physically slot inside a computer in a motherboard," Geerling explains, "but that is not recommended, as I haven't tested that configuration…"

Rather, the male PCIe edge connector on the card is designed to act like the female slot on a motherboard — and, in conjunction with a base stand which has two electrically-connected female PCIe slots, allows the CM4 to be easily and quickly connected to PCIe add-in boards for testing. Various other features of the CM4 are broken out elsewhere on the card, too, including the usual 40-pin general-purpose input/output (GPIO) header, Ethernet, HDMI, USB, and a DC power connector which includes pass-through power to a connected PCIe card.

While the new carrier board makes it easy to test new graphics cards, there's still little point. "It's still a bit grim," Geerling admits of software support for high-performance GPUs. "So far we only have some older AMD cards working with a kernel patch for the radeon graphics driver, and the SM750 GPU which is used on ASRock Rack's M2_VGA, using [a] patch to the sm750 driver."

"The Pi isn't alone," Geerling adds. "It seems other SBC SoCs [Systems on Chips] like the Rockchip RK3566 and RK3588 have a slightly broken PCIe implementation as well. 'Cache coherency' is the problem — these ARM SoCs that have their heritage in TV boxes and embedded devices don't have fully working PCI Express implementations."

More information on the project is available on Geerling's website, while Folejewski has released the PiG design under the CERN Open Hardware License v1.2 on GitHub.

Gareth Halfacree
Freelance journalist, technical author, hacker, tinkerer, erstwhile sysadmin. For hire: freelance@halfacree.co.uk.
Latest articles
Sponsored articles
Related articles
Latest articles
Read more
Related articles