diff options
author | Kalka <kalka2088@gmail.com> | 2024-04-11 22:50:58 -0400 |
---|---|---|
committer | Kalka <kalka2088@gmail.com> | 2024-04-11 22:50:58 -0400 |
commit | b06474136b130d4c97defcd904a5e5aeadccdce7 (patch) | |
tree | bd4328337217652c07c9b8443a1894052505b462 | |
parent | d1680735d9329884c2d46f545a36df32ca5e40cf (diff) |
fix pwr_usage not being defined correctly during rsmi collection
-rw-r--r-- | src/linux/btop_collect.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/linux/btop_collect.cpp b/src/linux/btop_collect.cpp index e6b5bc6..9f20be0 100644 --- a/src/linux/btop_collect.cpp +++ b/src/linux/btop_collect.cpp @@ -1507,7 +1507,10 @@ namespace Gpu { if (result != RSMI_STATUS_SUCCESS) { Logger::warning("ROCm SMI: Failed to get GPU power usage"); if constexpr(is_init) gpus_slice[i].supported_functions.pwr_usage = false; - } else gpus_slice[i].gpu_percent.at("gpu-pwr-totals").push_back(clamp((long long)round((double)gpus_slice[i].pwr_usage * 100.0 / (double)gpus_slice[i].pwr_max_usage), 0ll, 100ll)); + } else { + gpus_slice[i].pwr_usage = (long long)power / 1000; + gpus_slice[i].gpu_percent.at("gpu-pwr-totals").push_back(clamp((long long)round((double)gpus_slice[i].pwr_usage * 100.0 / (double)gpus_slice[i].pwr_max_usage), 0ll, 100ll)); + } if constexpr(is_init) gpus_slice[i].supported_functions.pwr_state = false; } |