gpu_metrics: apu: set cpu temp as highest core temp

This commit is contained in:
FlightlessMango 2022-02-04 21:01:44 +01:00
parent 6983c2ec39
commit 986f3cc1b3
2 changed files with 8 additions and 0 deletions

View File

@ -1,5 +1,6 @@
#include "amdgpu.h"
#include "overlay.h"
#include "cpu.h"
std::string metrics_path = "";
@ -32,6 +33,12 @@ void amdgpu_get_metrics()
gpu_info.temp = amdgpu_metrics.temperature_gfx / 100;
gpu_info.MemClock = amdgpu_metrics.current_uclk;
gpu_info.apu_cpu_power = amdgpu_metrics.average_cpu_power;
int cpu_temp = 0;
for (int i = 0; i < cpuStats.GetCPUData().size() / 2; i++)
if (amdgpu_metrics.temperature_core[i] > cpu_temp)
cpu_temp = amdgpu_metrics.temperature_core[i];
gpu_info.apu_cpu_temp = cpu_temp / 100;
}
}
}

View File

@ -27,6 +27,7 @@ struct gpuInfo{
int CoreClock;
int powerUsage;
int apu_cpu_power;
int apu_cpu_temp;
};
extern struct gpuInfo gpu_info;