feat: GPU table display + fan speed collection
This commit is contained in:
+3
-1
@@ -142,6 +142,7 @@ type GPUInfo struct {
|
||||
CoreClock float64 `json:"core_clock_mhz"`
|
||||
MemClock float64 `json:"mem_clock_mhz"`
|
||||
Power float64 `json:"power_watts"`
|
||||
FanSpeed float64 `json:"fan_speed"`
|
||||
}
|
||||
|
||||
// ═══════════════════════════════════════════════
|
||||
@@ -1085,7 +1086,7 @@ func tryNvidiaSMI() []GPUInfo {
|
||||
ctx, cancel := context.WithTimeout(context.Background(), 5*time.Second)
|
||||
defer cancel()
|
||||
out, err := exec.CommandContext(ctx, "nvidia-smi",
|
||||
"--query-gpu=index,name,memory.total,memory.used,memory.free,temperature.gpu,utilization.gpu,clocks.current.graphics,clocks.current.memory,power.draw",
|
||||
"--query-gpu=index,name,memory.total,memory.used,memory.free,temperature.gpu,utilization.gpu,clocks.current.graphics,clocks.current.memory,power.draw,fan.speed",
|
||||
"--format=csv,noheader,nounits",
|
||||
).Output()
|
||||
if err != nil {
|
||||
@@ -1109,6 +1110,7 @@ func tryNvidiaSMI() []GPUInfo {
|
||||
CoreClock: parseFloat(parts[7]),
|
||||
MemClock: parseFloat(parts[8]),
|
||||
Power: parseFloat(parts[9]),
|
||||
FanSpeed: parseFloat(parts[10]),
|
||||
})
|
||||
}
|
||||
return gpus
|
||||
|
||||
Reference in New Issue
Block a user