Mesa 25.2 entered its feature freeze yesterday with many exciting driver improvements with new features and performance optimizations while one feature that wasn’t ready for merging in this quarter’s release is Magma, which is a recent effort by Google engineers working on a cross-platform system call interface for Mesa. And it’s written in Rust.
Magma is a cross-platform GPU system call library in Mesa. Google engineers have been developing it with an eye on Chrome OS use and for possible future use as well with their Fuchsia operating system effort. Making it more interesting is that it plans to tie into Microsoft’s Windows Display Driver Model (WDDM) for Windows usage too.
This cross-platform GPU system call library would interface across Linux DRM, Windows WDDM, Fuchsia, and potentially other platforms too. Magma is written in the Rust programming language and among the early goals are using it for para-virtualization use-cases with Linux and Fuchsia. Google has rather ambitious goals for it when it comes to virtualized graphics use:
“For embedded GPU paravirtualization, our goal is a 100% Rust based solution at the host userspace virtual machine manager (VMM) level. We’ve been working towards via Rutabaga. Xen developers have also expressed interest in this goal.
Use of both virglrenderer and gfxstream inhibit this, since they both rely on many instances of global data. That prevents Rutabaga from being shared safely across different threads when those features are enabled.”
Magma may also end up helping the efforts for getting more Mesa hardware drivers working on Windows.
Magma wasn’t ready for merging into Mesa 25.2 but remains under active development. As of last month the code was still considered a work-in-progress and various Rust’isms being worked out. Those wanting to learn more about Magma can do so via this RFC WIP merge request for Mesa.