evga-icx/nvidia-sensors.h
moosecrap 4c5321bc4e Added support for some NVML sensors.
GPU temp sensor and clock reasons.
2025-02-02 21:42:30 -08:00

28 lines
1.1 KiB
C

#include <nvml.h>
#include "evga-card.h"
struct clock_reason {
unsigned long long mask;
char *short_name;
char *long_name;
};
static struct clock_reason clock_reason_names[] =
{
{nvmlClocksEventReasonGpuIdle, "Idle", "GPU idle"},
{nvmlClocksEventReasonApplicationsClocksSetting, "AppClk", "Application clocks"},
{nvmlClocksEventReasonSwPowerCap, "Pwr", "Power cap"},
{nvmlClocksThrottleReasonHwSlowdown, "HWSlow", "Hardware slowdown"},
{nvmlClocksEventReasonSyncBoost, "Sync", "Sync boost"},
{nvmlClocksEventReasonSwThermalSlowdown, "SWTherm", "Software thermal"},
{nvmlClocksThrottleReasonHwThermalSlowdown, "HWTherm", "Hardware thermal"},
{nvmlClocksThrottleReasonHwPowerBrakeSlowdown, "HWPower", "Hardware power brake"},
{nvmlClocksEventReasonDisplayClockSetting, "DispClk", "Display clock"}
};
int init_nvml();
void print_nvml_temp(int compact, struct card_info *card);
void print_nvml_clock_reason(int compact, struct card_info *card);
unsigned int get_nvml_temp(struct card_info *card);
unsigned long long get_nvml_clock_reasons(struct card_info *card);