Repository navigation
check-ubuntu-2604-lemond: --gpu keeps the render GID, and the HRX0 check reads the backend argv - #737
Conversation
…eck reads the backend argv
The --gpu path could not work on Strix Halo. On 2026-10-31, with the shipped package
(lemond 2026.46.0~5.ef0f3b49, engine 1bit/ from rc-2026-10-31c):
== lemond
listed: Check-HRX llamacpp-hrx
[Info] (Process) 1bit serve: memory: need 1.31 GiB ... at ctx 4096, free 35.42 GiB
[Error] (Process) error while handling argument "--device": invalid device: HRX0
[Error] (WrappedServer) llama-server process has terminated
Two separate bugs, both in the harness:
1. --group-add puts the host render GID (990 here) on the container main process, but the
script starts lemond with runuser -u lemonade, and runuser resets the supplementary
groups to the image /etc/group - where stock ubuntu:26.04 has no render group at all.
Measured in the container:
--group-add 990,44: id -> groups=0(root),44(video),990(990)
runuser -u lemonade -- id -> groups=1001(lemonade)
setpriv --reuid lemonade --regid 1001 --groups 990,44 -- id
-> groups=1001(lemonade),44(video),990(990)
So lemond and its llama-server ran without GID 990, could not open /dev/kfd
(crw-rw---- root:render), HSA never came up, libggml-hrx registered no device and
llama-server rejected --device HRX0. The --gpu branch now passes the host render and
video GIDs into the container and starts lemond with setpriv (without --init-groups:
setpriv refuses it together with --groups). The no-GPU path still uses runuser.
2. The final check grepped /tmp/lemond.log for HRX0, but 1bit serve logs the memory it
checked and not the device, so the check failed on a run that had in fact reached HRX0.
It now reads the backend argv (/proc/<pid>/cmdline) and requires --device HRX0 there.
Proven on this box, same command, after the patch:
reply: 2 + 3 equals **5**.
/opt/1bit/hrx/llama/bin/llama-server -m ... --ctx-size 4096 --device HRX0 --port 8001
--jinja --metrics --parallel 1 -ngl 99 --cache-reuse 256
GGML_HRX_REPORT=1
GGML_HRX_STRICT=1
IREE_HAL_AMDGPU_LIBHSA_PATH=/opt/rocm-therock/.../libhsa-runtime64.so.1
Inference completed: model=Check-HRX, tokens=33 (in=19, out=14), ttft=0.26s, tps=114.57
PASS
and the no-GPU path (CPU stand-in) still passes.
PR Reviewer Guide 🔍(Review updated until commit 09b59be)Here are some key observations to aid the review process:
|
bong-water-water-bong
left a comment
There was a problem hiding this comment.
VERDICT: READY
At 977e196b (+23 −5, scripts/check-ubuntu-2604-lemond.sh). A test-harness fix, and the mechanics check out.
The setpriv branch actually runs. The inner container script tests $GPU, and that variable is passed in — $runtime exec -e GPU="$gpu" … — so the --gpu path is not dead code. RENDER_GID/VIDEO_GID are passed with -e in the same opts the run uses, and are only consumed on that branch, so the pair is consistent. setpriv --groups taking the two GIDs (mutually exclusive with --init-groups, as the comment says) is the right shape for keeping the host GIDs that --group-add gave the container's main process, which runuser drops.
The new HRX0 assertion greps the right thing. grep -q -- "--device HRX0" against the backend's /proc/<pid>/cmdline — I can confirm that string is what the engine's launcher actually produces, because a live process on this box shows it:
.../hrx/llama/bin/llama-server -m .../Qwen3-8B... --device HRX0 -ngl 99 --jinja -c 8192 ...
so the check will match a working run rather than depending on lemond's log wording. Replacing a log grep with an argv grep is the correct call here, and the comment says why (1bit serve logs the memory it checked but not the device).
bash -n clean.
Not executed: the container run itself. It needs docker/podman, pulls ubuntu:26.04, installs the Lemonade PPA and the engine package, and starts a GPU-backed lemond — too heavy to start on this box right now under the memory rule while other lanes hold models, and not something I can validate from here. So this verdict covers the script's correctness (variables wired, branch reachable, grep target verified against a real argv, syntax), not that a PASS comes out of the far end. If you want that run gated before merge, it belongs in a systemd-run --user -p MemoryMax= unit when the box is quiet.
tprs-ready applied.
|
Persistent review updated to latest commit 09b59be |
bong-water-water-bong
left a comment
There was a problem hiding this comment.
VERDICT: READY
At 09b59be6 (rebased onto 4d566349 after #718 merged). Author patch unchanged — patch-id 092b8fd5ced7 at both heads — so my earlier verification carries whole: the setpriv branch is reachable ($runtime exec -e GPU="$gpu"), and the new --device HRX0 argv assertion matches what the engine really launches (I confirmed the string against a live llama-server cmdline on this box). bash -n clean.
tprs-ready stands. Still not executed: the container run itself (docker + Lemonade PPA + a GPU-backed lemond), which stays yours to gate when the box is quiet.
scripts/check-ubuntu-2604-lemond.sh … --gpucould not pass on Strix Halo before this: the load returned 500 andlemond.logsaidTwo separate bugs, both in the harness (the engine and Lemonade were fine: the same package ran on HRX0 on the host twice tonight at 277 / 290 tok/s).
1.
--group-addis lost atrunuser, so/dev/kfdcannot be opened--group-add <host render gid>reaches the container main process, but the script starts lemond withrunuser -u lemonade -- …, andrunuserresets the supplementary groups to the image's/etc/group— where stockubuntu:26.04has norendergroup at all. Measured in a container:So lemond and its
llama-serverran without GID 990, could not open/dev/kfd(crw-rw---- root:render), HSA never initialised,libggml-hrxregistered no device, and llama-server rejected--device HRX0. Fix: the--gpubranch now passes the host render/video GIDs into the container (-e RENDER_GID=… -e VIDEO_GID=…) and starts lemond withsetpriv --reuid lemonade --regid "$(id -g lemonade)" --groups "$RENDER_GID,$VIDEO_GID" --(no--init-groups: setpriv refuses it together with--groups, exit 1 — that cost one iteration). The no-GPU path still usesrunuser, unchanged.2. The final HRX0 assertion read the wrong place
It grepped
/tmp/lemond.logforHRX0, but1bit servelogs the memory it checked and not the device, so the check failed on a run that had in fact reached HRX0. It now reads the backend argv (/proc/<pid>/cmdline) and requires--device HRX0there.Proof (same command, same box, after the patch)
Package under test:
lemonade-onebit-rc-2026-10-31c(lemond2026.46.0~5.ef0f3b49) with its1bit/as the engine package; PPAlemond 2026.44.1~26.04; modelunsloth/Qwen3-0.6B-GGUF:Q4_K_M; kernel7.3.0-rc4-1bit-perfopt+, ROCm SDK in/opt/rocm-therock. The no-GPU path (CPU stand-in) still passes with the patch.Note for #715: this run is the shipped packaging's behaviour, i.e.
1bit serveinautoCWSR placement, andamdgpu.cwsr_enable=0here, so the backend gets noHSA_USE_SVM=0 …trio — it completed fine at ctx 4096, but a longer soak under SVM is exactly what #715 is about; the script does not set the trio and I did not add it (that is the serve-default decision, not the harness's).