You are not logged in.
I would like to request the packaging of several userspace components required to enable support for the Neural Processing Unit (NPU), also known as XDNA, present in recent AMD Ryzen AI processors (like Phoenix, Hawk Point, and the upcoming Strix Point series).
The necessary kernel driver (amdxdna) has been mainlined and is available starting with Linux kernel 6.14, making Arch well-positioned to support this hardware. However, the userspace runtime, compiler toolchain, and ML framework integration are currently missing from the official repositories and the existing AUR packages are either outdated, -git versions, or potentially incomplete/broken.
Having these packages available would allow Arch users with AMD Ryzen AI laptops/devices to leverage the NPU for hardware-accelerated machine learning tasks using frameworks like IREE.
The required components form a stack:
1. Xilinx Runtime (XRT): The core runtime library for interacting with the NPU hardware.
2. XRT AMD XDNA Shim: A plugin for XRT, built from the `amd/xdna-driver` repository, that provides the NPU-specific backend implementation.
3. LLVM-AIE (Peano): A fork of LLVM required by IREE to compile code specifically for the AIEngine architecture used in the NPU.
4. IREE AMD-AIE Plugin: A plugin for the IREE compiler/runtime that allows ML models to be compiled and executed on the AMD NPU via XRT.
Package Details:
1. Xilinx Runtime (XRT)
Package Name Suggestion:
xrt
Upstream URL: https://github.com/Xilinx/XRT
Description: Xilinx Runtime libraries and tools for managing AMD/Xilinx FPGAs and NPUs. Provides APIs for device management, buffer allocation, kernel execution.
License: Apache-2.0
This is available in Ubuntu: https://packages.ubuntu.com/oracular/xrt
2. XRT AMD XDNA Shim
Package Name Suggestion:
xrt-plugin-amdxdna
(or similar, designed to install alongside `xrt`)
Upstream URL: https://github.com/amd/xdna-driver (Note: Built from this repo, not the main XRT repo)
Description: XRT SHIM library plugin providing the backend implementation for AMD XDNA NPUs.
License: AMD Proprietary
3. LLVM-AIE (Peano)
Package Name Suggestion:
llvm-aie
or
peano-llvm
Upstream URL: https://github.com/Xilinx/llvm-aie
Description: AMD/Xilinx AI Engine LLVM fork. Required compiler backend for generating NPU executable code used by frameworks like IREE.
License: Apache-2.0 with LLVM exceptions
4. IREE AMD-AIE Plugin
Package Name Suggestion:
iree-amd-aie
(or perhaps integrated into a main `iree` package via build options)
Upstream URL: https://github.com/nod-ai/iree-amd-aie
Description: IREE (Intermediate Representation Execution Environment) compiler and runtime plugin for targeting AMD AIE/NPU devices.
License: Apache-2.0
With the kernel driver mainlined, providing these userspace packages in Arch Linux repositories (or well-maintained in the AUR) would enable users with the latest AMD hardware to utilize the NPU for AI acceleration out-of-the-box, which is a significant feature of these new platforms. It would lower the barrier to entry compared to manually building the entire stack.
There are some related AUR packages like
xrt-npu-git
,
xrt-xocl-dkms-npu-git
and
amdxdna-driver-bin
. However, these appear to be outdated or broken. Having official or actively maintained AUR packages for the stable releases would be preferable.
References
Last edited by tategotoazarasi (2025-04-17 04:50:26)
Offline
[...] and the existing AUR packages are either outdated, -git versions, or potentially incomplete/broken.
That's not how the AUR works. If the package is broken on the AUR, it needs to be either fixed by you contacting its maintainer and help them with patches, or you make the request to have the package disowned and transferred to you as a maintainer.
Offline
Thank you very much for your suggestions. I've started with XRT but ran into a couple of issues, see the issue on GitHub.
Offline
Having gone through a boost upgrade for work, I think we should insist on upstream supporting it. Unfortunately Ubuntu seems to only include 1.83.
Offline
XRT and xrt-plugin-amdxdna have landed in [extra-testing]! I get missing symbol errors, so they need more testing.
Offline
Thanks a lot for the package. And it got updated in the repo some time ago! That's really nice.
I think the issue now is that /usr/src/xrt-2.20.0/dkms.conf cannot compile on the latest stable kernel...
And hopefully it would not have this constantly as other out of tree modules..
https://github.com/Xilinx/XRT/issues/9300
I opened a ticket with upstream.
Last edited by hnws (2025-10-07 14:37:39)
Offline
The issue also is right now that it does not seem to recognize any devices on my system:
$ clinfo
XRT build version: 2.20.0
Build hash: 94841f40a048fbcdd0749644ec13b4f902492996
Build date: 2025-09-22 21:10:16
Git branch: makepkg
PID: 113931
UID: 1000
[Tue Oct 7 18:43:07 2025 GMT]
HOST: framework
EXE: /usr/bin/clinfo
[XRT] ERROR: No devices found
[XRT] ERROR: No devices found
[XRT] ERROR: No devices found
So if you have any idea about this feel free to let me know!
Offline
I believe it needs to have the kernel modules from xrt dkms compiled and loaded.
/opt/xilinx/xrt/bin/xrt-smi examine
Offline
git clone git@github.com:amd/xdna-driver.git
cd xdna-driver/
git submodule update --init --recursive
Then
modify
CMake/pkg.cmake
After line 147, add a section for arch:
elseif("${XDNA_CPACK_LINUX_PKG_FLAVOR}" MATCHES "arch")
set(CPACK_GENERATOR "DEB")
set(CPACK_DEB_COMPONENT_INSTALL ON)
set(CPACK_DEBIAN_PACKAGE_DEPENDS "xrt-base (>= ${XDNA_CPACK_XRT_BASE_VERSION}), xrt-base (<< ${XDNA_CPACK_XRT_BASE_NEXT_VERSION})")
if(NOT SKIP_KMOD)
set(CPACK_DEBIAN_PACKAGE_CONTROL_EXTRA "${CMAKE_CURRENT_BINARY_DIR}/package/postinst"
"${CMAKE_CURRENT_BINARY_DIR}/package/prerm")
endif()
Then proceed to build it
cd build
./build.sh -release
It should build successfully and produce
build/Release/xrt_plugin.2.20.0_-x86_64-amdxdna.deb
Use whatever way to convert this deb to arch package.
It has a dkms conf. Build the package and load it.
sudo modprobe amdxdna
sudo modprobe xocl
sudo modprobe xclmgmt
Finally I got the below:
sudo /opt/xilinx/xrt/bin/xrt-smi examine
System Configuration
OS Name : Linux
Release : 6.12.51-1-lts
Machine : x86_64
CPU Cores : 12
Memory : 47786 MB
Distribution : Arch Linux
GLIBC : 2.42
Model : To be filled by O.E.M.
BIOS Vendor : American Megatrends International, LLC.
BIOS Version : 21.08
Processor : AMD Ryzen 5 8600G w/ Radeon 760M Graphics
XRT
Version : 2.20.0
Branch : makepkg
Hash : 94841f40a048fbcdd0749644ec13b4f902492996
Hash Date : 2025-09-22 21:10:16
xocl : 2.20.0, 94841f40a048fbcdd0749644ec13b4f902492996
xclmgmt : 2.20.0, 94841f40a048fbcdd0749644ec13b4f902492996
amdxdna : 2.20.0_20251008, c5e45a76533de68ba436640dbb4544b2b0acd8b0
virtio-pci : unknown, unknown
NPU Firmware Version : 1.5.5.391
Device(s) Present
|BDF |Name |
|----------------|-------------|
|[0000:10:00.1] |NPU Phoenix |
Offline