What happened
Reverse engineering the GPU firmware on Apple Silicon, specifically for the M1/M2 Macs, is a monumental task. Asahi Lina and her team spent over 12 hours painstakingly unraveling the intricacies of the RTKit-based firmware ABI.
The core issue revolves around the incredibly convoluted architecture: Apple took a standard kernel driver, split it in half, and then utilized shared structs with firmware-owned fields intertwined with host-controlled ones. This creates a highly complex memory tree that requires significant effort to understand.
Why it matters
This complexity has major implications for developers seeking to interact directly with the GPU hardware. It dramatically increases the time and resources required for any modifications or optimizations, effectively creating a barrier to entry for many projects. The difficulty stems not from inherent GPU challenges, but from a fundamentally flawed architectural decision—a fragmented driver design that introduces significant overhead and uncertainty.
But, but, but…
The A18 Pro firmware ABI is even more complicated than the M1/M2, demonstrating an escalation in complexity beyond what was previously observed.
With 1.5x as many structs and twice as many pointers, the process of submitting work to the GPU becomes substantially more arduous. Furthermore, incomplete documentation exacerbated the challenges, forcing a reliance on painstaking reverse engineering. The key takeaway is that this situation underscores how architectural design choices can profoundly impact development workflows—even for relatively simple hardware components.
“many of these structs have firmware owned fields (which we must never modify and which we must learn from reverse engineering) interleaved with host controlled fields.”
— Dr Non
The counter-take
The fragmented driver design represents a significant misstep in Apple’s hardware architecture, prioritizing internal control over developer accessibility and ultimately creating unnecessary barriers to innovation surrounding GPU development.
The AI angle
AI-driven optimizations of Apple Silicon GPUs will be significantly hindered by the complexity and opacity of the firmware ABI, potentially slowing down advancements in areas like machine learning inference and graphics rendering. The asymmetry created further limits innovation.
