placeholder

Tales of the M1 GPU - Asahi Linux

marcan asked me to write an article about the M1 GPU, so here we are~! It’s been a long road over the past few months and there’s a lot to cover, so I hope you enjoy it!

Click to view the original at asahilinux.org

Hasnain says:

Really cool technical story of how they built a kernel + user space driver for the M1 GPU so it could run Linux. And some great hackery in between. I promise I didn’t share this just for the Rust fanboyism.

“Normally, when you write a brand new kernel driver as complicated as this one, trying to go from simple demo apps to a full desktop with multiple apps using the GPU concurrently ends up triggering all sorts of race conditions, memory leaks, use-after-free issues, and all kinds of badness.

But all that just… didn’t happen! I only had to fix a few logic bugs and one issue in the core of the memory management code, and then everything else just worked stably! Rust is truly magical! Its safety features mean that the design of the driver is guaranteed to be thread-safe and memory-safe as long as there are no issues in the few unsafe sections. It really guides you towards not just safe but good design.”

Posted on 2022-11-30T04:30:36+0000