File size: 4,041 Bytes
e629bba | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 | # open-xdna FAQ β running LLMs / compute on the AMD XDNA1 NPU on Linux
High-intent questions about the first-generation AMD Ryzen AI NPU (XDNA1 / Phoenix /
Hawk Point) on Linux, answered honestly. If you found this by searching an error string,
jump to [Troubleshooting](#troubleshooting).
## Can the AMD XDNA1 NPU run LLMs on Linux?
Partially, and honestly: there is **no turnkey LLM runtime** for XDNA1 on Linux (FastFlowLM
and AMD Lemonade are **XDNA2-only** β Strix/Krackan). But the NPU itself is fully usable from
open source: `open-xdna` brings up the gen-1 NPU with AMD's open XRT + XDNA driver + IRON/
mlir-aie, and demonstrates real compute on the silicon β a verified 512Β³ matmul (~68 GFLOPS),
a 2-layer MLP forward pass, and a non-bijunctive prune/collapse kernel. A full model does not
yet run end-to-end on the NPU (no XDNA ggml backend exists).
## Does the Ryzen 7 8845HS (or 7840/8840) NPU work on Linux?
Yes. The Phoenix/Hawk-Point NPU enumerates (`lspci -d 1022:1502` β "AMD IPU Device"), the
in-kernel `amdxdna` driver (Linux 6.14+) creates `/dev/accel/accel0`, and with the userspace
from this repo it runs kernels. Verified on Ubuntu 25.10 / kernel 6.17 / GCC 15.
## Is the XDNA1 NPU faster than the Radeon 780M iGPU for LLM inference?
**No.** Measured here: the NPU is ~6Γ slower than the 780M at dense matmul and uses more
energy per GFLOP for dense work. Its real value is **low absolute power (~6.6 W vs the iGPU's
~26 W)** and doing cheap **selection/pruning** that lets the iGPU do *less* work. Use the iGPU
(Vulkan) for the matmuls; consider the NPU for low-power always-on or prune/collapse steps.
## Is this a FastFlowLM / Lemonade alternative for gen-1?
It's the open-source *bring-up and experimentation* path for the generation those tools skip.
It is not a drop-in `ollama`-style server. If you have a Phoenix/Hawk-Point chip and want the
NPU usable on Linux at all, this is the starting point.
## What can the XDNA1 NPU actually do well?
Sparse, local, data-dependent work β not big dense GEMM. Confirmed on silicon: reductions
(`reduce_max`), elementwise activations (`relu`), and non-bijunctive top-k collapse
(keep-strong / prune-weak). The AIE2 vector ISA (`aie::load_v`, `aie::mul`, `aie::add`,
`aie::max`, `aie::select`) is the same primitive class as PowerPC AltiVec / VSX, so custom
kernels are hand-authorable in C++ intrinsics and compiled with Peano.
## Which AMD chips have an XDNA1 NPU?
Ryzen 7 7840HS/U, 8840HS/U, **8845HS**; Ryzen 9 7940HS, 8945HS; Ryzen 5 7640HS/U, 8640HS,
8645HS; desktop 8600G / 8700G. The desktop **8500G / 8300G have NO NPU** (Zen4c die).
## Troubleshooting
| Symptom | Cause / Fix |
|---------|-------------|
| `xrt-smi examine` β **0 devices found** | XRT needs `libxrt_driver_xdna.so` on its lib path (not just `libvxdna.so`). See `docs/BRINGUP.md` fix #1. |
| `Permission denied` on `/dev/accel/accel0` | Run as root, or join the `render` group and re-login. |
| `aie2_query_telemetry`/`GET_ARRAY` **Operation not supported** / `-EINVAL` | Mainline `amdxdna.ko` (β€6.17) lacks ioctls the current SHIM needs β load the staging driver. Fix #2. |
| **`objcopy: Unable to recognise the format`** of an AIE `.o` | GNU objcopy can't parse AIE2 ELF; put `llvm-objcopy` on PATH (`/usr/lib/llvm-XX/bin`). Fix #3. |
| **`ERT_CMD_STATE_ABORT`** / `xdna_mailbox ret -22` / "Command bo too large" | NPU firmware too old β install the version the runtime expects (e.g. `npu.sbin.1.5.5.391`). Fix #4. |
| Host test link error `__cxa_call_terminate@CXXABI_1.3.15` | C++ ABI mismatch β build host with `CC=gcc-15 CXX=g++-15` (match XRT's GCC), or run the pure-JIT `.py` path. |
| `aie.dma_bd Size exceeds [1:64]` / `allocated buffers exceeded available memory` | Matmul shape too large for the demo kernel β block-tile host-side into NPU-native (~512Β³) tiles. |
## Where to start
`README.md` (overview) β `docs/BRINGUP.md` (full recipe) β `RESULTS.md` (measured numbers) β
`examples/` (runnable: `npu_tiny_mlp.py`, `npu_collapse.py`).
|