Skip to content

Commit

Permalink
intel gpu frequency
Browse files Browse the repository at this point in the history
  • Loading branch information
bjia56 committed Jul 31, 2024
1 parent 7d1ad95 commit 3c01996
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/linux/btop_collect.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1665,7 +1665,7 @@ namespace Gpu {
gpus_slice->supported_functions = {
.gpu_utilization = true,
.mem_utilization = false,
.gpu_clock = false,
.gpu_clock = true,
.mem_clock = false,
.pwr_usage = true,
.pwr_state = false,
Expand All @@ -1691,13 +1691,15 @@ namespace Gpu {

double pwr = pmu_calc(&engines->r_gpu.val, 1, t, engines->r_gpu.scale); // in Watts
gpus_slice->pwr_usage = (long long)round(pwr * 1000);

if (gpus_slice->pwr_usage > 0) {
gpus_slice->gpu_percent.at("gpu-pwr-totals").push_back(100);
} else {
gpus_slice->gpu_percent.at("gpu-pwr-totals").push_back(0);
}

double freq = pmu_calc(&engines->freq_act.val, 1, t, 1); // in MHz
gpus_slice->gpu_clock_speed = (unsigned int)round(freq);

return true;
}
}
Expand Down

0 comments on commit 3c01996

Please sign in to comment.