gpu refactor

This commit is contained in:
Drath
2025-09-22 21:00:40 +02:00
parent 499eaac37b
commit f72a6ca139
3 changed files with 57 additions and 49 deletions

View File

@@ -8,10 +8,8 @@
#include <string>
#include <utils.hpp>
#define REL_METRICS_PATH "/../../gpu_metrics"
#define MAX_METRICS_LENGTH 512
#define METRICS_IS(m) auto metrics = reinterpret_cast<m*>(raw_metrics)
#define REL_METRICS_PATH "/../../gpu_metrics" // gpu_metrics path relative to hwmon path
#define MAX_METRICS_LENGTH 512 // length of the metrics buffer
/* should refactor this struct so its a little cleaner and closer to gpu_metrics */
/* clean abstraction for gpu_metrics or metrics in filesystem in sane units */
@@ -22,25 +20,31 @@ struct sensors {
std::string hwmon = "";
bool hasGpuMetrics = false;
uint16_t fan_speed = 0;
uint16_t core_clock = 0;
uint16_t mem_clock = 0;
float vcore = 0.0f;
uint16_t clock_core = 0;
uint16_t clock_mem = 0;
uint8_t fan_pwm = 0;
uint16_t fan_speed = 0;
uint16_t power_avg = 0;
uint16_t power_cap = 0;
uint16_t power_max = 0;
uint8_t fan_pwm = 0;
uint8_t edge_temp = 0;
uint8_t hotspot_temp = 0;
uint8_t mem_temp = 0;
uint8_t gfx_vrm_temp = 0;
uint8_t soc_vrm_temp = 0;
uint8_t mem_vrm_temp = 0;
uint16_t power_cap_max = 0;
uint8_t temp_edge = 0;
uint8_t temp_hotspot = 0;
uint8_t temp_mem = 0;
uint8_t temp_vrm_gfx = 0;
uint8_t temp_vrm_soc = 0;
uint8_t temp_vrm_mem = 0;
uint8_t usage_core = 0;
uint8_t usage_media = 0;
uint8_t usage_umc = 0;
uint64_t vram_used = 0;
uint64_t vram_total = 0;
uint8_t core_usage = 0;
uint8_t media_usage = 0;
uint8_t umc_usage = 0;
};
void detectHwmon(sensors* target, std::string pci);