FastFlowLM environment (Ubuntu 24.04 + XDNA2)
This page installs FastFlowLM (flm) and the XDNA2 NPU driver on Ubuntu 24.04 so later chapters can flm pull / flm serve without Lemonade. Hardware: XDNA2. Troubleshooting: NPU troubleshooting.
Prerequisite: the machine is XDNA2 (Strix Halo / Kraken / Strix Point / Gorgon).
Official docs: FastFlowLM Linux · Lemonade Linux + FLM (same driver source; this page uses
flmonly)
Validated baseline (2026-09-16)
| Item | Value |
|---|---|
flm | 1.0.5 (/usr/bin/flm) |
| XRT | libxrt-npu2 2.25.0 |
| Driver | amdxdna-dkms |
| Device | /dev/accel/accel0, group render |
| Firmware | 1.1.2.65 |
| IOMMU | amd_iommu=on iommu=pt |
| memlock | unlimited |
| Groups | render video |
| Validated weights | gemma4-it:e4b · qwen3.6-moe:35b-a3b |
Install the latest .deb from FastFlowLM Releases; you do not have to pin 1.0.5.
1. Install driver and FLM
sudo add-apt-repository -y ppa:lemonade-team/stable
sudo apt update
sudo apt install -y libxrt-npu2 amdxdna-dkmsDownload the matching .deb (Ubuntu 24.04 → ubuntu24.04):
sudo apt install ./fastflowlm*_ubuntu24.04_amd64.deb
sudo rebootReboot is required so DKMS and 1.1 firmware take effect. Do not swap firmware without the matching DKMS driver.
2. IOMMU
tr ' ' '\n' < /proc/cmdline | grep iommuYou need both amd_iommu=on and iommu=pt. Otherwise flm hits SVA bind -19. If missing, add them to GRUB_CMDLINE_LINUX_DEFAULT, then:
sudo update-grub
sudo reboot⚠️ Some “large GTT” recipes set
amd_iommu=off, which is incompatible with NPU.
3. Permissions and memlock
sudo usermod -aG render,video "$USER" # once; re-loginulimit -l must be unlimited. If not, add to /etc/security/limits.conf:
* soft memlock unlimited
* hard memlock unlimitedRe-login, then:
ls -l /dev/accel/accel0
ulimit -l4. Validate
Clear ROCm userspace paths before every flm invocation:
unset ROCM_PATH HIP_PATH LD_LIBRARY_PATH
flm validate
flm list --filter installedExpected flm validate output includes /dev/accel/accel0, firmware 1.1.x, and unlimited memlock.
Optional:
unset ROCM_PATH HIP_PATH LD_LIBRARY_PATH
bash src/npu/scripts/check_flm_npu.shsource /opt/rocm then flm typically becomes No such device with index '0'.
5. Ports and exclusivity
| Item | Value |
|---|---|
flm serve | this tutorial uses 8219 |
| Concurrent LLMs | 1 on NPU |
| vs Lemonade | lemonade unload before flm serve if Lemonade loaded an FLM model |
Next: Gemma 4 FastFlowLM · Qwen3.6 FastFlowLM · Lemonade environment