Mesa's New OpenCL Stack "Rusticl" Nearing Formal Support For OpenCL 3.0

Written by Michael Larabel in Mesa on 22 April 2022 at 02:00 PM EDT. 42 Comments
Mesa's Rusticl is a yet-to-be-merged OpenCL implementation for Mesa Gallium3D drivers written in the Rust programming language. The latest code now can pass the Khronos OpenCL 3.0 Conformance Test Suite!

While there has long been the Mesa Gallium3D "Clover" OpenCL state tracker, it's development has been rather stagnate. This year Karol Herbst of Red Hat took to writing "Rusticl" as a new Rust-based OpenCL implementation for Mesa. Last month I wrote about this exciting Rusticl effort for Mesa and its goal of OpenCL 3.0 compatibility and just being more modern-focused all around.

Though not yet merged to Mesa, the latest Rusticl code as of this week is now able to successfully pass the OpenCL 3.0 Conformance Test Suite (CTS). Rusticl does excitingly have OpenCL image support -- a long time complaint for the Clover state tracker -- and printf support while some features like FP16 handling are still to be written.

Karol Herbst in turn already reached out the Khronos about being able to certify this open-source OpenCL 3.0 implementation. That updated OpenCL 3.0 CTS passing code is part of the Mesa merge request that is pending.

Rusticl seems to be coming together nicely for modern OpenCL with Mesa!

Karol Herbst has been testing the Rusticl code with OpenCL 3.0 CTS passing using Intel 12th Gen graphics. While testing with Intel's Iris driver, Rusticl should work for other Mesa drivers supporting the NIR intermediate representation.

The Rusticl code in its current form is just over 14k lines of new code. (Though Rusticl does depend upon the external clc for compiling the source code to SPIR-V.) Rusticl is also serving as an experiment for dealing with Rust code inside Mesa. Once merged, Rusticl can be enabled at build-time with "-Dgallium-rusticl=true -Dopencl-spirv=true -Dshader-cache=true -Dllvm=true" and ships an OpenCL ICD compliant file.

Let's hope Rusticl manages to land in Mesa 22.2! Kudos to Karol and Red Hat on this milestone. Rusticl has the potential to make OpenCL 3.0 support vastly more available on the Linux desktop compared to Radeon ROCm not being well packaged across most Linux distributions and requiring extra steps and similarly Intel's Compute-Runtime not being widely packaged by distributions at this point. This also helps for allowing OpenCL on many of the smaller Mesa Gallium3D drivers.
Related News
About The Author
Michael Larabel

Michael Larabel is the principal author of 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 automated benchmarking software. He can be followed via Twitter, LinkedIn, or contacted via

Popular News This Week