From e01b7fde16977d1aa680f973375136517a7fedac Mon Sep 17 00:00:00 2001 From: Drath Date: Sat, 13 Sep 2025 17:59:52 +0200 Subject: [PATCH] fix fan pwm --- src/gpu.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/gpu.cpp b/src/gpu.cpp index bb0ffbb..b4fa410 100644 --- a/src/gpu.cpp +++ b/src/gpu.cpp @@ -128,7 +128,7 @@ gpu_t getGpu(GpuMetricsHeader_t header, std::string hw) { gpu.vcore = std::stol(readFile(hw + "/hwmon/hwmon" + std::to_string(hwmon) + "/in0_input")) / 1000.0; gpu.power_cap = std::stol(readFile(hw + "/hwmon/hwmon" + std::to_string(hwmon) + "/power1_cap", 3)); gpu.power_max = std::stol(readFile(hw + "/hwmon/hwmon" + std::to_string(hwmon) + "/power1_cap_max", 3)); - // gpu.fan_pwm = std::stoi(readFile(hw + "/hwmon/hwmon" + std::to_string(hwmon)+ "/pwm1")); // not super useful + gpu.fan_pwm = std::stoi(readFile(hwmon + "/pwm1", 4)) * 100 / 256; // not super useful gpu.vram_used = std::stoul(readFile(hw + "/mem_info_vram_used")); gpu.vram_total = std::stoul(readFile(hw + "/mem_info_vram_total")); @@ -171,7 +171,7 @@ gpu_t getGpu(std::string hwmon) { gpu.vcore = std::stol(readFile(hwmon + "/in0_input", 4)) / 1000.0; gpu.power_cap = std::stol(readFile(hwmon + "/power1_cap", 16)) / 1000000; // gpu.power_max = std::stol(readFile(hwmon + "/power1_cap_max", 16)) / 1000000; - // gpu.fan_pwm = std::stoi(readFile(hw + "/hwmon/hwmon" + std::to_string(hwmon)+ "/pwm1")); // not super useful + gpu.fan_pwm = std::stoi(readFile(hwmon + "/pwm1", 4)) * 100 / 256; // not super useful gpu.vram_used = std::stoul(readFile(hwmon + "/../../mem_info_vram_used", 16)); // gpu.vram_total = std::stoul(readFile(hwmon + "/../../mem_info_vram_total", 16));