feat(webui): show GPU serial in NVIDIA selection pickers

Every GPU-selection picker (Load/SAT, Burn, Benchmark) now renders the
card serial: "GPU N — <model> · <mem> MiB · sn: <serial>". The serial is
monospace and the digits that differ across the listed GPUs (common
prefix/suffix stripped) are emphasised so operators can tell cards apart.

Row markup was duplicated across three pages (and twice within
page_validate.go). Consolidated into a single module,
internal/webui/gpu_picker.go: beeGpuPicker.render({...}) builds every row;
gpuPickerCSS/gpuPickerJS are injected once by layoutHead/renderPage. Pages
keep their own selection-note text and multi-GPU toggles but no longer
hand-build <label> markup.

ListNvidiaGPUs() adds the serial via nvidia-smi --query-gpu=...,serial;
N/A is normalised to empty. Serial flows to the client unchanged through
the existing /api/gpu/nvidia JSON response.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AudE3Q2nd9kxxVuxPKcTho
This commit is contained in:
Mikhail Chusavitin
2026-09-04 10:04:47 +03:00
co-authored by Claude Sonnet 5
parent f31971f440
commit e4f7519ef3
8 changed files with 112 additions and 68 deletions
+7 -1
View File
@@ -81,7 +81,13 @@ This happens for:
**File:** `audit/internal/webui/pages.go`
- Source: `GET /api/gpus``api.go``ListNvidiaGPUs()` → live nvidia-smi
- Render: `'GPU ' + gpu.index + ' — ' + gpu.name + ' · ' + mem`
- Render: `'GPU N — <model> · <mem> MiB · sn: <serial>'`
(serial from `nvidia-smi --query-gpu=...,serial`; omitted when N/A)
- **Single source:** `audit/internal/webui/gpu_picker.go``beeGpuPicker.render({...})` builds every
row. All three pages (Load/SAT, Burn, Benchmark) call it from their `*RenderGPUList` wrapper;
`gpuPickerCSS`/`gpuPickerJS` are injected once by `layoutHead`/`renderPage`.
- Serial is rendered monospace; the digits that differ across the listed GPUs (common
prefix/suffix stripped) are bolded in accent colour.
- Fallback: `gpu.name || 'GPU ' + idx` (JS, line ~1432)
This always shows the correct model because it queries nvidia-smi live. It is **not** connected to benchmark result data.