Mesa's Rust implementation of OpenCL now supports OpenCL 3.0

A new implementation of OpenCL (rusticl) developed for the Mesa project, written in Rust, has successfully passed the CTS (Kronos Conformance Test Suite) test suite used by the Khronos consortium to assess compatibility with the OpenCL 3.0 specifications. The project is being developed by Karol Herbst of Red Hat, who is involved in the development of Mesa, the Nouveau driver, and the OpenCL open stack. It is noted that Carol contacted Khronos for official certification of support for OpenCL 3.0 in rusticl.

Tests performed on a system with 12 generation Intel GPUs (Alder Lake). The work was done using the Iris Mesa driver, but the project should work with other Mesa drivers that use the untyped intermediate representation (IR) of NIR shaders. The request to merge Rusticl with Mesa is still pending and no decision has yet been made to include the Rust language code in Mesa. Before Rusticl is accepted into the main composition of Mesa, a separate branch can be used for assembly, when compiling which, the build parameters "-Dgallium-rusticl=true -Dopencl-spirv=true -Dshader-cache=true -Dllvm=true" should be specified.

Rusticl acts as a counterpart to Mesa's OpenCL Clover frontend and is also developed using Mesa's Gallium interface. The Clover stake has long been in a derelict state and rusticl is positioned as its future replacement. In addition to achieving compatibility with OpenCL 3.0, the Rusticl project differs from Clover in supporting 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 drivers by getting rid of typical problems when working with memory, as well as the ability to include third-party developments in Mesa, such as Kazan (an implementation of Vulkan on Rust). Among the shortcomings, there is a complication of the build system, an unwillingness to be tied to the cargo 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 required to build key desktop components in Linux.

Source: opennet.ru

Add a comment