More Progress Is Made Understanding Apple's M1 GPU, Working Towards An Open Driver

Written by Michael Larabel in Mesa on 18 April 2021 at 08:28 PM EDT. 32 Comments
MESA
Alyssa Rosenzweig, known for her work on the Panfrost open-source driver for Arm Mali graphics, has published the latest findings around the Apple M1 graphics processor. In fact, enough understanding to get a shaded, spinning cube rendering on the Apple M1 using a simple demo so far while the open-source driver support is still the goal.

Alyssa and others have spent much time this year working on reverse engineering and better understanding the Apple M1 graphics found with this first Apple Silicon SoC. Recently there has been much work in the area of shader compilation with the goal of getting a NIR-based compiler working for the yet-to-be-written Mesa 3D driver.

Digging into the Apple M1 graphics processor has revealed that the company has indeed catered their design around Metal API requirements and not that of OpenGL, Vulkan, or other industry standards. Alyssa noted in today's post, "For all the visible hardware features, it’s equally important to consider what hardware features are absent. Intriguingly, the GPU lacks some fixed-function graphics hardware ubiquitous among competitors. For example, I have not encountered hardware for reading vertex attributes or uniform buffer objects. The OpenGL and Vulkan specifications assume dedicated hardware for each, so what’s the catch? Simply put – Apple doesn’t need to care about Vulkan or OpenGL performance. Their only properly supported API is their own Metal, which they may shape to fit the hardware rather than contorting the hardware to match the API. Indeed, Metal de-emphasizes vertex attributes and uniform buffers, favouring general constant buffers, a compute-focused design. The compiler is responsible for translating the fixed-function attribute and uniform state to shader code."

At least with functionality not provided by the Apple M1 GPU, it's less reverse engineering and more then about writing software paths that hopefully aren't too costly.

As for the current state of the Apple M1 GPU research and work towards creating an open-source driver, "At present, the in-progress compiler supports most arithmetic and input/output instructions found in OpenGL ES 2.0, with a simple optimizer and native instruction packing. Support for control flow, textures, scheduling, and register allocation will come further down the line as we work towards a real driver."

More details on Rosenzweig.io.
Related News
About The Author
Michael Larabel

Michael Larabel is the principal author of Phoronix.com and founded the site in 2004 with a focus on enriching the Linux hardware experience. Michael has written more than 20,000 articles covering the state of Linux hardware support, Linux performance, graphics drivers, and other topics. Michael is also the lead developer of the Phoronix Test Suite, Phoromatic, and OpenBenchmarking.org automated benchmarking software. He can be followed via Twitter, LinkedIn, or contacted via MichaelLarabel.com.

Popular News This Week