Skip to content

Commit

Permalink
fix pwr_usage not being defined correctly during rsmi collection
Browse files Browse the repository at this point in the history
  • Loading branch information
kalkafox committed Apr 12, 2024
1 parent d168073 commit b064741
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/linux/btop_collect.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit b064741

Please sign in to comment.