2

External GPUs working on the Raspberry Pi 5

 9 months ago
source link: https://www.jeffgeerling.com/blog/2023/external-gpus-working-on-raspberry-pi-5
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

External GPUs working on the Raspberry Pi 5

November 28, 2023

My journey testing various graphics cards on the Raspberry Pi began soon after the Compute Module 4 was launched in 2020. Since then I've tested almost 20 graphics cards—with a little success.

But there were two roadblocks to getting drivers for even older AMD radeon drivers working well:

  1. The maximum PCIe Gen 2.0 bandwidth meant use cases were limited to 'processing on GPU' tasks like GPU-assisted compute. Even in the base case, external cards couldn't necessarily pipe through data quick enough for modest gaming or other real-time tasks.
  2. (And most impactful) The BCM2711 SoC used on the CM4 and Pi 4 had some strange PCI Express bus quirks that caused hard crashes and various faults in drivers attempting to use 64-bit memory addresses. There were strange and exotic workarounds—but these workarounds led to even more limited performance!
Raspberry Pi 5 with AMD XFX RX 460 graphics card

The Pi 5, fortunately, seems to have fixed the PCIe bus quirks with its new BCM2712 SoC, and the new chip also introduces unofficial support for PCIe Gen 3.0 speeds (8 GT/sec versus the CM4's 5).

External GPU bringup on the Pi 5 was much faster since we now know many of the driver quirks are due to old code assuming an X86 architecture.

In the video below, I demonstrate the Pi 5 displaying Wayfire through an AMD RX 460, and running at least much of the glmark2 test:

As chronicled in the RX 460 testing GitHub issue (and related issue #6, user Coreforge got a glmark2 score of 3441 over PCIe Gen 1 speeds, had Steam launching (but sometimes crashing) using box86 and box64, ran Portal and Portal 2 with no issues (outside of Steam), and Minecraft 1.14.4 ran but at a reduced framerate due to the lower-speed PCIe Gen 1 connection.

When I have more time (right now I'm in the middle of moving all my gear to a new space...), I will join in more testing, but hopefully Pineberry Pi can get a PCIe adapter like their prototype uPCity I'm using to market, so more people can test and squash the remaining memory alignment bugs for older cards like the RX 460.

I have also been testing my RX 6700 XT, which also uses the amdgpu Linux driver, but with some newer extensions. I have gotten through a few roadblocks but am currently stuck at the part where the driver attempts initializing Display Core.

Honestly, I'm approaching 'infantile' stages of familiarity with graphics drivers, but I know enough to mess up the driver (a lot) and quite rarely get something working on my own. I hope that with the Pi 5's better PCIe bus (and Gen 3.0 speeds, even if unofficial), more people can work on squashing arm64 vs x86-related memory access bugs in various drivers.

The best thing is on the Pi 5, I've so far never encountered any bugs where the entire system crashes (to the point the kernel can't recover). On the Compute Module 4, I had to hard pull power and re-apply it to get back into a working state! Debugging is immeasurably if you can get an error message or exception, and the entire system doesn't explode every time you test it :)

Many other PCIe cards 'just work' out of the box on the Pi 5, and as always—you can follow my progress testing various devices over on the Raspberry Pi PCIe database.


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK