Uh oh!
There was an error while loading. Please reload this page.
fix(cli): resources show suppresses the phantom GPU on GPU-less machines - #275
Conversation
The chart stamps GPU_REQUESTS/GPU_LIMITS=nvidia.com/gpu=1 as literal container env on every install, even CPU-only hosts, so ParseTraining reports a phantom HasGPU=true. `resources show` then printed "per training run: up to N CPU · M GiB · 1 GPU" on a machine with no GPU — and under --verbose ALSO printed "gpu: none detected", contradicting itself. Normalize train.HasGPU to false when the node read succeeded and exposes no GPU (the same guard already used for the "none detected" detail), mirroring the set path's phantom-GPU handling (Bugbot #241). A node-read failure leaves it as-is, since we can't confirm absence. Adds a regression test. Pre-empts the Cursor Bugbot "phantom GPU" class of finding on #266. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
LukasWodka
commented
Jul 14, 2026
👋 Heads-up — Code review queue is at 36 / 30 Above the WIP limit. The team convention is to review existing PRs before opening new work. Open PRs currently in Code review (oldest first):
Pull from review before opening new work. (This is a nudge from the kanban WIP check, not a block.) |
Uh oh!
There was an error while loading. Please reload this page.
LukasWodka
left a comment
There was a problem hiding this comment.
Reviewed — correct and well-scoped. ✅
The guard only drops HasGPU when the node read succeeded and confirmed no GPU (nodeErr == nil && len(machine.GPU) == 0), so a node-read failure correctly leaves it untouched (can't prove absence — the capacity line already says "unavailable"). Mirrors the set path's #241 normalization, and the new test genuinely fails-before/passes-after on the · 1 GPU assertion.
Two tiny test nits (non-blocking):
- In
TestRenderResources_PhantomGPUSuppressed, the first assertionstrings.Contains(out, "GPU") && !strings.Contains(out, "none detected")is effectively a no-op here: underWithVerbose(true)the raw-env dump printsGPU_LIMITS(soContains("GPU")is already true) andnone detectedis present, so the&&never fires. The· 1 GPUcheck is the one actually carrying the regression — worth leaning on that (and maybe dropping the first). - Optional: also assert the per-run line's positive shape (ends at
GiB), so a future refactor that drops the GPU clause differently is still pinned.
LGTM to merge.
—
Review assisted by Claude Code.
What
Found during a proactive pre-bugbot review of the #266 promote. On a CPU-only host,
tracebloc resources(show) reports a phantom GPU:GPU_REQUESTS/GPU_LIMITS = nvidia.com/gpu=1as literal container env on every install, soParseTrainingreturnsHasGPU=true.renderResourcesthen printsper training run: up to N CPU · M GiB · 1 GPUeven though the machine has no GPU — and under--verboseit also printsgpu: none detected, contradicting itself.The
setpath already normalizes exactly this (phantomGPU := current.HasGPU && !machineHasGPU, Bugbot #241); theshowpath didn't.Fix
Drop
train.HasGPUwhen the node read succeeded and the node exposes no GPU — the samenodeErr == nil && len(machine.GPU) == 0guard already used for the "none detected" detail. A node-read failure leaves it untouched (can't confirm absence; the capacity line already says "unavailable").Verification
gofmt/vetclean;go test ./internal/cli/ -run TestRenderResourcesgreen.TestRenderResources_PhantomGPUSuppressed(no-GPU node + phantomGPU_LIMITSenv) — fails before the fix (prints· 1 GPU), passes after.TestRenderResources_GPUSurfaced(real GPU node) still shows the GPU.Once merged to
develop, promote PR #266 picks it up.🤖 Generated with Claude Code
Note
Low Risk
Read-only display fix in the CLI resources view with a focused regression test; no cluster mutation or auth changes.
Overview
On CPU-only hosts,
tracebloc resourcescould still show 1 GPU on the per-run ceiling because chart-defaultGPU_LIMITSenv makesParseTrainingsetHasGPU, which clashed with verbose gpu: none detected.renderResourcesnow clearstrain.HasGPUwhen node capacity was read successfully and the machine has no GPU devices—the same guard as the verbose detail and aligned withresources setphantom-GPU handling (Bugbot #241). If node listing fails, behavior is unchanged.Adds
TestRenderResources_PhantomGPUSuppressedfor a no-GPU node with phantomGPU_LIMITSenv.Reviewed by Cursor Bugbot for commit 7331df1. Bugbot is set up for automated code reviews on this repo. Configure here.