Skip to content

Commit

Permalink
Merge pull request #819 from kalkafox/rsmi-pwr-usage-fix
Browse files Browse the repository at this point in the history
fix pwr_usage not being defined correctly during rsmi collection
  • Loading branch information
aristocratos authored Apr 28, 2024
2 parents 0e07deb + b064741 commit 924c3f3
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 924c3f3

Please sign in to comment.