Merge pull request #1539 from alephpiece/fix-gpu-pwr_total

This commit is contained in:
Jakob P. Liljenberg
2026-05-01 10:04:10 +02:00
committed by GitHub

View File

@@ -2018,7 +2018,7 @@ namespace Gpu {
if (gpu.supported_functions.mem_total)
mem_total += gpu.mem_total;
if (gpu.supported_functions.pwr_usage)
mem_total += gpu.pwr_usage;
pwr_total += gpu.pwr_usage;
//* Trim vectors if there are more values than needed for graphs
if (width != 0) {
@@ -2036,9 +2036,9 @@ namespace Gpu {
shared_gpu_percent.at("gpu-average").push_back(avg / gpus.size());
if (mem_total != 0)
shared_gpu_percent.at("gpu-vram-total").push_back(mem_usage_total / mem_total);
shared_gpu_percent.at("gpu-vram-total").push_back(static_cast<long long>(round(mem_usage_total * 100.0 / mem_total)));
if (gpu_pwr_total_max != 0)
shared_gpu_percent.at("gpu-pwr-total").push_back(pwr_total / gpu_pwr_total_max);
shared_gpu_percent.at("gpu-pwr-total").push_back(clamp(static_cast<long long>(round(pwr_total * 100.0 / gpu_pwr_total_max)), 0ll, 100ll));
if (width != 0) {
while (cmp_greater(shared_gpu_percent.at("gpu-average").size(), width * 2)) shared_gpu_percent.at("gpu-average").pop_front();