* temperature
*/
-/*
if (data.gpu_temp_disable == 0)
{
fprintf (out, "TEMP\t");
hc_thread_mutex_unlock (mux_adl);
}
-*/
#ifdef _WIN
fputc ('\r', out);
}
}
-/*
if (data.gpu_temp_disable == 0)
{
hc_thread_mutex_lock (mux_adl);
{
const int temperature = hm_get_temperature_with_device_id (i);
const int utilization = hm_get_utilization_with_device_id (i);
- const int fanspeed = hm_get_fanspeed_with_device_id (i);
+ const int fanspeed = hm_get_fanspeed_with_device_id (i);
- if (vendor_id == VENDOR_ID_AMD)
+ if (data.vendor_id == VENDOR_ID_AMD)
{
log_info ("HWMon.GPU.#%d...: %2d%% Util, %2dc Temp, %2d%% Fan", i + 1, utilization, temperature, fanspeed);
}
- if (vendor_id == VENDOR_ID_NV)
+ if (data.vendor_id == VENDOR_ID_NV)
{
#ifdef LINUX
log_info ("HWMon.GPU.#%d...: %2d%% Util, %2dc Temp, %2d%% Fan", i + 1, utilization, temperature, fanspeed);
hc_thread_mutex_unlock (mux_adl);
}
-*/
}
static void status_benchmark ()
uint remove_left = data.remove_timer;
uint status_left = data.status_timer;
+ // these variables are mainly used for fan control (AMD only)
+
int *fan_speed_chgd = (int *) mycalloc (data.devices_cnt, sizeof (int));
// temperature controller "loopback" values
uint sleep_time = 1;
if (data.runtime)
+ {
runtime_check = 1;
+ }
if (data.restore_timer)
+ {
restore_check = 1;
+ }
if ((data.remove == 1) && (data.hashlist_mode == HL_MODE_FILE))
+ {
remove_check = 1;
+ }
if (data.status == 1)
+ {
status_check = 1;
+ }
if (data.gpu_temp_disable == 0)
{
if (data.devices_status != STATUS_RUNNING) continue;
- /*
if (hwmon_check == 1)
{
hc_thread_mutex_lock (mux_adl);
const int gpu_temp_retain = data.gpu_temp_retain;
- if (gpu_temp_retain)
+ if (gpu_temp_retain) // VENDOR_ID_AMD implied
{
if (data.hm_device[i].fan_supported == 1)
{
if ((freely_change_fan_speed == 1) || (fan_speed_must_change == 1))
{
- hm_set_fanspeed_with_device_id (i, fan_speed_new);
+ hm_set_fanspeed_with_device_id_amd (i, fan_speed_new);
fan_speed_chgd[i] = 1;
}
hc_thread_mutex_unlock (mux_adl);
}
- */
if (restore_check == 1)
{
}
/**
- * main
+ * some further helper function
*/
-// temp ?
+// wrapper around mymalloc for ADL
+
void *__stdcall ADL_Main_Memory_Alloc (const int iSize)
{
return mymalloc (iSize);
return collisions;
}
+/**
+ * main
+ */
+
int main (int argc, char **argv)
{
/**
else if (strcmp (CL_platform_vendor, CL_VENDOR_NV) == 0)
{
vendor_id = VENDOR_ID_NV;
+
+ // make sure that we do not directly control the fan for NVidia
+
+ gpu_temp_retain = 0;
+ data.gpu_temp_retain = gpu_temp_retain;
}
else
{
vendor_id = VENDOR_ID_UNKNOWN;
}
+ if (vendor_id == VENDOR_ID_UNKNOWN)
+ {
+ log_error ("Warning: unknown OpenCL vendor '%s' detected", CL_platform_vendor);
+
+ gpu_temp_disable = 1;
+ }
+
data.vendor_id = vendor_id;
/**
memset (hm_adapter_all, 0, sizeof (hm_adapter_all));
- /*
if (gpu_temp_disable == 0)
{
if (vendor_id == VENDOR_ID_NV)
#ifdef LINUX
if (hc_NVML_nvmlInit () == NVML_SUCCESS)
{
- HM_ADAPTER nvGPUHandle[DEVICES_MAX];
+ HM_ADAPTER_NV nvGPUHandle[DEVICES_MAX];
- int tmp_in = hm_get_adapter_index (nvGPUHandle);
+ int tmp_in = hm_get_adapter_index_nv (nvGPUHandle);
int tmp_out = 0;
for (int i = 0; i < tmp_in; i++)
{
- hm_adapter_all[tmp_out++].adapter_index = nvGPUHandle[i];
+ hm_adapter_all[tmp_out++].adapter_index.nv = nvGPUHandle[i];
}
hm_adapters_all = tmp_out;
{
unsigned int speed;
- if (nvmlDeviceGetFanSpeed (hm_adapter_all[i].adapter_index, &speed) != NVML_ERROR_NOT_SUPPORTED) hm_adapter_all[i].fan_supported = 1;
+ if (nvmlDeviceGetFanSpeed (hm_adapter_all[i].adapter_index.nv, &speed) != NVML_ERROR_NOT_SUPPORTED) hm_adapter_all[i].fan_supported = 1;
}
}
#endif
#ifdef WIN
if (NvAPI_Initialize () == NVAPI_OK)
{
- HM_ADAPTER nvGPUHandle[DEVICES_MAX];
+ HM_ADAPTER_NV nvGPUHandle[DEVICES_MAX];
- int tmp_in = hm_get_adapter_index (nvGPUHandle);
+ int tmp_in = hm_get_adapter_index_nv (nvGPUHandle);
int tmp_out = 0;
for (int i = 0; i < tmp_in; i++)
{
- hm_adapter_all[tmp_out++].adapter_index = nvGPUHandle[i];
+ hm_adapter_all[tmp_out++].adapter_index.nv = nvGPUHandle[i];
}
hm_adapters_all = tmp_out;
{
NvU32 speed;
- if (NvAPI_GPU_GetTachReading (hm_adapter_all[i].adapter_index, &speed) != NVAPI_NOT_SUPPORTED) hm_adapter_all[i].fan_supported = 1;
+ if (NvAPI_GPU_GetTachReading (hm_adapter_all[i].adapter_index.nv, &speed) != NVAPI_NOT_SUPPORTED) hm_adapter_all[i].fan_supported = 1;
}
}
#endif
if (vendor_id == VENDOR_ID_AMD)
{
- HM_LIB hm_dll = hm_init ();
+ HM_LIB hm_dll = hm_init_amd ();
data.hm_dll = hm_dll;
int hm_adapters_num;
- if (get_adapters_num (hm_dll, &hm_adapters_num) != 0) return (-1);
+ if (get_adapters_num_amd (hm_dll, &hm_adapters_num) != 0) return (-1);
// adapter info
- LPAdapterInfo lpAdapterInfo = hm_get_adapter_info (hm_dll, hm_adapters_num);
+ LPAdapterInfo lpAdapterInfo = hm_get_adapter_info_amd (hm_dll, hm_adapters_num);
if (lpAdapterInfo == NULL) return (-1);
// hm_get_opencl_busid_devid (hm_adapter_all, devices_all_cnt, devices_all);
- hm_get_adapter_index (hm_adapter_all, valid_adl_device_list, num_adl_adapters, lpAdapterInfo);
+ hm_get_adapter_index_amd (hm_adapter_all, valid_adl_device_list, num_adl_adapters, lpAdapterInfo);
hm_get_overdrive_version (hm_dll, hm_adapter_all, valid_adl_device_list, num_adl_adapters, lpAdapterInfo);
hm_check_fanspeed_control (hm_dll, hm_adapter_all, valid_adl_device_list, num_adl_adapters, lpAdapterInfo);
gpu_temp_abort = 0;
gpu_temp_retain = 0;
}
- */
/**
* enable custom signal handler(s)
}
/*
- * Temporary fix:
- * with AMD r9 295x cards it seems that we need to set the powertune value just AFTER the ocl init stuff
- * otherwise after hc_clCreateContext () etc, powertune value was set back to "normal" and cards unfortunately
- * were not working @ full speed (setting hc_ADL_Overdrive_PowerControl_Set () here seems to fix the problem)
- * Driver / ADL bug?
- *
-
+ * Temporary fix:
+ * with AMD r9 295x cards it seems that we need to set the powertune value just AFTER the ocl init stuff
+ * otherwise after hc_clCreateContext () etc, powertune value was set back to "normal" and cards unfortunately
+ * were not working @ full speed (setting hc_ADL_Overdrive_PowerControl_Set () here seems to fix the problem)
+ * Driver / ADL bug?
+ */
if (vendor_id == VENDOR_ID_AMD)
{
int ADL_rc = 0;
- if ((ADL_rc = hc_ADL_Overdrive6_PowerControl_Caps (data.hm_dll, data.hm_device[i].adapter_index, &powertune_supported)) != ADL_OK)
+ if ((ADL_rc = hc_ADL_Overdrive6_PowerControl_Caps (data.hm_dll, data.hm_device[i].adapter_index.amd, &powertune_supported)) != ADL_OK)
{
log_error ("ERROR: Failed to get ADL PowerControl Capabilities");
// powertune set
ADLOD6PowerControlInfo powertune = {0, 0, 0, 0, 0};
- if ((ADL_rc = hc_ADL_Overdrive_PowerControlInfo_Get (data.hm_dll, data.hm_device[i].adapter_index, &powertune)) != ADL_OK)
+ if ((ADL_rc = hc_ADL_Overdrive_PowerControlInfo_Get (data.hm_dll, data.hm_device[i].adapter_index.amd, &powertune)) != ADL_OK)
{
log_error ("ERROR: Failed to get current ADL PowerControl settings");
return (-1);
}
- if ((ADL_rc = hc_ADL_Overdrive_PowerControl_Set (data.hm_dll, data.hm_device[i].adapter_index, powertune.iMaxValue)) != ADL_OK)
+ if ((ADL_rc = hc_ADL_Overdrive_PowerControl_Set (data.hm_dll, data.hm_device[i].adapter_index.amd, powertune.iMaxValue)) != ADL_OK)
{
log_error ("ERROR: Failed to set new ADL PowerControl values");
hc_thread_mutex_unlock (mux_adl);
}
}
- */
uint gpu_blocks_all = 0;
int gpu_temp_retain_set = 0;
- /*
if (gpu_temp_disable == 0)
{
- if (gpu_temp_retain != 0)
+ if (gpu_temp_retain != 0) // VENDOR_ID_AMD implied
{
hc_thread_mutex_lock (mux_adl);
uint cur_temp = 0;
uint default_temp = 0;
- int ADL_rc = hc_ADL_Overdrive6_TargetTemperatureData_Get (data.hm_dll, data.hm_device[device_id].adapter_index, (int *) &cur_temp, (int *) &default_temp);
+ int ADL_rc = hc_ADL_Overdrive6_TargetTemperatureData_Get (data.hm_dll, data.hm_device[device_id].adapter_index.amd, (int *) &cur_temp, (int *) &default_temp);
if (ADL_rc == ADL_OK)
{
hc_thread_mutex_unlock (mux_adl);
}
}
- */
/**
* Store original powercontrol/clocks settings, set overdrive 6 performance tuning settings
*/
- /*
- if (powertune_enable == 1)
+ if (powertune_enable == 1) // VENDOR_ID_AMD implied
{
hc_thread_mutex_lock (mux_adl);
int powertune_supported = 0;
- if ((ADL_rc = hc_ADL_Overdrive6_PowerControl_Caps (data.hm_dll, data.hm_device[device_id].adapter_index, &powertune_supported)) != ADL_OK)
+ if ((ADL_rc = hc_ADL_Overdrive6_PowerControl_Caps (data.hm_dll, data.hm_device[device_id].adapter_index.amd, &powertune_supported)) != ADL_OK)
{
log_error ("ERROR: Failed to get ADL PowerControl Capabilities");
ADLOD6PowerControlInfo powertune = {0, 0, 0, 0, 0};
- if ((ADL_rc = hc_ADL_Overdrive_PowerControlInfo_Get (data.hm_dll, data.hm_device[device_id].adapter_index, &powertune)) == ADL_OK)
+ if ((ADL_rc = hc_ADL_Overdrive_PowerControlInfo_Get (data.hm_dll, data.hm_device[device_id].adapter_index.amd, &powertune)) == ADL_OK)
{
- ADL_rc = hc_ADL_Overdrive_PowerControl_Get (data.hm_dll, data.hm_device[device_id].adapter_index, &od_power_control_status[device_id]);
+ ADL_rc = hc_ADL_Overdrive_PowerControl_Get (data.hm_dll, data.hm_device[device_id].adapter_index.amd, &od_power_control_status[device_id]);
}
if (ADL_rc != ADL_OK)
return (-1);
}
- if ((ADL_rc = hc_ADL_Overdrive_PowerControl_Set (data.hm_dll, data.hm_device[device_id].adapter_index, powertune.iMaxValue)) != ADL_OK)
+ if ((ADL_rc = hc_ADL_Overdrive_PowerControl_Set (data.hm_dll, data.hm_device[device_id].adapter_index.amd, powertune.iMaxValue)) != ADL_OK)
{
log_error ("ERROR: Failed to set new ADL PowerControl values");
od_clock_mem_status[device_id].state.iNumberOfPerformanceLevels = 2;
- if ((ADL_rc = hc_ADL_Overdrive_StateInfo_Get (data.hm_dll, data.hm_device[device_id].adapter_index, ADL_OD6_GETSTATEINFO_CUSTOM_PERFORMANCE, &od_clock_mem_status[device_id])) != ADL_OK)
+ if ((ADL_rc = hc_ADL_Overdrive_StateInfo_Get (data.hm_dll, data.hm_device[device_id].adapter_index.amd, ADL_OD6_GETSTATEINFO_CUSTOM_PERFORMANCE, &od_clock_mem_status[device_id])) != ADL_OK)
{
log_error ("ERROR: Failed to get ADL memory and engine clock frequency");
ADLOD6Capabilities caps = {0, 0, 0, {0, 0, 0}, {0, 0, 0}, 0, 0};
- if ((ADL_rc = hc_ADL_Overdrive_Capabilities_Get (data.hm_dll, data.hm_device[device_id].adapter_index, &caps)) != ADL_OK)
+ if ((ADL_rc = hc_ADL_Overdrive_Capabilities_Get (data.hm_dll, data.hm_device[device_id].adapter_index.amd, &caps)) != ADL_OK)
{
log_error ("ERROR: Failed to get ADL device capabilities");
performance_state->aLevels[0].iMemoryClock = memory_clock_profile_max;
performance_state->aLevels[1].iMemoryClock = memory_clock_profile_max;
- if ((ADL_rc = hc_ADL_Overdrive_State_Set (data.hm_dll, data.hm_device[device_id].adapter_index, ADL_OD6_SETSTATE_PERFORMANCE, performance_state)) != ADL_OK)
+ if ((ADL_rc = hc_ADL_Overdrive_State_Set (data.hm_dll, data.hm_device[device_id].adapter_index.amd, ADL_OD6_SETSTATE_PERFORMANCE, performance_state)) != ADL_OK)
{
log_info ("ERROR: Failed to set ADL performance state");
hc_thread_mutex_unlock (mux_adl);
}
- */
}
data.gpu_blocks_all = gpu_blocks_all;
// reset default fan speed
-/*
if (gpu_temp_disable == 0)
{
- if (gpu_temp_retain != 0)
+ if (gpu_temp_retain != 0) // VENDOR_ID_AMD is implied here
{
hc_thread_mutex_lock (mux_adl);
if (fanspeed == -1) continue;
- int rc = hm_set_fanspeed_with_device_id (i, fanspeed);
+ int rc = hm_set_fanspeed_with_device_id_amd (i, fanspeed);
if (rc == -1) log_info ("WARNING: Failed to restore default fan speed for gpu number: %i:", i);
}
// reset power tuning
- if (powertune_enable == 1)
+ if (powertune_enable == 1) // VENDOR_ID_AMD is implied here
{
hc_thread_mutex_lock (mux_adl);
int powertune_supported = 0;
- if ((hc_ADL_Overdrive6_PowerControl_Caps (data.hm_dll, data.hm_device[i].adapter_index, &powertune_supported)) != ADL_OK)
+ if ((hc_ADL_Overdrive6_PowerControl_Caps (data.hm_dll, data.hm_device[i].adapter_index.amd, &powertune_supported)) != ADL_OK)
{
log_error ("ERROR: Failed to get ADL PowerControl Capabilities");
{
// powercontrol settings
- if ((hc_ADL_Overdrive_PowerControl_Set (data.hm_dll, data.hm_device[i].adapter_index, od_power_control_status[i])) != ADL_OK)
+ if ((hc_ADL_Overdrive_PowerControl_Set (data.hm_dll, data.hm_device[i].adapter_index.amd, od_power_control_status[i])) != ADL_OK)
{
log_info ("ERROR: Failed to restore the ADL PowerControl values");
performance_state->aLevels[0].iMemoryClock = od_clock_mem_status[i].state.aLevels[0].iMemoryClock;
performance_state->aLevels[1].iMemoryClock = od_clock_mem_status[i].state.aLevels[1].iMemoryClock;
- if ((hc_ADL_Overdrive_State_Set (data.hm_dll, data.hm_device[i].adapter_index, ADL_OD6_SETSTATE_PERFORMANCE, performance_state)) != ADL_OK)
+ if ((hc_ADL_Overdrive_State_Set (data.hm_dll, data.hm_device[i].adapter_index.amd, ADL_OD6_SETSTATE_PERFORMANCE, performance_state)) != ADL_OK)
{
log_info ("ERROR: Failed to restore ADL performance state");
{
hc_ADL_Main_Control_Destroy (data.hm_dll);
- hm_close (data.hm_dll);
+ hm_close_amd (data.hm_dll);
}
}
-*/
// free memory
* thermal
*/
-/*
#ifdef _WIN
-int hm_get_adapter_index (HM_ADAPTER nvGPUHandle[DEVICES_MAX])
+int hm_get_adapter_index_nv (HM_ADAPTER_NV nvGPUHandle[DEVICES_MAX])
{
NvU32 pGpuCount;
#endif
#ifdef LINUX
-int hm_get_adapter_index (HM_ADAPTER nvGPUHandle[DEVICES_MAX])
+int hm_get_adapter_index_nv (HM_ADAPTER_NV nvGPUHandle[DEVICES_MAX])
{
int pGpuCount = 0;
}
#endif
-void hm_close (HM_LIB hm_dll)
+void hm_close_amd (HM_LIB hm_dll)
{
#ifdef _POSIX
dlclose (hm_dll);
#endif
}
-HM_LIB hm_init ()
+HM_LIB hm_init_amd ()
{
#ifdef _POSIX
HM_LIB hm_dll = dlopen ("libatiadlxx.so", RTLD_LAZY | RTLD_GLOBAL);
return hm_dll;
}
-int get_adapters_num (HM_LIB hm_dll, int *iNumberAdapters)
+int get_adapters_num_amd (HM_LIB hm_dll, int *iNumberAdapters)
{
if (hc_ADL_Adapter_NumberOfAdapters_Get (hm_dll, iNumberAdapters) != ADL_OK) return -1;
return 0;
}
+/*
int hm_show_performance_level (HM_LIB hm_dll, int iAdapterIndex)
{
ADLODPerformanceLevels *lpOdPerformanceLevels = NULL;
return 0;
}
+*/
-LPAdapterInfo hm_get_adapter_info (HM_LIB hm_dll, int iNumberAdapters)
+LPAdapterInfo hm_get_adapter_info_amd (HM_LIB hm_dll, int iNumberAdapters)
{
size_t AdapterInfoSize = iNumberAdapters * sizeof (AdapterInfo);
return lpAdapterInfo;
}
+/*
//
// does not help at all, since AMD does not assign different bus id, device id when we have multi GPU setups
//
hm_device[i].devid = device_topology.pcie.device;
}
}
+*/
void hm_sort_adl_adapters_by_busid_devid (uint32_t *valid_adl_device_list, int num_adl_adapters, LPAdapterInfo lpAdapterInfo)
{
return 0;
}
-int hm_get_adapter_index (hm_attrs_t *hm_device, uint32_t *valid_adl_device_list, int num_adl_adapters, LPAdapterInfo lpAdapterInfo)
+int hm_get_adapter_index_amd (hm_attrs_t *hm_device, uint32_t *valid_adl_device_list, int num_adl_adapters, LPAdapterInfo lpAdapterInfo)
{
for (int i = 0; i < num_adl_adapters; i++)
{
int opencl_device_index = i;
- hm_device[opencl_device_index].adapter_index = info.iAdapterIndex;
+ hm_device[opencl_device_index].adapter_index.amd = info.iAdapterIndex;
}
return num_adl_adapters;
Temperature.iSize = sizeof (ADLTemperature);
- if (hc_ADL_Overdrive5_Temperature_Get (data.hm_dll, data.hm_device[device_id].adapter_index, 0, &Temperature) != ADL_OK) return -1;
+ if (hc_ADL_Overdrive5_Temperature_Get (data.hm_dll, data.hm_device[device_id].adapter_index.amd, 0, &Temperature) != ADL_OK) return -1;
return Temperature.iTemperature / 1000;
}
{
int Temperature = 0;
- if (hc_ADL_Overdrive6_Temperature_Get (data.hm_dll, data.hm_device[device_id].adapter_index, &Temperature) != ADL_OK) return -1;
+ if (hc_ADL_Overdrive6_Temperature_Get (data.hm_dll, data.hm_device[device_id].adapter_index.amd, &Temperature) != ADL_OK) return -1;
return Temperature / 1000;
}
#ifdef LINUX
int temperature = 0;
- hc_NVML_nvmlDeviceGetTemperature (data.hm_device[device_id].adapter_index, NVML_TEMPERATURE_GPU, (unsigned int *) &temperature);
+ hc_NVML_nvmlDeviceGetTemperature (data.hm_device[device_id].adapter_index.nv, NVML_TEMPERATURE_GPU, (unsigned int *) &temperature);
return temperature;
#endif
pThermalSettings.sensor[0].controller = NVAPI_THERMAL_CONTROLLER_UNKNOWN;
pThermalSettings.sensor[0].target = NVAPI_THERMAL_TARGET_GPU;
- if (hc_NvAPI_GPU_GetThermalSettings (data.hm_device[device_id].adapter_index, 0, &pThermalSettings) != NVAPI_OK) return -1;
+ if (hc_NvAPI_GPU_GetThermalSettings (data.hm_device[device_id].adapter_index.nv, 0, &pThermalSettings) != NVAPI_OK) return -1;
return pThermalSettings.sensor[0].currentTemp;
#endif
lpFanSpeedValue.iSpeedType = ADL_DL_FANCTRL_SPEED_TYPE_PERCENT;
lpFanSpeedValue.iFlags = ADL_DL_FANCTRL_FLAG_USER_DEFINED_SPEED;
- if (hc_ADL_Overdrive5_FanSpeed_Get (data.hm_dll, data.hm_device[device_id].adapter_index, 0, &lpFanSpeedValue) != ADL_OK) return -1;
+ if (hc_ADL_Overdrive5_FanSpeed_Get (data.hm_dll, data.hm_device[device_id].adapter_index.amd, 0, &lpFanSpeedValue) != ADL_OK) return -1;
return lpFanSpeedValue.iFanSpeed;
}
memset (&faninfo, 0, sizeof (faninfo));
- if (hc_ADL_Overdrive6_FanSpeed_Get (data.hm_dll, data.hm_device[device_id].adapter_index, &faninfo) != ADL_OK) return -1;
+ if (hc_ADL_Overdrive6_FanSpeed_Get (data.hm_dll, data.hm_device[device_id].adapter_index.amd, &faninfo) != ADL_OK) return -1;
return faninfo.iFanSpeedPercent;
}
#ifdef LINUX
int speed = 0;
- hc_NVML_nvmlDeviceGetFanSpeed (data.hm_device[device_id].adapter_index, (unsigned int *) &speed);
+ hc_NVML_nvmlDeviceGetFanSpeed (data.hm_device[device_id].adapter_index.nv, (unsigned int *) &speed);
return speed;
#endif
#ifdef WIN
NvU32 speed = 0;
- hc_NvAPI_GPU_GetTachReading (data.hm_device[device_id].adapter_index, &speed);
+ hc_NvAPI_GPU_GetTachReading (data.hm_device[device_id].adapter_index.nv, &speed);
return speed;
#endif
PMActivity.iSize = sizeof (ADLPMActivity);
- if (hc_ADL_Overdrive_CurrentActivity_Get (data.hm_dll, data.hm_device[device_id].adapter_index, &PMActivity) != ADL_OK) return -1;
+ if (hc_ADL_Overdrive_CurrentActivity_Get (data.hm_dll, data.hm_device[device_id].adapter_index.amd, &PMActivity) != ADL_OK) return -1;
return PMActivity.iActivityPercent;
}
}
- if (data.vendor_id == VENDOR_ID_AMD)
+ if (data.vendor_id == VENDOR_ID_NV)
{
#ifdef LINUX
nvmlUtilization_t utilization;
- hc_NVML_nvmlDeviceGetUtilizationRates (data.hm_device[device_id].adapter_index, &utilization);
+ hc_NVML_nvmlDeviceGetUtilizationRates (data.hm_device[device_id].adapter_index.nv, &utilization);
return utilization.gpu;
#endif
pDynamicPstatesInfoEx.version = NV_GPU_DYNAMIC_PSTATES_INFO_EX_VER;
- if (hc_NvAPI_GPU_GetDynamicPstatesInfoEx (data.hm_device[device_id].adapter_index, &pDynamicPstatesInfoEx) != NVAPI_OK) return -1;
+ if (hc_NvAPI_GPU_GetDynamicPstatesInfoEx (data.hm_device[device_id].adapter_index.nv, &pDynamicPstatesInfoEx) != NVAPI_OK) return -1;
return pDynamicPstatesInfoEx.utilization[0].percentage;
#endif
return -1;
}
-int hm_set_fanspeed_with_device_id (const uint device_id, const int fanspeed)
+int hm_set_fanspeed_with_device_id_amd (const uint device_id, const int fanspeed)
{
if (data.hm_device[device_id].fan_supported == 1)
{
lpFanSpeedValue.iFlags = ADL_DL_FANCTRL_FLAG_USER_DEFINED_SPEED;
lpFanSpeedValue.iFanSpeed = fanspeed;
- if (hc_ADL_Overdrive5_FanSpeed_Set (data.hm_dll, data.hm_device[device_id].adapter_index, 0, &lpFanSpeedValue) != ADL_OK) return -1;
+ if (hc_ADL_Overdrive5_FanSpeed_Set (data.hm_dll, data.hm_device[device_id].adapter_index.amd, 0, &lpFanSpeedValue) != ADL_OK) return -1;
return 0;
}
fan_speed_value.iSpeedType = ADL_OD6_FANSPEED_TYPE_PERCENT;
fan_speed_value.iFanSpeed = fanspeed;
- if (hc_ADL_Overdrive6_FanSpeed_Set (data.hm_dll, data.hm_device[device_id].adapter_index, &fan_speed_value) != ADL_OK) return -1;
+ if (hc_ADL_Overdrive6_FanSpeed_Set (data.hm_dll, data.hm_device[device_id].adapter_index.amd, &fan_speed_value) != ADL_OK) return -1;
return 0;
}
return -1;
}
-*/
/**
* maskprocessor