News: 0001479849

  ARM Give a man a fire and he's warm for a day, but set fire to him and he's warm for the rest of his life (Terry Pratchett, Jingo)

AMD XDNA Ryzen AI Linux Kernel Driver Posted For Review

([AMD] 4 Hours Ago AMD XDNA Linux Driver)


Back in January AMD quietly posted [1]an XDNA Linux kernel driver for enabling the Ryzen AI NPUs . The driver has been maintained within that GitHub repository since but without any clear effort for getting this accelerator driver reviewed and merged into the upstream Linux kernel. Today that first step is finally being taken with the Ryzen AI XDNA Linux kernel driver patches posted to the Linux kernel mailing list and dri-devel to begin facilitating the upstream review process for getting this AI accelerator driver in the mainline kernel.

It's unfortunate that it has taken so long to get the XDNA Linux driver out there in the first place considering the Ryzen 7040 series with Ryzen AI have been out for the past year. And then another half-year after open-sourcing the driver publicly to begin the review process. In any event, at least today's milestone has finally arrived.

AMD engineer Lizhi Hou posted the set of ten patches implementing the "AMDXDNA" Linux kernel driver for review and to live within the accelerator "accel" area of the kernel. In current form the kernel driver is 8,177 lines of new code. Lizhi Hou wrote of the initial XDNA Linux driver:

"This patchset introduces a new Linux Kernel Driver, amdxdna for AMD NPUs. The driver is based on Linux accel subsystem.

NPU (Neural Processing Unit) is an AI inference accelerator integrated into AMD client CPUs. NPU enables efficient execution of Machine Learning applications like CNNs, LLMs, etc. NPU is based on AMD XDNA architecture.

AMD NPU consists of the following components:

- Tiled array of AMD AI Engine processors.

- Micro Controller which runs the NPU Firmware responsible for command processing, AIE array configuration, and execution management.

- PCI EP for host control of the NPU device.

- Interconnect for connecting the NPU components together.

- SRAM for use by the NPU Firmware.

- Address translation hardware for protected host memory access by the NPU.

NPU supports multiple concurrent fully isolated contexts. Concurrent contexts may be bound to AI Engine array spatially and or temporarily.

The driver is licensed under GPL-2.0 except for UAPI header which is licensed GPL-2.0 WITH Linux-syscall-note."

The Ryzen AI NPU does depend upon closed-source firmware binaries for this driver to function. Going along with the kernel driver over in user-space the [2]Xilinx XRT and [3]AMD AIE Plugin for IREE are the initial open-source users that can interface with this NPU kernel driver.

There is other user-space work ongoing for embracing AMD XDNA such as [4]the Unified AI Software Stack and [5]Peano LLVM compiler .

The AMD XDNA Linux driver patch series currently out for upstream kernel developer review can be found on the [6]mailing list . Here's to hoping that the code review process goes smoothly and quickly. The Linux 6.11 merge window is currently ongoing and while it's possible for new drivers to be merged post-merge-window, typically it doesn't happen too often. Thus at the earliest we would see the AMD XDNA driver integrated into the mainline Linux kernel would potentially be the v6.12 cycle if the review process is punctual. Linux 6.12 is likely to be this year's LTS release but unfortunate for the timing as v6.11 will likely be the kernel powering Ubuntu 24.10 and other autumn Linux distributions. In any event the AMD XDNA driver is also available out-of-tree from AMD's GitHub repository for those interested.



[1] https://www.phoronix.com/news/AMD-XDNA-Linux-Driver-Ryzen-AI

[2] https://github.com/Xilinx/XRT

[3] https://github.com/nod-ai/iree-amd-aie

[4] https://www.phoronix.com/news/AMD-Unified-AI-Software-Stack

[5] https://www.phoronix.com/news/AMD-Peano-LLVM-Ryzen-AI

[6] https://lore.kernel.org/dri-devel/20240719175128.2257677-1-lizhi.hou@amd.com/



Mitch

rob-tech

pWe00Iri3e7Z9lHOX2Qx

agd5f

timofonic

Well we could simplify it further by putting all configuration options under
a single menu called "things".

- Alan Cox on linux-kernel