Latest

Technology

AMD sends its AI Engine driver to the Linux kernel

AMD submits a new driver for the Versal Gen 2 AI Engine for review, leaves behind the out-of-tree code and adopts the Linux kernel's accel framework.

Translated from Spanish by an automated system. The Spanish original prevails. Read the Spanish original

AMD sends its AI Engine driver to the Linux kernel
AMD sends its AI Engine driver to the Linux kernel

On Wednesday, November 18, AMD sent to the dri-devel mailing list the patches for a new driver for the AI Engine of its Versal chips, the processor array the company sells to handle signal processing and inference outside the data center. A single device can carry "dozens or hundreds" of these engines, a figure AMD's documentation also uses to describe the family. Until this week, the Linux kernel had no driver in its main tree for those engines.

It is worth separating two pieces that are easily confused. The AI Engine is not the artificial intelligence unit AMD puts in its Ryzen processors: that block already has its driver, AMDXDNA, and lives in the kernel's accel subsystem. What arrives now is support for the grid of engines inside the Versal chips, the adaptive chips AMD sells for 5G radio, radar, industrial vision and automotive. They are two different pieces of hardware and, until November 18, only one of the two had a path into the common kernel.

The move matters less for the driver itself than for where it is placed. AMD sets aside its downstream driver, the one installed separately and compiled against a specific kernel version, and adapts the new code to the standard accelerator framework. The patches are under review and there is no performance figure or merge date: the only confirmed thing is that they exist, that they will be discussed in the open and that they target only second-generation Versal chips.

A different driver from the one for Ryzen AI NPUs

The main tree already has an AMD driver for accelerators, accel/amdxdna, and its entry in the kernel documentation defines it as support for AMD's NPU, the unit that runs small models on the device itself.

That driver is no use here, because it talks to the NPU of the Ryzen AI while the new one talks to the engine array of the Versal. They share a framework and a mailing list, nothing more.

AMDXDNA AI Engine (AIE)
Hardware NPU of the Ryzen AI Engine array of the Versal Gen 2
Function Inference on the PC Signal and inference on the device
Where it lives accel/amdxdna, already in the tree New patches, under review
Status In the main kernel No merge date

The framework the driver adopts is called accel, the part of the kernel dedicated to compute accelerators: devices that do not draw images and do not fit the graphics card model. Sharing that framework has a practical consequence, because the code inherits the subsystem's common rules for registration, memory and events instead of inventing its own.

The difference between the two paths is not cosmetic. An out-of-tree driver forces a rebuild with every kernel version jump and leaves out anyone working with a long-term support distribution. One inside the tree is updated with the system and goes through the maintainers of that part of the kernel, who tend to find what the manufacturer did not see. For an industrial customer with years of useful life ahead in the chip, that detail decides whether a security patch arrives or does not.

Inside an AI Engine

Each AI Engine is a vector processor: it runs the same operation on several pieces of data at once, what the jargon calls SIMD, and groups instructions into long bundles to avoid wasting cycles deciding what comes next. AMD's documentation on the AI Engine describes each engine as a processor of that type with its own program memory, local data memory, a RISC scalar processor alongside and several interconnection paths with its neighbors.

The engines are laid out in a two-dimensional grid and programmed as a single distributed program, with dataflow graphs that connect cores written in C or C++ and an AMD tool, Vitis, that compiles the whole set for the entire array.

AMD sells two variants of this engine, and the AIE-ML doubles the local memory per unit and plays down 32-bit integer support to focus on inference. The uses the company documents range from 5G beamforming and radar to medical imaging or industrial robotics, and include small models at the edge of the network.

That AI Engine is not the way to run a large model on a laptop, and it is worth saying so before anyone tries. That is what NPUs and graphics cards are for, with tools such as llama.cpp and its stable API, which run on conventional CPUs and GPUs. The Versal engine lives at another level of the system, closer to the sensor than to the user.

From its own tree to the common tree

The submission does not start from scratch. Last year there was a series of patches with more basic AI Engine support, and the driver now under review is a rewrite that looks only at the Versal Gen 2, the most recent generation of the family.

The form changes too, because the code adapts to the accel framework instead of reproducing the downstream driver AMD has distributed separately for years and that each customer compiles on its own.

AMD is repeating a script it has already used this year in other parts of the kernel. The GFX13 patches, the basis of RDNA 5, arrived with 12,643 lines and the same public review format. The work on hybrid cores followed that same mailing list route, with two patches that publish the real capacity of each core.

Publishing early has a cost, because the code is discussed in the open and may change several times, and it has an obvious benefit: once it is in, support appears in all distributions at once. It is the difference between announcing a capability and having it ready for the end user.

There is a less visible reason for choosing the common framework. An accelerator that enters through accel registers with the conventions the kernel has already defined for memory, contexts and events, so AMD does not maintain two parallel stacks for two products it sells together. For the company, which covers both the PC and the industrial device, that reduces maintenance work even if the code takes longer to get in.

What remains to be seen in the review

The patches are on the dri-devel list, the one for the kernel's graphics and accelerators subsystem, and that is where a path with no public calendar begins. AMD has not published performance figures for the driver or a merge date, and the submission does not say how many versions it will need before a maintainer accepts it. Nor is it clear what happens to last year's series or whether first-generation Versal chips will get anything similar, because this work targets only Gen 2.

The strategic reading can be made now, without waiting for the kernel merge window. AMD places its industrial inference hardware in the same framework as its NPUs and accepts the kernel's review rules to do so, instead of defending its own stack. If the patches go in, any distribution will be able to talk to the AI Engine array without installing the manufacturer's tools. If they do not, there will be one more series on the list and the downstream driver will remain the only way to program those engines from Linux.

José Maldonado

Author

José Maldonado

Activist and blogger on technology, free software and blockchain.

The latest
Ethereum delays Glamsterdam to 2027 to allow time to fix smart contracts

Keep reading