Repository navigation
install.sh: say what the xdna2 npu still needs on amd - #97
Merged
Merged
Conversation
From 0.5.3 the Linux/x86_64 engine uses the machine's XDNA2 NPU beside the GPU while it reads a prompt, when the NPU's driver and firmware (/dev/accel/accel0), XRT with its NPU plugin and a locked-memory limit of 64 MiB or more are there. Without them it runs on the GPU alone. On a machine with an NPU (the device node, or PCI 1022:17f0 without one) the installer now names each missing piece in its closing notes, with the command or file that adds it. It says nothing on a machine without an NPU, with everything there, or for a release whose bundle has no NPU module, and it never stops because of the NPU. The checks look under BASERT_INSTALL_TEST_ROOT, as the ROCm ones do.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
From 0.5.3 the Linux x86-64 (ROCm) engine uses the machine's XDNA2 NPU beside the GPU while it reads a prompt. The bundle carries the engine's own parts; the machine has to bring three things, and without any of them the engine prints one
[npu_ffn] the prefill stays on the GPU alone: ...line and runs on the GPU as before. The installer already checks for the ROCm runtime and prints the apt lines. This does the same for the NPU, so nobody has to find the steps in a release note.What the installer does now
On Linux x86-64, after the GPU and ROCm checks:
/dev/accel/accel0, or without it a PCI device1022:17f0. With neither it says nothing.amdxdnadriver is not loaded, the driver is loaded but the firmware folder (amdnpu/17f0_<revision>) is missing, or both are there and the kernel log has the reason. A node the user cannot open gets therendergroup line.libxrt_coreutil.so.2(what the engine's NPU module loads) andlibxrt_driver_xdna.so.2(the NPU plugin, fromlibxrt-npu2), looked for inLD_LIBRARY_PATH, the folders/etc/ld.so.confandld.so.conf.dname, and the loader's own. The fix issudo apt install libxrt2 libxrt-npu2, orlibxrt-npu2alone when only the plugin is missing; off Ubuntu 26.04 the line says that is where those packages are./proc/self/limits. Below 64 MiB (the engine's own threshold: XRT locks a 64 MiB heap) it prints thelimits.dline andLimitMEMLOCK=infinityfor a systemd service.Each missing piece is one entry in the closing notes, under a heading that says BaseRT works without the NPU, on the GPU alone:
It never runs
apt,sudoormodprobe, never writes outside the install directory, and never fails the install because of the NPU: the check's errors are discarded and its result is only printed.Two choices worth a look in review:
baseRT_rocm_npu.soin the bundle (or in the install directory, on a run that finds the release already installed). SoBASERT_VERSION=v0.5.2on a machine without XRT stays quiet. This ties the installer to that file name: if the module is renamed before 0.5.3 ships,NPU_MODULEininstall.shhas to follow, or the notes never show.The checks look under
BASERT_INSTALL_TEST_ROOT, like the ROCm ones, so the tests build each machine as a folder.Tested
python3 tests/scripts/test_packaging.pypasses (69 tests, 13 of them new) on macOS withshand withdash, andshellcheck install.shis clean. Against the installer before this change 9 of the 13 fail; the other 4 are the ones that expect silence. Fake machines covered:1022:17f0), XRT missing, 8 MiB limit10and11;unlimitedand exactly 64 MiB)sudo apt install libxrt2 libxrt-npu2os-releasesudo apt install libxrt-npu2LD_LIBRARY_PATHorld.so.conf.dnames the folderlimits.dline andLimitMEMLOCK=infinitysudo modprobe amdxdna/ the firmware folder /sudo dmesg | grep amdxdnarendergroup lineOn real hardware: one Strix Point machine (Ryzen AI 300, Ubuntu 26.04, kernel 7.0,
amdxdnabound to1022:17f0revision10, XRT 2.21.75 from apt, unlimited locked memory). The installer ran against its real/sys,/procand library folders with a stand-in for the download (a bundle holding the NPU module, installed into a temporary folder):ulimit -l 8192: the locked-memory entry alone, with "8192 KiB";The installer tests also pass there (Linux,
dash, GNU tools). The PCI id, the firmware folder names (17f0_10,17f0_11), the two library names and the device node'srendergroup were read from that machine.Not tested on real hardware: a machine whose NPU has no driver or no firmware, a machine without XRT or without the plugin, a device node the user cannot open, a Strix Halo (revision
11; its firmware folder was seen, the machine was not run), and any distribution other than Ubuntu 26.04. Those cases are covered by the fake machines only. "Linux 6.14 and later have the driver" is from the kernel's history, not from a run. The printed fixes (apt install, thelimits.dfile,modprobe) were not executed anywhere as part of this change. No real 0.5.3 bundle was installed, since none is published yet.