int hm_NvAPI_EnumPhysicalGPUs (NVAPI_PTR *nvapi, NvPhysicalGpuHandle nvGPUHandle[NVAPI_MAX_PHYSICAL_GPUS], NvU32 *pGpuCount) { if (!nvapi) return (-1); NvAPI_Status NvAPI_rc = nvapi->NvAPI_EnumPhysicalGPUs (nvGPUHandle, pGpuCount); if (NvAPI_rc != NVAPI_OK) { NvAPI_ShortString string = { 0 }; hm_NvAPI_GetErrorMessage (nvapi, NvAPI_rc, string); log_info ("WARN: %s %d %s\n", "NvAPI_EnumPhysicalGPUs()", NvAPI_rc, string); } return NvAPI_rc; }
int hm_NvAPI_Unload (NVAPI_PTR *nvapi) { if (!nvapi) return (-1); NvAPI_Status NvAPI_rc = nvapi->NvAPI_Unload (); if (NvAPI_rc != NVAPI_OK) { NvAPI_ShortString string = { 0 }; hm_NvAPI_GetErrorMessage (nvapi, NvAPI_rc, string); log_info ("WARN: %s %d %s\n", "NvAPI_Unload()", NvAPI_rc, string); } return NvAPI_rc; }
int hm_NvAPI_GPU_GetPerfPoliciesStatus (NVAPI_PTR *nvapi, NvPhysicalGpuHandle hPhysicalGpu, NV_GPU_PERF_POLICIES_STATUS_PARAMS_V1 *perfPolicies_status) { if (!nvapi) return (-1); NvAPI_Status NvAPI_rc = nvapi->NvAPI_GPU_GetPerfPoliciesStatus (hPhysicalGpu, perfPolicies_status); if (NvAPI_rc != NVAPI_OK) { NvAPI_ShortString string = { 0 }; hm_NvAPI_GetErrorMessage (nvapi, NvAPI_rc, string); log_info ("WARN: %s %d %s\n", "NvAPI_GPU_GetPerfPoliciesStatus()", NvAPI_rc, string); } return NvAPI_rc; }
int hm_NvAPI_GPU_GetDynamicPstatesInfoEx (NVAPI_PTR *nvapi, NvPhysicalGpuHandle hPhysicalGpu, NV_GPU_DYNAMIC_PSTATES_INFO_EX *pDynamicPstatesInfoEx) { if (!nvapi) return (-1); NvAPI_Status NvAPI_rc = nvapi->NvAPI_GPU_GetDynamicPstatesInfoEx (hPhysicalGpu, pDynamicPstatesInfoEx); if (NvAPI_rc != NVAPI_OK) { NvAPI_ShortString string = { 0 }; hm_NvAPI_GetErrorMessage (nvapi, NvAPI_rc, string); log_info ("WARN: %s %d %s\n", "NvAPI_GPU_GetDynamicPstatesInfoEx()", NvAPI_rc, string); } return NvAPI_rc; }
int hm_NvAPI_GPU_GetTachReading (NVAPI_PTR *nvapi, NvPhysicalGpuHandle hPhysicalGPU, NvU32 *pValue) { if (!nvapi) return (-1); NvAPI_Status NvAPI_rc = nvapi->NvAPI_GPU_GetTachReading (hPhysicalGPU, pValue); if (NvAPI_rc != NVAPI_OK) { NvAPI_ShortString string = { 0 }; hm_NvAPI_GetErrorMessage (nvapi, NvAPI_rc, string); log_info ("WARN: %s %d %s\n", "NvAPI_GPU_GetTachReading()", NvAPI_rc, string); } return NvAPI_rc; }
int hm_NvAPI_GPU_GetThermalSettings (NVAPI_PTR *nvapi, NvPhysicalGpuHandle hPhysicalGpu, NvU32 sensorIndex, NV_GPU_THERMAL_SETTINGS *pThermalSettings) { if (!nvapi) return (-1); NvAPI_Status NvAPI_rc = nvapi->NvAPI_GPU_GetThermalSettings (hPhysicalGpu, sensorIndex, pThermalSettings); if (NvAPI_rc != NVAPI_OK) { NvAPI_ShortString string = { 0 }; hm_NvAPI_GetErrorMessage (nvapi, NvAPI_rc, string); log_info ("WARN: %s %d %s\n", "NvAPI_GPU_GetThermalSettings()", NvAPI_rc, string); } return NvAPI_rc; }
int hm_NvAPI_GPU_SetCoolerLevels (NVAPI_PTR *nvapi, NvPhysicalGpuHandle hPhysicalGpu, NvU32 coolerIndex, NV_GPU_COOLER_LEVELS *pCoolerLevels) { if (!nvapi) return (-1); NvAPI_Status NvAPI_rc = nvapi->NvAPI_GPU_SetCoolerLevels (hPhysicalGpu, coolerIndex, pCoolerLevels); if (NvAPI_rc != NVAPI_OK) { NvAPI_ShortString string = { 0 }; hm_NvAPI_GetErrorMessage (nvapi, NvAPI_rc, string); log_info ("WARN: %s %d %s\n", "NvAPI_GPU_SetCoolerLevels()", NvAPI_rc, string); } return NvAPI_rc; }
int hm_NvAPI_GPU_RestoreCoolerSettings (NVAPI_PTR *nvapi, NvPhysicalGpuHandle hPhysicalGpu, NvU32 coolerIndex) { if (!nvapi) return (-1); NvAPI_Status NvAPI_rc = nvapi->NvAPI_GPU_RestoreCoolerSettings (hPhysicalGpu, coolerIndex); if (NvAPI_rc != NVAPI_OK) { NvAPI_ShortString string = { 0 }; hm_NvAPI_GetErrorMessage (nvapi, NvAPI_rc, string); log_info ("WARN: %s %d %s\n", "NvAPI_GPU_RestoreCoolerSettings()", NvAPI_rc, string); } return NvAPI_rc; }
int hm_NvAPI_Initialize (NVAPI_PTR *nvapi) { if (!nvapi) return (-1); NvAPI_Status NvAPI_rc = nvapi->NvAPI_Initialize (); if (NvAPI_rc == NVAPI_LIBRARY_NOT_FOUND) NvAPI_rc = NVAPI_OK; // not a bug if (NvAPI_rc != NVAPI_OK) { NvAPI_ShortString string = { 0 }; hm_NvAPI_GetErrorMessage (nvapi, NvAPI_rc, string); log_info ("WARN: %s %d %s\n", "NvAPI_Initialize()", NvAPI_rc, string); } return NvAPI_rc; }