When Rockchip first introduced the Rockchip RK3399 processor with a PCIe interface people initially hoped they could connect graphics card, but those hopes were quickly squashed due to a 32MB addressing limit.
However, the PCIe implementation on the newer Rockchip RK3588 processor does not have such a limitation, and last November, Radxa teased a demo with an AMD Radeon Pro WX 5100 PCIe graphics card connected to the Rock 5B SBC running the glxgears demo on the Radeon GPU.
I couldn’t find any instructions to reproduce this setup, but this got Jasbir interested, and he tried to do a test of his own with the Radxa Rock 5B connected to an AMD Radeon R7 520 (XFX R7 250 low-profile) through an “M.2 Key M Extender Cable to PCIE x16 Graphics Card Riser Adapter” ($14 plus taxes on Aliexpress) and powered by an LR1007 120W 12VDC ATX board.
The experiment was mostly successful as he managed to run kmscube, glmark2-drm, and glmark2-es2-drm 3D graphics demos successfully in his setup as you can see from the 3 minutes video embedded below.
It did not exactly work out of the box however, as first he had to build a custom kernel with graphics card drivers and fixes and updated Radxa’s Debian image with it. This did not work at first because of two main reasons:
- Memory allocation is limited to 32-bit for PCIe DMA transfers and while a board with 4GB RAM might not see an issue, the 8GB board used for testing likely picked an address range above 4GB.
- AMD cards rely on PCIe snooping and there is no CPU snooping on the RK3588 interconnect. So any cache copies of the same device memory block won’t get updated to remain in sync.
After implementing workarounds for the two issues above, kmstest sample ran successfully, but kmscube ended up with an error:
GL_MESA_framebuffer_flip_y GL_EXT_depth_clamp GL_EXT_texture_query_lod "
Using modifier ffffffffffffff
Another fix was required as explained by Jasbir:
To fix the Radeon kernel driver we are ensuring the cards memory is mapped as ‘Device memory’ type Device-nGnRnE. If it were ‘Normal Memory’ then unaligned access is allowed. This implies fixing up userspace drivers/applications as these errors are encountered as these applications can directly manlipulate the cards memory. For this particular bus error it was caused by a memcpy in the radeon gallium driver and fixed applied there and as shown in the video kmscube runs
A fix enabled all graphics samples showcased in the video to run fine. However, running startx ended with a shader compiler error, and would require more work. Video playback with VAPPI was unsuccessful either. So while it looks promising, it’s still not possible to use a PCIe graphics card with a Rockchip RK3588 SBC the way you’d use an eGPU with an x86 mini PC, but it might be in the future.
You’ll find more details in Jasbir’s post. Note that he does not provide the fixes and workarounds, and just goes through the steps and explains the errors, so you would not be able to easily reproduce his demo without some serious work.
Jean-Luc started CNX Software in 2010 as a part-time endeavor, before quitting his job as a software engineering manager, and starting to write daily news, and reviews full time later in 2011.