From aab5725d82fb8f5466363dd1dc79d7dcfcb760c7 Mon Sep 17 00:00:00 2001 From: henrygd Date: Fri, 18 Apr 2025 18:00:39 -0400 Subject: [PATCH] Use gpu temp as primary sensor if no other sensors --- beszel/internal/agent/system.go | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/beszel/internal/agent/system.go b/beszel/internal/agent/system.go index c325dba..7ce4fee 100644 --- a/beszel/internal/agent/system.go +++ b/beszel/internal/agent/system.go @@ -199,16 +199,24 @@ func (a *Agent) getSystemStats() system.Stats { if systemStats.Temperatures == nil { systemStats.Temperatures = make(map[string]float64, len(gpuData)) } + highestTemp := 0.0 for _, gpu := range gpuData { if gpu.Temperature > 0 { systemStats.Temperatures[gpu.Name] = gpu.Temperature if a.sensorConfig.primarySensor == gpu.Name { a.systemInfo.DashboardTemp = gpu.Temperature } + if gpu.Temperature > highestTemp { + highestTemp = gpu.Temperature + } } // update high gpu percent for dashboard a.systemInfo.GpuPct = max(a.systemInfo.GpuPct, gpu.Usage) } + // use highest temp for dashboard temp if dashboard temp is unset + if a.systemInfo.DashboardTemp == 0 { + a.systemInfo.DashboardTemp = highestTemp + } } }