@ -352,7 +369,7 @@ int nvml_reset_clocks(nvml_handle *nvmlh, int dev_id)
@@ -352,7 +369,7 @@ int nvml_reset_clocks(nvml_handle *nvmlh, int dev_id)
uint32_tgpu_clk=0,mem_clk=0;
intn=nvmlh->cuda_nvml_device_id[dev_id];
if(n<0||n>=nvmlh->nvml_gpucount)
return-1;
return-ENODEV;
if(!gpu_clocks_changed[dev_id])
return0;// nothing to do
@ -383,7 +400,10 @@ int nvml_get_gpu_name(nvml_handle *nvmlh, int cudaindex, char *namebuf, int bufs
@@ -383,7 +400,10 @@ int nvml_get_gpu_name(nvml_handle *nvmlh, int cudaindex, char *namebuf, int bufs
@ -397,7 +417,10 @@ int nvml_get_tempC(nvml_handle *nvmlh, int cudaindex, unsigned int *tempC)
@@ -397,7 +417,10 @@ int nvml_get_tempC(nvml_handle *nvmlh, int cudaindex, unsigned int *tempC)
@ -413,7 +436,10 @@ int nvml_get_fanpcnt(nvml_handle *nvmlh, int cudaindex, unsigned int *fanpcnt)
@@ -413,7 +436,10 @@ int nvml_get_fanpcnt(nvml_handle *nvmlh, int cudaindex, unsigned int *fanpcnt)
@ -428,12 +454,15 @@ int nvml_get_power_usage(nvml_handle *nvmlh, int cudaindex, unsigned int *milliw
@@ -428,12 +454,15 @@ int nvml_get_power_usage(nvml_handle *nvmlh, int cudaindex, unsigned int *milliw
@ -445,7 +474,10 @@ int nvml_get_pstate(nvml_handle *nvmlh, int cudaindex, int *pstate)
@@ -445,7 +474,10 @@ int nvml_get_pstate(nvml_handle *nvmlh, int cudaindex, int *pstate)
@ -461,7 +493,7 @@ int nvml_get_busid(nvml_handle *nvmlh, int cudaindex, int *busid)
@@ -461,7 +493,7 @@ int nvml_get_busid(nvml_handle *nvmlh, int cudaindex, int *busid)
@ -474,13 +506,17 @@ int nvml_get_serial(nvml_handle *nvmlh, int cudaindex, char *sn, int maxlen)
@@ -474,13 +506,17 @@ int nvml_get_serial(nvml_handle *nvmlh, int cudaindex, char *sn, int maxlen)
// use a part of uuid to generate an unique serial
// todo: check if there is vendor id is inside
@ -501,7 +537,10 @@ int nvml_get_bios(nvml_handle *nvmlh, int cudaindex, char *desc, int maxlen)
@@ -501,7 +537,10 @@ int nvml_get_bios(nvml_handle *nvmlh, int cudaindex, char *desc, int maxlen)
@ -561,7 +600,7 @@ int nvapi_temperature(unsigned int devNum, unsigned int *temperature)
@@ -561,7 +600,7 @@ int nvapi_temperature(unsigned int devNum, unsigned int *temperature)
NvAPI_Statusret;
if(devNum>=nvapi_dev_cnt)
return-1;
return-ENODEV;
NV_GPU_THERMAL_SETTINGSthermal;
thermal.version=NV_GPU_THERMAL_SETTINGS_VER;
@ -584,7 +623,7 @@ int nvapi_fanspeed(unsigned int devNum, unsigned int *speed)
@@ -584,7 +623,7 @@ int nvapi_fanspeed(unsigned int devNum, unsigned int *speed)
@ -606,7 +645,7 @@ int nvapi_getpstate(unsigned int devNum, unsigned int *power)
@@ -606,7 +645,7 @@ int nvapi_getpstate(unsigned int devNum, unsigned int *power)
@ -631,7 +670,7 @@ int nvapi_getusage(unsigned int devNum, unsigned int *pct)
@@ -631,7 +670,7 @@ int nvapi_getusage(unsigned int devNum, unsigned int *pct)
NvAPI_Statusret;
if(devNum>=nvapi_dev_cnt)
return-1;
return-ENODEV;
NV_GPU_DYNAMIC_PSTATES_INFO_EXinfo;
info.version=NV_GPU_DYNAMIC_PSTATES_INFO_EX_VER;
@ -657,7 +696,7 @@ int nvapi_getinfo(unsigned int devNum, uint16_t &vid, uint16_t &pid)
@@ -657,7 +696,7 @@ int nvapi_getinfo(unsigned int devNum, uint16_t &vid, uint16_t &pid)
@ -678,7 +717,7 @@ int nvapi_getserial(unsigned int devNum, char *serial, unsigned int maxlen)
@@ -678,7 +717,7 @@ int nvapi_getserial(unsigned int devNum, char *serial, unsigned int maxlen)
{
// NvAPI_Status ret;
if(devNum>=nvapi_dev_cnt)
return-1;
return-ENODEV;
sprintf(serial,"");
@ -702,7 +741,7 @@ int nvapi_getbios(unsigned int devNum, char *desc, unsigned int maxlen)
@@ -702,7 +741,7 @@ int nvapi_getbios(unsigned int devNum, char *desc, unsigned int maxlen)
{
NvAPI_Statusret;
if(devNum>=nvapi_dev_cnt)
return-1;
return-ENODEV;
if(maxlen<64)// Short String
return-1;
@ -899,6 +938,7 @@ static int translate_vendor_id(uint16_t vid, char *vendorname)
@@ -899,6 +938,7 @@ static int translate_vendor_id(uint16_t vid, char *vendorname)
// { 0x10DE, "NVIDIA" },
{0x1458,"Gigabyte"},
{0x1462,"MSI"},
{0x19DA,"Zotac"},
{0x3842,"EVGA"},
{0,""}
};
@ -919,7 +959,6 @@ static int translate_vendor_id(uint16_t vid, char *vendorname)
@@ -919,7 +959,6 @@ static int translate_vendor_id(uint16_t vid, char *vendorname)