From 0e57419d8b0d338c2f2234eb7d1f92df3daa895d Mon Sep 17 00:00:00 2001 From: Mitchell-Johnson Date: Tue, 10 Nov 2026 00:40:56 -0800 Subject: [PATCH] Top: the second of two identical GPUs draws its busy graph Its sensors were gpu..usage_2 and so on; the page looks under gpu._2. Each card now gets its own stem, as the page already assumed. Co-Authored-By: Claude Opus 5.5 --- internal/metrics/sensors.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/internal/metrics/sensors.go b/internal/metrics/sensors.go index 4a69c54..eadd533 100644 --- a/internal/metrics/sensors.go +++ b/internal/metrics/sensors.go @@ -142,8 +142,14 @@ func flatten(s Sample, want func(id string) bool) []sensors.Sensor { f.add(p+".used_pct", x.Mount+" used", "usage", "%", ratio(x.Used, x.Size), s.fsT, pct, lbl...) } + gpuSeen := map[string]int{} for _, g := range s.GPUs { + // two identical cards are gpu. and gpu._2, every sensor of the second under + // its own stem (not add's suffix on the end of each id, which the page can't find) p := "gpu." + sensors.Seg(g.Name) + if gpuSeen[p]++; gpuSeen[p] > 1 { + p = fmt.Sprintf("%s_%d", p, gpuSeen[p]) + } lbl := []string{"name", g.Name, "driver", g.Driver} if g.Bus != "" { lbl = append(lbl, "bus", g.Bus)