Add NVIDIA GPU temperature monitoring support (nouveau driver)
- Add nouveau chip recognition to temperature parser - Implement parseNouveauGPUTemps() for NVIDIA GPU temps via nouveau driver - Map "GPU core" sensor to edge temperature field - Supports systems using open-source nouveau driver This complements the AMD GPU support added previously. Systems using the nouveau driver will now see NVIDIA GPU temperatures in the dashboard. For proprietary nvidia driver users, GPU temps are not available via lm-sensors and would require nvidia-smi integration.
This commit is contained in:
parent
d62259ffa7
commit
12dc8693c4
1 changed files with 44 additions and 0 deletions
|
|
@ -372,6 +372,14 @@ func (tc *TemperatureCollector) parseSensorsJSON(jsonStr string) (*models.Temper
|
|||
Msg("Detected AMD GPU temperature chip")
|
||||
tc.parseGPUTemps(chipName, chipMap, temp)
|
||||
}
|
||||
|
||||
// Handle NVIDIA GPU temperature sensors (nouveau driver)
|
||||
if strings.Contains(chipLower, "nouveau") {
|
||||
log.Debug().
|
||||
Str("chip", chipName).
|
||||
Msg("Detected NVIDIA GPU temperature chip (nouveau)")
|
||||
tc.parseNouveauGPUTemps(chipName, chipMap, temp)
|
||||
}
|
||||
}
|
||||
|
||||
// If we got CPU temps, calculate max from cores if package not available
|
||||
|
|
@ -604,6 +612,42 @@ func (tc *TemperatureCollector) parseGPUTemps(chipName string, chipMap map[strin
|
|||
}
|
||||
}
|
||||
|
||||
// parseNouveauGPUTemps extracts NVIDIA GPU temperature data from nouveau driver sensors
|
||||
func (tc *TemperatureCollector) parseNouveauGPUTemps(chipName string, chipMap map[string]interface{}, temp *models.Temperature) {
|
||||
gpuTemp := models.GPUTemp{
|
||||
Device: chipName,
|
||||
}
|
||||
|
||||
// Nouveau driver typically exposes "GPU core" sensor
|
||||
for sensorName, sensorData := range chipMap {
|
||||
sensorMap, ok := sensorData.(map[string]interface{})
|
||||
if !ok {
|
||||
continue
|
||||
}
|
||||
|
||||
sensorLower := strings.ToLower(sensorName)
|
||||
tempVal := extractTempInput(sensorMap)
|
||||
|
||||
if math.IsNaN(tempVal) || tempVal <= 0 {
|
||||
continue
|
||||
}
|
||||
|
||||
// Nouveau typically has "GPU core" sensor - map to edge temperature
|
||||
if strings.Contains(sensorLower, "gpu") || strings.Contains(sensorLower, "core") {
|
||||
gpuTemp.Edge = tempVal
|
||||
}
|
||||
}
|
||||
|
||||
// Only add GPU entry if we got a valid temperature
|
||||
if gpuTemp.Edge > 0 {
|
||||
temp.GPU = append(temp.GPU, gpuTemp)
|
||||
log.Debug().
|
||||
Str("device", chipName).
|
||||
Float64("edge", gpuTemp.Edge).
|
||||
Msg("Parsed NVIDIA GPU (nouveau) temperature")
|
||||
}
|
||||
}
|
||||
|
||||
// extractTempInput extracts temperature value from sensor data
|
||||
func extractTempInput(sensorMap map[string]interface{}) float64 {
|
||||
// Look for temp*_input fields
|
||||
|
|
|
|||
Loading…
Reference in a new issue