Repository navigation
fix(npu): stop reporting no NPU on Linux APUs with a large GPU carve-out - #6736
Conversation
On Linux, `gaia init --profile npu` told a Strix Halo with a 64 GB GPU carve-out that it had no NPU, and setup hid the NPU models there. Lemonade's Physical Memory is installed RAM on Windows but MemTotal on Linux, which already excludes the carve-out; GAIA subtracted the carve-out on both, so a carve-out as large as the RAM Linux sees left zero memory for the NPU. The carve-out now comes off only for a Windows report, in both the Python capacity reader and the TUI's Go mirror.
|
Verdict: Approve with suggestions On Linux, a Ryzen AI Max PC with a large GPU memory carve-out was wrongly told it had no NPU. This PR fixes that. GAIA was subtracting the carve-out from a memory figure that Linux has already taken it out of. Now it subtracts only on Windows, where Lemonade reports installed RAM. The Python setup path and the TUI's copy of the rule are changed together and agree, and the tests now use the memory figure a real Linux Lemonade reports. Nothing blocks the merge. One small hardening point: if Lemonade ever leaves out the OS name, GAIA quietly assumes Linux. On a Windows PC that would overstate the memory the NPU has. Real-world evidenceThe evidence stage ran the real Agent UI backend twice against a stubbed Lemonade that answers like a Linux Strix Halo (62.4 GB of system memory, 64 GB carve-out, NPU available): once on this PR and once on its parent. Settings › Model context range for the NPU model ( Setup path ( Spot checks came back the same on both versions: on a Windows-shaped report the carve-out still comes off (48 GB NPU), the GPU pool stays at 96 GB, and the GPU model's context, local status and provider list all return 200. Not exercised here:
For those surfaces the verdict rests on static review and unit tests. 🔍 Technical detailsIssues 🟢 A missing 🟢 Stale number in a test message ( Checked, no finding
Strengths
|
On Linux, a Ryzen AI Max PC with a large GPU memory carve-out was told it has no NPU.
gaia init --profile npustopped with "Lemonade reports no available AMD NPU", and setup hid the NPU models. A 128 GB Strix Halo set to 64 GB of VRAM is a common setup for local LLMs and hits this. It also fails the release gate's Linux NPU chat job on every RC since rc10 (runs 42022209446, 41973946000, both on runner sjlab-stx-halo-19). With this fix, such a PC gets its NPU offered and sized correctly.This PR alone won't turn that job green. Runner sjlab-stx-halo-19's locked-memory limit is 7.8 GB and the NPU model needs about 10.6 GB, so the job will next fail on GAIA's own "locked-memory limit" message. That's the accurate error, and the fix is on the runner.
🔍 Technical details
Physical Memoryis installed DIMM capacity on Windows (WMIWin32_PhysicalMemory) but/proc/meminfoMemTotal on Linux, which already excludes the carve-out._npu_memory_gbsubtracted the carve-out on both, so on halo-19 it computed 62.4 − 64 → 0 →None→ "no NPU". Lemonade itself loggedNPU hardware: Yes.OS Versionstarts withWindows. The Go mirror (tui/internal/lemonade/capacity.go) gets the same rule, so the TUI picker agrees.STRIX_HALO_128fixture claimed to be a Linux report but carried 128 GB of Physical Memory, which a Linux Lemonade never sends. That is the wrong assumption behind the bug, so it now carries MemTotal.Test plan
python -m pytest tests/unit/test_flm_models.py tests/unit/test_npu_twin_models.pypasses. The four new Linux cases fail onmainwith the CI job's exact "no available AMD NPU" error.cd tui && go test ./internal/lemonade/passes.test_npu_agent_chat.ymland confirm the Linux job gets past "Downloading models".