Files
linuxSmartie/include/gpu.hpp
2025-09-14 13:14:34 +02:00

44 lines
1.0 KiB
C++

#ifndef GPU_HPP
#define GPU_HPP
/* see which we actually need now */
#include <cstdint>
#include <fstream>
#include <print>
#include <string>
#include <utils.hpp>
#include <gpu_metrics.hpp>
#define REL_METRICS_PATH "/../../gpu_metrics"
#define MAX_METRICS_LENGTH 512
/* should refactor this struct so its a little cleaner and closer to gpu_metrics */
struct gpu_t {
uint16_t fan_speed = 0;
uint16_t core_clock = 0;
uint16_t mem_clock = 0;
double vcore = 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;
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;
};
std::string detectGpuHwmon(std::string pci);
bool checkForMetrics(std::string hwmon);
gpu_t getGpu(std::string hw, bool hasMetrics);
#endif