The new implementation from OpenCL (rusticl) developed for the Mesa project, written in Rust, has successfully passed the CTS tests (Kronos Conformance Test Suite) used by the Khronos consortium to test compatibility with the OpenCL 3.0 specifications.
For those who are unaware of »Rusticl» they should know that it has been published as a new implementation of Mesa OpenCL written in programming language Peace.
rusticl was started by well-known Mesa collaborator Karol Herbst of Red Hat who started out as an engineer on NVIDIA's "Nouveau" open source driver while at Red Hat, and worked on Mesa's Clover IT support and other endeavors. Rusticl is an attempt by Herbst to learn the Rust programming language and also to provide a new (and hopefully superior) implementation of OpenCL.
Rusticl is much more modern focused on OpenCL compared to the old Clover code and it's notable however, is that Rusticl at this point still doesn't have OpenCL image support which has been another issue with Clover.
rusticl relies on clc to compile OpenCL source code into SPIR-V. Rusticl also depends on the NIR-compliant Mesa Gallium3D drivers, but all major drivers already do. It should be noted that Carol contacted Khronos to obtain official certification of OpenCL 3.0 compatibility in rusticl.
And now, rusticl has successfully passed the Kronos Conformance Test Suite to assess compatibility with the OpenCL 3.0 specifications, as neil trevett announced on Twitter:
Khronos is proud to have waived all MESA adoption fees over the years, and many MESA implementations are officially compliant. Great that OpenCL 3.0 from MESA is passing CTS! Let us know when MESA is ready to execute the OCL 3.0 Adoption Agreement and we can start the process…
Testing was done on a system with 12th Gen Intel GPU build (Alder Lake), with which the work was done with the Iris Mesa driver, but it is mentioned that the project should work with other Mesa drivers that use the NIR shaders' untyped intermediate (IR) representation.
Rusticl acts as a counterpart to Mesa's OpenCL Clover interface and is also developed using Mesa's Gallium interface. Clover has been in a state of neglect for a long time and rusticl is positioned as its future replacement. In addition to achieving OpenCL 3.0 compatibility, the Rusticl project differs from Clover in that it supports OpenCL extensions for image processing, but does not yet support the FP16 format.
Rusticl uses rust-bindgen to generate bindings for Mesa and OpenCL that allow Rust functions to be called from C code and vice versa.
The possibility of using the Rust language in the Mesa project has been discussed since 2020. Among the advantages of Rust support they mention improving the security and quality of the drivers by eliminating typical problems when working with memory, as well as the possibility of including developments of third parties on Mesa, such as Kazan (a Vulkan implementation on Rust).
Among the shortcomings, there is a complication of the build system, an unwillingness to bind to the payload package system, an increase in the requirements for the build environment, and the need to include the Rust compiler in the build dependencies that are provided. required to build key desktop components on Linux.
Finally, it is mentioned that the request to merge Rusticl with Mesa is still pending and no decision has yet been made on including the Rust language code in Mesa, but it is expected to arrive in the Mesa 22.2 release
This is why before Rusticl is accepted into the main Mesa composition, a separate branch can be used to build, when compiling, you must specify the build parameters "-Dgallium-rusticl=true -Dopencl-spirv=true -Dshader -cache=true -Dllvm =true».
If you are interested in knowing more about it about this new specification, you can check the details In the following link.