Fix auto-detection of CPU temp on Ampere boards (#1185)

Ampere boards use the APM X-Gene Hardware Monitoring driver. The label
the driver returns is "Soc Temperature" which the current code doesn't
detect. Fix that by adding a special case for it. This prevents it from
using the "CPU Power" sensor and reporting the CPU tempature as over
8000C (which is the power reported in mW).

Co-authored-by: Rebecca Cran <rebecca@os.amperecomputing.com>
This commit is contained in:
Rebecca Cran
2025-07-02 03:48:28 -06:00
committed by GitHub
parent be845e693a
commit dec33b445a

View File

@@ -445,7 +445,7 @@ namespace Cpu {
found_sensors[sensor_name] = Sensor { fs::path(basepath + "input"), temp, crit };
if (not got_cpu and (label.starts_with("Package id") or label.starts_with("Tdie"))) {
if (not got_cpu and (label.starts_with("Package id") or label.starts_with("Tdie") or label.starts_with("SoC Temperature"))) {
got_cpu = true;
cpu_sensor = sensor_name;
}