|
|
@ -9,10 +9,12 @@ nvmlReturn_t result;
|
|
|
|
nvmlDevice_t nvidiaDevice;
|
|
|
|
nvmlDevice_t nvidiaDevice;
|
|
|
|
nvmlPciInfo_t nvidiaPciInfo;
|
|
|
|
nvmlPciInfo_t nvidiaPciInfo;
|
|
|
|
bool nvmlSuccess = false;
|
|
|
|
bool nvmlSuccess = false;
|
|
|
|
unsigned int nvidiaTemp = 0, nvidiaCoreClock = 0, nvidiaMemClock = 0, nvidiaPowerUsage = 0, NvidiaFanSpeed = 0;
|
|
|
|
unsigned int nvidiaTemp = 0, nvidiaCoreClock = 0, nvidiaMemClock = 0, nvidiaPowerUsage = 0, nvidiaFanSpeed = 0;
|
|
|
|
unsigned long long nvml_throttle_reasons;
|
|
|
|
unsigned long long nvml_throttle_reasons;
|
|
|
|
struct nvmlUtilization_st nvidiaUtilization;
|
|
|
|
struct nvmlUtilization_st nvidiaUtilization;
|
|
|
|
struct nvmlMemory_st nvidiaMemory {};
|
|
|
|
struct nvmlMemory_st nvidiaMemory {};
|
|
|
|
|
|
|
|
struct nvmlUnitFanSpeeds_st nvidiaFanSpeeds {};
|
|
|
|
|
|
|
|
struct nvmlUnit_st* nvidiaUnit {};
|
|
|
|
|
|
|
|
|
|
|
|
bool checkNVML(const char* pciBusId){
|
|
|
|
bool checkNVML(const char* pciBusId){
|
|
|
|
auto& nvml = get_libnvml_loader();
|
|
|
|
auto& nvml = get_libnvml_loader();
|
|
|
@ -55,7 +57,9 @@ bool getNVMLInfo(const struct overlay_params& params){
|
|
|
|
nvml.nvmlDeviceGetClockInfo(nvidiaDevice, NVML_CLOCK_GRAPHICS, &nvidiaCoreClock);
|
|
|
|
nvml.nvmlDeviceGetClockInfo(nvidiaDevice, NVML_CLOCK_GRAPHICS, &nvidiaCoreClock);
|
|
|
|
nvml.nvmlDeviceGetClockInfo(nvidiaDevice, NVML_CLOCK_MEM, &nvidiaMemClock);
|
|
|
|
nvml.nvmlDeviceGetClockInfo(nvidiaDevice, NVML_CLOCK_MEM, &nvidiaMemClock);
|
|
|
|
nvml.nvmlDeviceGetPowerUsage(nvidiaDevice, &nvidiaPowerUsage);
|
|
|
|
nvml.nvmlDeviceGetPowerUsage(nvidiaDevice, &nvidiaPowerUsage);
|
|
|
|
nvml.nvmlDeviceGetFanSpeed(nvidiaDevice, &NvidiaFanSpeed);
|
|
|
|
nvml.nvmlUnitGetHandleByIndex(0, &nvidiaUnit);
|
|
|
|
|
|
|
|
nvml.nvmlUnitGetFanSpeedInfo(nvidiaUnit, &nvidiaFanSpeeds);
|
|
|
|
|
|
|
|
nvidiaFanSpeed = nvidiaFanSpeeds.fans[0].speed;
|
|
|
|
deviceID = nvidiaPciInfo.pciDeviceId >> 16;
|
|
|
|
deviceID = nvidiaPciInfo.pciDeviceId >> 16;
|
|
|
|
if (params.enabled[OVERLAY_PARAM_ENABLED_throttling_status])
|
|
|
|
if (params.enabled[OVERLAY_PARAM_ENABLED_throttling_status])
|
|
|
|
nvml.nvmlDeviceGetCurrentClocksThrottleReasons(nvidiaDevice, &nvml_throttle_reasons);
|
|
|
|
nvml.nvmlDeviceGetCurrentClocksThrottleReasons(nvidiaDevice, &nvml_throttle_reasons);
|
|
|
|