Repository navigation
fix(cdi)!: use the engine's stock CDI spec; retire the podman-6.2.0 keep-id workaround - #129
Conversation
…eep-id workaround The devices-only CDI spec, the ~114 read-only driver-library binds, the SONAME binds and the LD_LIBRARY_PATH override worked around a podman 6.2.0 regression: 6.2.0 applied MOUNT_ATTR_IDMAP to the CDI spec's mounts under keep-id (mount_setattr EPERM, exit 126). podman 6.1.4 and 6.2.1 inject the same spec cleanly — measured by swapping only the podman binary on one host and one image. The workaround wrote VERSIONED host driver paths into every GPU unit, so every unit stopped starting at the next driver upgrade (the operator's charly-comfyui-cdi: down since the 615.78.08 -> 620.73.04 upgrade). It also dropped nvidia-smi and the toolkit's ldcache hook. Every emitter now carries only AddDevice=nvidia.com/gpu=all under keep-id and lets the engine apply its own stock spec. podman 6.2.0 is refused at config time with the remedy named (D-HW-6 preflight). Closes #127 Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Tvdn3smn7hhJAPbCPEE5dH Agent: vol-cdi · Claude Code session 8daa865c-d43e-447b-90b3-7d16ccc921d7 Assisted-by: Claude Code Anthropic Claude Opus 5.5 (fully tested and validated)
Review — BLOCKHead SHA: Change class: code/config ( Blocks
Non-blocking notes
Verdict: BLOCK ollama-cloud/deepseek-v4.1-flash — action-review. |
updateAllDeployedQuadlets re-emits every deployed unit; a GPU unit it wrote on podman 6.2.0 would fail at its first start. It now runs the same D-HW-6 preflight as runConfig and skips that deploy with a warning (the batch's own convention), instead of writing a unit that cannot start. Raised by the validator on #129. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Tvdn3smn7hhJAPbCPEE5dH Agent: vol-cdi · Claude Code session 8daa865c-d43e-447b-90b3-7d16ccc921d7 Assisted-by: Claude Code Anthropic Claude Opus 5.5 (fully tested and validated)
|
STATUS Round 2 answers all three blocks and the note in one new commit ( 1. C1/CONC, the one-off
2. C2, spike evidence.
3. L3, the 6.2.0 refusal branch, live.
Note: Also: Agent: |
Review — BLOCKHead SHA: Change class: plugin Go code ( Comments considered
Blocks
Verdict: BLOCK ollama-cloud/deepseek-v4.1-flash — action-review. |
…CDI device A privileged podman unit takes the host's devices directly and no emitter adds nvidia.com/gpu=all to it, so podman 6.2.0's idmapped CDI mounts never arise there; the deleted gate exempted it, and the new preflight wrongly refused it. The preflight now takes the unit's privilege and runs where it is known: in runConfig right after the security is resolved (still before the unit is written), and in the batch re-emit from the deploy's metadata. A privileged case is added to TestCDIKeepIDPreflight. Raised by the validator on #129 (round 2). Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Tvdn3smn7hhJAPbCPEE5dH Agent: vol-cdi · Claude Code session 8daa865c-d43e-447b-90b3-7d16ccc921d7 Assisted-by: Claude Code Anthropic Claude Opus 5.5 (fully tested and validated)
|
STATUS Round 3 answers both blocks in one new commit ( 1. C1/C11, privileged units falsely refused.
2. C11/L3, the batch refusal had not run live.
Agent: |
Review — PASSHead SHA: Security screen: PASS — no scope mismatch (the diff does exactly what the body says: deletes the derived-spec workaround, reduces every emitter to the stock CDI device, adds the version preflight, retargets the bed); no secrets/egress/eval; no weakened guardrail; no supply-chain change. Placement: CORRECT — capability stays in the Checklist: All applicable rules PASS or NA (L1–L3, C0–C12, ARCH/QUAL/SDD/ADE/CONC/DISP, coordination). Tool-limited disposition: I cannot re-run gofmt/tests/beds; the pasted output is internally consistent with the diff (14 files; Comments considered
Non-blocking notes: (1) the layer-cdi Verdict: PASS ollama-cloud/deepseek-v4.1-flash — action-review. |
Summary
Every podman GPU unit now uses the engine's stock CDI spec under keep-id. The devices-only-spec workaround is deleted, and podman 6.2.0 is refused at config time (#127).
Why. The workaround worked around a podman 6.2.0 regression:
MOUNT_ATTR_IDMAPto the CDI spec's mounts under keep-id (mount_setattr … EPERM, exit 126).--cdi-spec-dir, ~114 read-only driver-library binds, SONAME binds and anLD_LIBRARY_PATHoverride.The harm. The workaround wrote versioned host driver paths into every unit, so every GPU unit stopped starting at the next driver upgrade. The operator's
charly-comfyui-cdihas been down since the 615.78.08 → 620.73.04 upgrade on 2026-11-30. The workaround also removednvidia-smiand the toolkit's ldcache hook (the charly#1280 class).Changes:
cdi_spec.go(339 lines) and its two test files are deleted.AddDevice=nvidia.com/gpu=all/--device nvidia.com/gpu=allunder keep-id: the quadlet,directRunArgs,buildStartArgsandbuildShellArgs.cdi_preflight.gorefuses a keep-id podman GPU unit on podman 6.2.0 before anything is written, naming the upgrade (D-HW-6). This applies inrunConfigand in the batch re-emitterupdateAllDeployedQuadlets; the batch skips such a deploy with a warning. A privileged unit is exempt: it carries no CDI device, as the deleted gate also held.check-pod-cdi-usernsbed now asserts the stock-spec contract::rolibrary bind, noLD_LIBRARY_PATH, no versioned driver path;nvidia-smiruns inside and reports the host kernel module.How tested
Head
31d080f7d3fa976069c9f134cbe7a5438a32e43b:The commits:
6decfb1: the cutover;31cecd9(round 2): the batch-path preflight;31d080f(round 3): the privileged exemption, with therunConfigpreflight moved to where the privilege is known.Round 3, on head
31d080f: the privileged exemption and the batch refusal, liveThe run used an isolated
XDG_CONFIG_HOME=/tmp/cs/xcfg, holding only a scratch privileged GPU deploy (spk-priv,security: {privileged: true}) plus this repo'spod-cdi-keepid-bind. A--update-allbatch therefore re-emits only these, never the host's operator units.charly deploy pathconfirms the override is honoured, anddeploykit.QuadletDirresolves under the same XDG config base.What the run shows:
0AddDevice=nvidia.com/gpulines,PodmanArgs=--privileged).$Cis the worktree-built charly. Round 3 also passes the module suite, including the new privileged case:The cause, by binary swap
The old podman binaries were extracted from the pacman cache into a spike directory (since removed). The exact command and its output:
The stock spec on a real CUDA workload
The real
comfyui-cdiimage, with its own python, under keep-id. The second arm, with no GPU, is the control that shows the probe can fail.The loop ran with:
I=ghcr.io/opencharly/comfyui-cdi:2026.335.2228;PYBIN=/home/user/.pixi/envs/default/bin/python3, the interpreter the running ComfyUI process uses, read from inside a live comfyui deploy;T='import torch,time;t=time.time();ok=torch.cuda.is_available();x=torch.ones(1024,1024,device="cuda") if ok else None;print("cuda",ok,torch.version.cuda,"sum",float(x.sum()) if ok else None,"%.2fs"%(time.time()-t))'.The live outage this removes (F1)
The new emitter test fails without the change
cdi_stock_test.gowas copied alone onto an untouchedorigin/maincheckout (e0a0418) on this host, which has/etc/cdi/nvidia.yaml. Its complete output went to a file; its argv lines are 9,291 bytes long, so the second command prints each failure without the argv:All four properties fail on each of the three argv emitters. The quadlet arm passes on the old code, because the old code applied the workaround in
runConfigrather than inGenerateQuadlet; the bed below covers the written unit. On the change, vet passes and the whole suite passes:TestCDIKeepIDPreflightrefuses only podman 6.2.0 with a GPU on a non-privileged unit. Its other cases are 6.2.1, 6.1.4, no-GPU, privileged (round 3), docker and an unreadable version, each passed.The 6.2.0 refusal in
runConfig, live (round 2, head31cecd9)The real podman 6.2.0 binary, extracted from the pacman cache, was placed first on
PATH, andcharly configran for the GPU bed's deploy. The refusal comes before anything is written: the unit file does not exist afterwards.The R10 bed
Round 2, on head
31cecd9:Round 1, on the committed tree
84a91f1(the head before the round-2 commit), with the worktree-built charly 2026.335.1816:The check-live phase ran both of its steps; none was skipped. Its summary line is
2 steps: 2 passed, 0 failed, 0 skipped. The plugin was built from THIS worktree: the.check/logs nameplugin-deploy-pod: served from /home/atrawog/.cache/charly/plugin-build/views/plugin-deploy-pod-5ef8b8c681b74347 (build sha256:6b60187ca0d0…); source /home/atrawog/coder/claude00/opencharly/.worktrees/vol-cdi/….The step's own evidence files (
.check/pod-cdi-userns.log*) show:UserNS=keep-id:uid=1000,gid=1000andAddDevice=nvidia.com/gpu=all;nvidia-smiinside printing620.73.04, against== host module: 620.73.04;-rw-r--r-- 1 1000 1000 … probeafter the first start, andprobe-after-updateafter remove → config → start.The other beds of this repo, and a control on main
The other five beds ran one after another on this branch, from this loop (
Cis the same worktree-built charly path):The three red beds were run again on an untouched
origin/main(e0a0418) worktree, with the same binary, as a control:They fail on the same steps without this change:
pe-config-path-completesandpd-secret-unreadable-vs-absent: ghcr refuses anonymous pulls of their fixture images (ensure-image: pull ghcr.io/opencharly/check-firecracker-app:2026.287.1522 failed: exit status 125). That is plugin-deploy-pod#65, with new evidence added.rebuild-refuses-a-boxless-deploy: its "boxless" subjectpod-cdi-keepid-bindrunsarch-cdi-probe, which became a declared box, soupdate --buildcorrectly builds it. Filed as plugin-deploy-pod#128.The first branch run of
check-pod-rebuild-buildalso failedrebuild-builds-a-declared-boxonce, while other heavy work ran on the host. Rerun alone on this branch it matches the control:Under equal load, main and branch (round 2). An idle rerun does not rebut a failure that surfaced under load, so the bed ran on both trees while the same heavy load was running: a
charly box build comfyui-cdi --no-cache, a BuildKit build fromarch.archonward, still running when each bed finished. The script is/tmp/cs/loadrepro.sh <tree> <label>: it starts the load, waits for--- Building, runs the bed, and reports whether the load was still running.Main and the branch behave identically under load, so this change does not make the step load-sensitive.
The one-off failure itself cannot be attributed. The step's first command is
${CHARLY_BIN} config pod-overlay-builder >/dev/null 2>&1 || { echo "config failed"; exit 1; }, which discards the only evidence, and.check/rebuild-build.logwas never written in that run. That missing control is filed as plugin-deploy-pod#130, so it is tracked rather than dismissed.Spike
The RCA named the cause: a workaround for a podman 6.2.0 regression whose versioned binds break on driver upgrades. Every candidate ran live on podman 6.2.1 (keep-id, uid 1000, driver 620.73.04, the probe image), each with its own command, output and exit code:
(a) The stock spec under keep-id: works. This is the binary-swap block's final
rc=0, the ComfyUI torchcuda Truerun, and the bed above.(b) A devices-only spec + ONE version-free driver directory: works, but stales and drops
nvidia-smi. The directory holds reflinked copies of the 42.sofiles the stock spec mounts, plus the SONAME links fromldconfig -n:The directory is a copy, so at the next driver upgrade it still holds the old version, which is the F1 failure again. It also loses
nvidia-smiand the ldcache hook.(c) Re-derive the per-file binds at start (ExecStartPre). Derived naively from the current spec's mounts, it fails: the spec mounts only the versioned files, and the SONAME links come from the
create-symlinkshook, which a devices-only spec drops:With the full derivation the old code did (versioned files + SONAME links +
LD_LIBRARY_PATH), using the exact 114 binds a 620-driver unit carried, it works:This is the deleted mechanism, run at a different time. It works only with a 114-bind derived set, a derived spec and a loader override, all to deliver what (a) delivers with none of them (C4: a second injection mechanism for one behaviour).
(d)
--userns=autowith an idmapped bind: fails rootless.Winner: (a). It is the only working candidate that carries no derived state and keeps
nvidia-smiand the ldcache hook.Rulebook compliance
rebuild-builds-a-declared-boxfailure was reproduced under equal load on main and the branch (both green) and could not be attributed because the step discards its own output; that missing control is filed as check-pod-rebuild-build: rebuild-builds-a-declared-box discards charly config output, so a one-off failure under load cannot be attributed #130.cdi_spec.go,cdi_spec_test.go,cdi_argv_test.go, every call site and every comment that taught the derived spec are deleted. The sweep finds only the new test's negative assertions, which name the retired shapes in order to forbid them:In
charly.ymlthe shape is named only by the bed's history comment and by its negative assertions. The skill prose (layer-cdicdi/cdi-layer) is that repo's, and follows producer-first as its own PR.31cecd9. Every changed preflight branch ran live on a real podman 6.2.0: therunConfigrefusal (round 2), and on31d080fthe privileged exemption plus the batch-path refusal. Of the other beds, two passed and three are red identically on unchanged main, each with its cause tracked.feat/branch in a session worktree, the issue claimed first, no force-push.Plan conformance
Winning candidate: (a) the stock CDI spec under keep-id plus a podman 6.2.0 preflight.
--cdi-spec-dir/ library binds /LD_LIBRARY_PATHfrom unitssharedlease"Change classification
charlyplugin Go code (thedeploy:podprovider) plus its R10 bed. Behaviour change: GPU units carry the stock CDI device only.Breaking change + rollback: a host on podman 6.2.0 now gets a config-time refusal naming the upgrade, where it previously got the workaround's unit. Existing units keep their old binds until
charly configre-runs, which re-emits them without the workaround. Rollback is a revert of this commit.Filed issues
check-pod-rebuild-buildboxless-subject premise (non-blocking, filed from this gate).rebuild-builds-a-declared-boxdiscards itscharly configoutput, so a one-off failure under load cannot be attributed (non-blocking, filed from this gate).Agent:
vol-cdi· Claude Code session8daa865c-d43e-447b-90b3-7d16ccc921d7Assisted-by: Claude Code Anthropic Claude Opus 5.5 (fully tested and validated)