From dec33b445a5cabb5108e599d6eb3f80cd316051d Mon Sep 17 00:00:00 2001 From: Rebecca Cran Date: Wed, 2 Jul 2025 03:48:28 -0600 Subject: [PATCH] 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 --- src/linux/btop_collect.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/linux/btop_collect.cpp b/src/linux/btop_collect.cpp index a948fc1..46175eb 100644 --- a/src/linux/btop_collect.cpp +++ b/src/linux/btop_collect.cpp @@ -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; }