In brief: Building your own graphics card is the kind of undertaking that most people wouldn't even dream of attempting. But for one enterprising engineer known as "adammaj" on X/Twitter, constructing a GPU from the ground up wasn't just a crazy idea; it was a challenge conquered in just two weeks, even "with no prior experience."
How did Adam Majmudar fabricate a fully functional graphics processor in such a short time? According to his detailed thread on X, it was no walk in the park – "way harder than expected," he stated.
One of the biggest hurdles was simply trying to understand the inner workings of existing GPU architectures, which are largely proprietary black boxes. But some clever reverse-engineering of frameworks like Nvidia's CUDA helped provide useful insights.
From there, Adam had to design his own lean, minimal GPU architecture focused on general parallel computing rather than graphics workloads. He created a tiny custom instruction set to write programs (dubbed "kernels") for his GPU to execute using the SIMD (Single Instruction, Multiple Data) paradigm employed by modern GPUs.
To test his creation, Adam coded simple matrix math kernels to run on his homebrew-GPU design. Getting the Verilog implementation working properly with all the control logic was where the real challenges arose, requiring multiple rounds of revisions and bug fixing. But in the end, Adam's GPU was able to correctly run the kernels and churn out the right matrix operation results.
"After tons of redesigns, finally running my matrix addition and multiplication kernels, seeing things work properly, and my GPU outputting the correct results was an incredible feeling," he wrote.
Adam has also provided a cool 3D visualization to showcase his GPU in action. To be clear, the project is still currently in the chip layout design phase, which has passed through OpenLane EDA software for verification, proving it's all physically realizable.
Here's me playing with a cool 3D visualization of my chip design - I can zoom into different parts of the chip, isolate different metal layers, and look at individual gates & structures in the design. pic.twitter.com/DdFzhX6a0S
– adammaj (@MajmudarAdam) April 25, 2024
While Adam's GPU is obviously a scaled-down proof-of-concept compared to behemoth chips from AMD and Nvidia, the achievement is still immensely impressive. Building any piece of semi-complex hardware from the ground up is an incredible learning experience, let alone pulling off something as sophisticated as a parallel processor.
Still, this isn't the first time we've seen DIY GPUs in action. Earlier in April, a developer released a remarkably smooth 3D engine which he demonstrated on a small homemade GPU powered by an Espressif ESP32-S3 microcontroller. Not long before that, a game developer designed 'FuryGPU,' which could render Quake at a solid 60 FPS.
Adam has uploaded all the code and documentation for his mini GPU to GitHub, allowing others to study, tweak, and build off his work.