
two years it's been almost two years since i started this journey and today it finally works i can plug an amd radeon graphics card into my raspberry pi plug my monitor into the graphics card and it works i also got this tiny m.2 vga graphics card working and well it's been a long road i started in 2020 with an nvidia gt710 i plugged it in i installed nvidia's graphics drivers i booted the pi and it locked up i tried a radeon 5450 i recompiled the linux kernel with amd's drivers booted the pi locked up i tried an rx 550 lockup gtx 750 ti lockup dtx 1080 lockup i even sold my kidneys to buy this amd radeon rx 6700xt at the peak of the gpu shortage and what did it do after hours tweaking the driver and recompiling over and over yeah locked up i even tested this tiny little sm 750 chip that only has 16 megabytes of vram it's like a thousand times simpler than the 6700 surely i could get it to work nope but it long last after some help from core forge toble miner paul rat p elwell alfardo and many more github users and sahaj and many others on twitter we got it first i'll show you what works because not everything works yet on the tiny sm750 card i can plug it into the compute module i o board with this m.2 adapter and the system recognizes it but i still need a working driver so we made this linux kernel patch that gets the ancient driver to work and now if i enable the card with sudo mod probe sm750fb i get a frame buffer console the driver doesn't even work with a linux window manager yet and heck this chip doesn't even do 3d so besides a shiny vga output on the pi there's not a whole lot you can do with it so switching tracks i also have this amd radeon 5450 from 2010.
I was told by some amd engineers that the radeon 5000 or 6000 series cards might be the best ones to try since they're old enough to be usable on the slower pi but new enough to be supported by linux's radeon driver but before we can even get to that we have a problem you can't plug this by 16 graphics card into the buy one slot on the compute module i o board you could cut the edge of the connector with a razor saw like i did here or use an external riser or slot adapter or if you want to go pro and have the money to do it you can buy a seaberry this mini itx pie motherboard is insane it has not one but 11 different pci express connections including this full by 16 slot that's perfect for a graphics card so now that it's plugged in it's time to sort out the driver after years of work we finally have a kernel patch that lets this card run and it even has 3d acceleration the pi's built-in video core vpu is still faster but hey it's something i compiled the patch copied it over to the pi and enabled the graphics card with sudo modprobe radeon and look at that a console again but it gets even better i can run startx and get the raspberry pi os ui to load now it loads and you can do some stuff with it but there's still a ways to go before i would call it usable i installed neofetch to prove that yes in fact we're running the graphics card and not the pi's built-in gpu i also installed westin which is a weyland-based compositor and that runs more stable though a bit slow and it seems to lock up after a while but the driver is stable enough to run some light 3d benchmarks first i ran gl mark ii and some tests seemed to work even giving me 60 fps of 3d hardware acceleration but not everything works right now like the jellyfish i can only get one frame to render then it just stops i also ran glx gears just to see what would happen and look at that besides the screen looking really weird we have spinning gears powered by the radeon during these tests i also got radion top running so i could see the load on various parts of the gpu and that worked great as a final test i tried h.264 acceleration with ffmpeg but that part of the driver is disabled right now so it's not sped up at all so after all this work why is it still glitchy well it comes down to memory early on right after the compute module 4 was released the pi engineers added more bar space that was my first memory management hurdle and when they did that it meant a lot more pci express hardware could be used but even with more bar space there are a lot of pci express features that graphics cards rely on and on the bcm 2711 at the heart of the pi a lot of those features act kind of funny like cache coherency and write combining basically graphics cards want to buffer data and get access to memory as fast as possible and they expect the cpu to deliver things to them in an intelligent way on the raspberry pi especially if you boot into a 64-bit os the cpu does some funny things one of the most classic is when it just cuts off a bit of the memory address when you ask for it it's kind of like if you ask me where i put a bread recipe and instead of me telling you it's in the recipe box in the kitchen i say it's in the re and just stop really frustrating right well that's kind of what the pi cpu does sometimes and sometimes the graphics card driver is like okay i'll do my best with that but other times it gets really angry and just crashes in the end we found a set of functions that had to be patched or replaced like the mem copy memsat and memcache i o functions we also had to force the radeon driver to not use features like write combining or cache coherence at all but since those features are supposed to be supported and they are on most computers the work we're doing here isn't likely to get merged into linux at any point and at this point you're probably also wondering can it at least run crisis well no and you can probably rule out most aaa games but not because of the pi cpu steam and proton are x86 based and probably will be for a long time with or without graphics card support you can kind of sort of emulate things with box 86 but trying to get a hacky gpu driver to work through emulation layers would take a lot more work and i wouldn't bet on it happening what about things like gpu mining for crypto or gpu compute like cuda programming or ai and machine learning well all those things rely on features that might or might not ever work on the compute module 4 so again i wouldn't bet on it but some things like h.264 acceleration or other features these gpus have might work someday but almost every one of the features would need to be combed through in the driver and fixed to work correctly on the pi so yeah if you're really dying to use a pi to do gpu mining and you have someone who knows low level linux kernel programming and has a deep knowledge of amd's drivers you might get something working someday but probably not and since nvidia's drivers aren't even open source good luck trying to ever get something like cuda working on the cm4 at least we could get amd's engineers to help out here and there nvidia completely ghosted me so the next question i get a lot is what about other arm systems i mean there's a ton nowadays you have solid runs honeycomb rock chip and all winter socs and heck even apple's latest computers run on arm the problem is standardization despite all its warts the x86 platform is a pretty darn stable target at this point in time in arm there are standards like system ready and some socs do work with things like graphics cards by default but not every soc vendor spends the time and investment to certify their chips a lot of socs are purpose-built for specific tasks like set-top boxes or embedded devices and those things don't usually have beefy pci express graphics cards plugged in even popular rockchip socs like the rk3566 have broken pci express support pg wipeout had this to say i'm still pretty sure there's no way to make these non-compliant pcie controllers magically compliant even with a massive performance hit none of these chips are open source so it's hard to predict how they'll behave until someone can spend the hours and hours debugging them besides other armboards a lot of people told me to try windows 11 since it can boot on a pie but that won't help because graphics drivers are even more obtuse on windows and the process would be even harder and i've also done a lot of testing on the amd rx 6700xt since my last video so how's it working well i've gotten a few of the initialization rings working but it's still having some trouble so for now we're focusing on the older radeon cards instead of the newer cards that use amd's amd gpu driver so we have some cards kind of working in linux but it can't play games it can't mine and it can't make ai faster yet so what can we do with these things well i don't know about anyone else but my first goal has always been to explore or as captain john luke picard so eloquently puts it to boldly go where no one has gone before maybe in the end we will be able to get hardware video decoding working maybe we can get some form of compute i don't know but i do know that it's been exciting to find ways to push hardware in ways it was never meant to be pushed and heck if nothing else maybe this will push broadcom to make the next pie chips pci express work perfectly out of the box the one thing that's certain is this has been an expensive journey sponsor me if you want to see more and until next time i'm jeff gearling