2 * Author......: Jens Steube <jens.steube@gmail.com>
8 nvmlReturn_t
hc_NVML_nvmlInit (void)
10 nvmlReturn_t nvml_rc
= nvmlInit ();
12 if (nvml_rc
!= NVML_SUCCESS
)
14 const char *string
= nvmlErrorString (nvml_rc
);
16 log_info ("WARN: %s %d %s\n", "nvmlInit()", nvml_rc
, string
);
22 nvmlReturn_t
hc_NVML_nvmlShutdown (void)
24 nvmlReturn_t nvml_rc
= nvmlShutdown ();
26 if (nvml_rc
!= NVML_SUCCESS
)
28 const char *string
= nvmlErrorString (nvml_rc
);
30 log_info ("WARN: %s %d %s\n", "nvmlShutdown()", nvml_rc
, string
);
36 nvmlReturn_t
hc_NVML_nvmlDeviceGetName (nvmlDevice_t device
, char *name
, unsigned int length
)
38 nvmlReturn_t nvml_rc
= nvmlDeviceGetName (device
, name
, length
);
40 if (nvml_rc
!= NVML_SUCCESS
)
42 const char *string
= nvmlErrorString (nvml_rc
);
44 log_info ("WARN: %s %d %s\n", "nvmlDeviceGetName()", nvml_rc
, string
);
50 nvmlReturn_t
hc_NVML_nvmlDeviceGetHandleByIndex (unsigned int index
, nvmlDevice_t
*device
)
52 nvmlReturn_t nvml_rc
= nvmlDeviceGetHandleByIndex (index
, device
);
54 if (nvml_rc
!= NVML_SUCCESS
)
56 const char *string
= nvmlErrorString (nvml_rc
);
58 log_info ("WARN: %s %d %s\n", "nvmlDeviceGetHandleByIndex()", nvml_rc
, string
);
64 nvmlReturn_t
hc_NVML_nvmlDeviceGetTemperature (nvmlDevice_t device
, nvmlTemperatureSensors_t sensorType
, unsigned int *temp
)
66 nvmlReturn_t nvml_rc
= nvmlDeviceGetTemperature (device
, sensorType
, temp
);
68 if (nvml_rc
!= NVML_SUCCESS
)
72 //const char *string = nvmlErrorString (nvml_rc);
74 //log_info ("WARN: %s %d %s\n", "nvmlDeviceGetTemperature()", nvml_rc, string);
80 nvmlReturn_t
hc_NVML_nvmlDeviceGetFanSpeed (nvmlDevice_t device
, unsigned int *speed
)
82 nvmlReturn_t nvml_rc
= nvmlDeviceGetFanSpeed (device
, speed
);
84 if (nvml_rc
!= NVML_SUCCESS
)
88 //const char *string = nvmlErrorString (nvml_rc);
90 //log_info ("WARN: %s %d %s\n", "nvmlDeviceGetFanSpeed()", nvml_rc, string);
96 /* only tesla following */
98 nvmlReturn_t
hc_NVML_nvmlDeviceGetPowerUsage (nvmlDevice_t device
, unsigned int *power
)
100 nvmlReturn_t nvml_rc
= nvmlDeviceGetPowerUsage (device
, power
);
102 if (nvml_rc
!= NVML_SUCCESS
)
106 //const char *string = nvmlErrorString (nvml_rc);
108 //log_info ("WARN: %s %d %s\n", "nvmlDeviceGetPowerUsage()", nvml_rc, string);
114 nvmlReturn_t
hc_NVML_nvmlDeviceGetUtilizationRates (nvmlDevice_t device
, nvmlUtilization_t
*utilization
)
116 nvmlReturn_t nvml_rc
= nvmlDeviceGetUtilizationRates (device
, utilization
);
118 if (nvml_rc
!= NVML_SUCCESS
)
120 utilization
->gpu
= -1;
121 utilization
->memory
= -1;
123 //const char *string = nvmlErrorString (nvml_rc);
125 //log_info ("WARN: %s %d %s\n", "nvmlDeviceGetUtilizationRates()", nvml_rc, string);