fix fan pwm

This commit is contained in:
Drath
2025-09-13 17:59:52 +02:00
parent 26a8056693
commit e01b7fde16

View File

@@ -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));