Mesa's New OpenCL Stack "Rusticl" Nearing Formal Support For OpenCL 3.0
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.
Khronos is proud to have waived all Adopter fees for MESA over the years, and many MESA implementations are officially conformant. Great that MESA's OpenCL 3.0 is passing CTS! Let us know when MESA is ready to execute OCL 3.0 Adopters Agreement and we can initiate the process...
— Neil Trevett (@neilt3d) April 22, 2022
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.