OpenFlowLM-Next icon indicating copy to clipboard operation
OpenFlowLM-Next copied to clipboard

oflm validate passes on machines where oflm run can't open the NPU

Open Cyronius opened this issue 2 months ago • 2 comments

On Linux, validate and run reach the NPU by two different routes, and validate only checks one of them. It can report a healthy stack on a machine where every model fails immediately.

A user on Fedora 44 hit this:

$ ./oflm run qwen3.6-moe:35b-a3b
Error:  No such device with index '0'

$ xrt-smi examine
...
Device(s) Present
  0 devices found

oflm validate passed on that same machine — kernel 7.1.13, /dev/accel/accel0 with 8 columns, firmware 1.1.2.64, memlock infinity.

Both results are correct. sanity_check_npu_stack (src/src/main.cpp:210) opens /dev/accel/accelN directly and checks kernel version, DRM version, firmware version, column count and the memlock limit. Its verdict — overall_ok, src/src/main.cpp:400 — is built from exactly those five things. It never touches XRT. But run and serve open the NPU through XRT (oflm_rt::device(0) at src/runner/runner.cpp:44 and src/server/rest_handler.cpp:326), and XRT can only see an NPU if it can load its userspace plugin, libxrt_driver_xdna.so.2, at runtime. Without that plugin XRT enumerates zero devices no matter how healthy the kernel side is.

Fedora packages that plugin nowhere, and building XRT from source doesn't produce it — it comes from the separate amd/xdna-driver repo. So a Fedora user gets a green validate and a runtime failure with nothing connecting them.

Suggested fix: have validate construct a device on the same runtime backend run uses, and fold that into ready. When it fails, name the missing plugin as the likely cause instead of passing XRT's No such device with index '0' straight through. An xrt_ok field in the --json output would keep it machine-readable.

The docs already cover this, but only as an after-the-fact footnote in three places (docs/docs/install_lin.md:213, docs/docs/instructions/cli.md:54, docs/linux-getting-started.md:110). Three copies of "if validate passes but run fails" suggests validate should just check it.

Happy to send a PR if you want it done this way. Separately: there's no Fedora section in the install guide at all — I can add one here or on its own.

Cyronius avatar Sep 14 '26 16:09 Cyronius

I wonder what the difference is on rawhide (that's what I use). Fedora install goes git clone [email protected]:Atomic-Germ/OpenFlowLM-Next --recursive && cd OpenFlowLM-Next && cmake -B build -G Ninja --preset linux-default && cmake --build build -j 6 && sudo cmake --install build aaaand you have to make the ironvenv (EDIT: python 3.11, I recommend using uv ) in order to build the kernels -- the fact that it's my development environment means everything is either biased toward windows from one of y'all psychopaths, or fedora when it's me. Packaging is going to be very important though because this is about as smooth as it gets from the repo. That'll come after the CI #87 is pulled.

I like your suggestion; if you would like to do it, you can assign yourself to it. Otherwise I'll work on it tomorrow

Atomic-Germ avatar Sep 15 '26 03:09 Atomic-Germ

Yeah there are probably some windows-isms from me -- my laptop that has the amd hardware is my work laptop, so I'm kind of Windows-only for this project.

If you're able to look at it, that would be awesome.

Cyronius avatar Sep 16 '26 11:09 Cyronius