AMD XDNA Ryzen AI Linux Kernel Driver Posted For Review
Back in January AMD quietly posted 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:
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 Xilinx XRT and 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 the Unified AI Software Stack and Peano LLVM compiler.
The AMD XDNA Linux driver patch series currently out for upstream kernel developer review can be found on the 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.
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 Xilinx XRT and 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 the Unified AI Software Stack and Peano LLVM compiler.
The AMD XDNA Linux driver patch series currently out for upstream kernel developer review can be found on the 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.
20 Comments