Skip to content
Tech News
← Back to articles

Building a Linux GPU Driver for the M4 Mac Mini in One Month

read original get Apple M4 Mac Mini → more articles
Why This Matters

A small team reverse-engineered Apple's proprietary AGX GPU firmware and built a fully OpenGL ES 3.0-compliant Linux driver for M-series Macs in about a month, a process that normally takes years. This matters because it could open the door to running Linux with proper GPU acceleration on Apple Silicon devices, expanding hardware support and reducing reliance on Apple's software ecosystem.

Key Takeaways
Worth a Look

Apple M4 Mac Mini — This is literally the hardware the article's reverse-engineered GPU driver runs on, making it perfect for tinkerers curious about Asahi-style Linux GPU work on Apple Silicon. Its compact form factor and efficient M4 chip make it a great low-cost machine for experimenting with custom drivers and OS development.

See Apple M4 Mac Mini on Amazon → Affiliate link — we may earn a commission on purchases, at no extra cost to you. Product picked by AI based on this article; it is not a tested recommendation.

I Came, I Prompted, I Left Part 2: Building a GPU Driver From Scratch in One Month

Previous blog post: https://codyho.dev/blog/hypervisor-macbook-neo/

What We Did

TL;DR: Niklas and I built a fully OpenGL ES 3.0 compliant GPU driver for the M4 Mac Mini and MacBook Neo in about a month, a process which normally takes years. Here is Chrome and Firefox running WebGL on the M4 Mac Mini with working compositing:

Most importantly, the driver is fast enough to run Minecraft at 200fps:

Building this driver involved reverse engineering the AGX’s (Apple’s name for the GPU) incredibly complicated firmware ABI and user-space components. This was all done in a transparent, verifiably clean room manner using well established techniques. The code is not yet ready for end users, but we are looking to get it to end users as soon as possible.

How We Did It

Previously, I built a hypervisor to reverse engineer macOS. Now the goal became to actually do something useful with it, and what better target than writing a GPU driver. The GPU is effectively a requirement for any modern system, otherwise everything needs to be CPU rendered which is orders of magnitude slower and less power efficient. Our goal was to implement conformant OpenGL (and soon, Vulkan) drivers for the M4 Mac Mini and MacBook Neo.

Normally, building a GPU driver is an endeavor that takes years; our goal was to do it in days. It turns out that days was overly optimistic, but weeks is still a massive improvement. In those weeks we have:

Reverse engineered the M4, A18 Pro, and (mostly) M5 user space using only live probing, discovering hardware-supported features and instructions not emitted by Apple’s driver

... continue reading