Pesistent DRM_IOCTL_AMDXDNA_CREATE_HWCTX IOCTL NPU error

Hi, I’ve posted about similar errors on the unofficial NixOS Discord, and I got FastFlowLM working a while back using the nix-amd-ai flake on my FW13 (Ryzen AI 350), but for the past month or so when I try to run FastFlowLM, I get this error:

> flm run qwen3.5:2b
[FLM]  Loading model: /home/dhellstern/.config/flm/models/Qwen3.5-2B-NPU2
[ERROR]  Failed to load model: DRM_IOCTL_AMDXDNA_CREATE_HWCTX IOCTL failed (err=-22)

The command and any related NPU actions from FastFlowLM or Lemonade consistently fail. I also see these errors from amdxdna:

Jul 31 20:39:26 pike kernel: amdxdna 0000:c2:00.1: [drm] *ERROR* aie2_send_mgmt_msg_wait: command opcode 0x2 failed, status 0x2000003
Jul 31 20:39:26 pike kernel: amdxdna 0000:c2:00.1: [drm] *ERROR* aie2_hwctx_init: Alloc hw resource failed, ret -22
Jul 31 20:39:26 pike kernel: amdxdna 0000:c2:00.1: [drm] *ERROR* amdxdna_drm_create_hwctx_ioctl: Init hwctx failed, ret -22

Does anyone have any idea what might be going on? Even after updating nixpkgs several times, the error persists, and the error messages don’t seem too helpful.

Per NPU DRM_IOCTL_AMDXDNA_CREATE_HWCTX error with FLM · Issue #79 · noamsto/nix-amd-ai · GitHub, this seems to be an upstream FLM regression with this generation of NPUs. Reverting to FLM v0.9.44 fixes it.

1 Like