All News | Boards | Chips | Devices | Software | LinuxDevices.com Archive | About | Contact | Subscribe
Follow LinuxGizmos:
Twitter Facebook Pinterest RSS feed
*   get email updates   *

Collabora introduces Kraid Rust compiler for Panfrost Mali GPU driver

Jun 28, 2026 — by Giorgio Mendoza 77 views

Collabora has introduced Kraid, a new Rust-based compiler for the Panfrost open-source driver stack for Arm Mali GPUs. The project is intended to replace the aging Bifrost-oriented compiler infrastructure with a cleaner design better suited to Valhall and newer Mali GPU architectures.

The existing Panfrost compiler was originally developed for Arm’s Bifrost GPUs, with later Valhall support added over time. While the current stack remains functional, Collabora says its original design now creates limitations around newer instruction encodings, register handling, data types, and long-term maintainability.

— ADVERTISEMENT —


Kraid is being developed as a fresh compiler implementation with a core intermediate representation separated from the final hardware encoding. This approach is intended to make the compiler easier to adapt across Mali GPU generations while reducing hardware-specific assumptions inside the main IR.

Collabora logo
(click image to enlarge)

The new compiler also aims to improve handling of 64-bit sources, 16-bit SSA values, opcode generalization across data types, and Mali-specific swizzle and widening behavior. Collabora also plans to add a new SSA-based register allocator, replacing the older iterative allocation and spilling approach used by the existing compiler.

Another part of the work involves using Arm-provided XML descriptions to derive the encoder and disassembler. This should reduce issues caused by older reverse-engineered instruction descriptions and provide a more accurate basis for supporting current and future Mali GPU hardware.

Kraid is also being written in Rust, following Collabora’s recent Rust work in the Nouveau driver stack for NVIDIA GPUs. Although Mali and NVIDIA GPUs use different instruction sets, Collabora says some compiler algorithms and data structures can be shared through Rust traits and reusable abstractions.

Development has already started upstream in Mesa. At this stage, Kraid remains experimental and is hidden behind the PAN_USE_KRAID=1 environment variable and the -Dpanfrost-rust Meson configuration option. This allows developers to test the new compiler without disturbing regular Panfrost users or forcing Rust into build systems that are not ready for it.

Initial testing has focused on PanVK, the Vulkan driver for Arm Mali GPUs. Collabora says early progress included passing a single Vulkan CTS test when the initial merge request was opened, while more recent work has reached the SSBO layout tests and started on the new register allocator.

Further Information

Additional details are available in Collabora’s blog post, while development continues upstream in Mesa.

(advertise here)


PLEASE COMMENT BELOW

Please comment here...