mirror of
https://github.com/hashcat/hashcat.git
synced 2025-01-03 12:21:07 +00:00
Set fanspeed to automatic on shutdown
Increase retain temperature from 65c to 75c; Because GTX1080 hits its reference boost clocks of 1733mhz at 80c
This commit is contained in:
parent
78c1d45b09
commit
49811cfee1
@ -306,6 +306,7 @@ typedef int (ADL_API_CALL *ADL_OVERDRIVE6_STATE_SET) (int, int, ADLOD6StateInfo
|
|||||||
typedef int (ADL_API_CALL *ADL_OVERDRIVE6_POWERCONTROL_CAPS) (int, int *);
|
typedef int (ADL_API_CALL *ADL_OVERDRIVE6_POWERCONTROL_CAPS) (int, int *);
|
||||||
typedef int (ADL_API_CALL *ADL_OVERDRIVE6_TARGETTEMPERATUREDATA_GET) (int, int *, int *);
|
typedef int (ADL_API_CALL *ADL_OVERDRIVE6_TARGETTEMPERATUREDATA_GET) (int, int *, int *);
|
||||||
typedef int (ADL_API_CALL *ADL_OVERDRIVE6_TARGETTEMPERATURERANGEINFO_GET) (int, ADLOD6ParameterRange *);
|
typedef int (ADL_API_CALL *ADL_OVERDRIVE6_TARGETTEMPERATURERANGEINFO_GET) (int, ADLOD6ParameterRange *);
|
||||||
|
typedef int (ADL_API_CALL *ADL_OVERDRIVE6_FANSPEED_RESET) (int);
|
||||||
|
|
||||||
typedef struct
|
typedef struct
|
||||||
{
|
{
|
||||||
@ -344,6 +345,7 @@ typedef struct
|
|||||||
ADL_OVERDRIVE6_STATE_SET ADL_Overdrive6_State_Set;
|
ADL_OVERDRIVE6_STATE_SET ADL_Overdrive6_State_Set;
|
||||||
ADL_OVERDRIVE6_TARGETTEMPERATUREDATA_GET ADL_Overdrive6_TargetTemperatureData_Get;
|
ADL_OVERDRIVE6_TARGETTEMPERATUREDATA_GET ADL_Overdrive6_TargetTemperatureData_Get;
|
||||||
ADL_OVERDRIVE6_TARGETTEMPERATURERANGEINFO_GET ADL_Overdrive6_TargetTemperatureRangeInfo_Get;
|
ADL_OVERDRIVE6_TARGETTEMPERATURERANGEINFO_GET ADL_Overdrive6_TargetTemperatureRangeInfo_Get;
|
||||||
|
ADL_OVERDRIVE6_FANSPEED_RESET ADL_Overdrive6_FanSpeed_Reset;
|
||||||
|
|
||||||
} hm_adl_lib_t;
|
} hm_adl_lib_t;
|
||||||
|
|
||||||
@ -385,6 +387,7 @@ int hm_ADL_Overdrive_State_Set (ADL_PTR *adl, int iAdapterIndex, int type, ADLOD
|
|||||||
int hm_ADL_Overdrive6_PowerControl_Caps (ADL_PTR *adl, int iAdapterIndex, int *lpSupported);
|
int hm_ADL_Overdrive6_PowerControl_Caps (ADL_PTR *adl, int iAdapterIndex, int *lpSupported);
|
||||||
int hm_ADL_Overdrive6_TargetTemperatureData_Get (ADL_PTR *adl, int iAdapterIndex, int *cur_temp, int *default_temp);
|
int hm_ADL_Overdrive6_TargetTemperatureData_Get (ADL_PTR *adl, int iAdapterIndex, int *cur_temp, int *default_temp);
|
||||||
int hm_ADL_Overdrive6_TargetTemperatureRangeInfo_Get (ADL_PTR *adl, int iAdapterIndex, ADLOD6ParameterRange *lpTargetTemperatureInfo);
|
int hm_ADL_Overdrive6_TargetTemperatureRangeInfo_Get (ADL_PTR *adl, int iAdapterIndex, ADLOD6ParameterRange *lpTargetTemperatureInfo);
|
||||||
|
int hm_ADL_Overdrive6_FanSpeed_Reset (ADL_PTR *adl, int iAdapterIndex);
|
||||||
|
|
||||||
#endif // HAVE_HWMON
|
#endif // HAVE_HWMON
|
||||||
|
|
||||||
|
@ -63,6 +63,7 @@ int adl_init (ADL_PTR *adl)
|
|||||||
HC_LOAD_FUNC(adl, ADL_Overdrive6_State_Set, ADL_OVERDRIVE6_STATE_SET, ADL, 0)
|
HC_LOAD_FUNC(adl, ADL_Overdrive6_State_Set, ADL_OVERDRIVE6_STATE_SET, ADL, 0)
|
||||||
HC_LOAD_FUNC(adl, ADL_Overdrive6_TargetTemperatureData_Get, ADL_OVERDRIVE6_TARGETTEMPERATUREDATA_GET, ADL, 0)
|
HC_LOAD_FUNC(adl, ADL_Overdrive6_TargetTemperatureData_Get, ADL_OVERDRIVE6_TARGETTEMPERATUREDATA_GET, ADL, 0)
|
||||||
HC_LOAD_FUNC(adl, ADL_Overdrive6_TargetTemperatureRangeInfo_Get, ADL_OVERDRIVE6_TARGETTEMPERATURERANGEINFO_GET, ADL, 0)
|
HC_LOAD_FUNC(adl, ADL_Overdrive6_TargetTemperatureRangeInfo_Get, ADL_OVERDRIVE6_TARGETTEMPERATURERANGEINFO_GET, ADL, 0)
|
||||||
|
HC_LOAD_FUNC(adl, ADL_Overdrive6_FanSpeed_Reset, ADL_OVERDRIVE6_FANSPEED_RESET, ADL, 0)
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@ -594,3 +595,12 @@ int hm_ADL_Overdrive6_TargetTemperatureRangeInfo_Get (ADL_PTR *adl, int iAdapter
|
|||||||
|
|
||||||
return (ADL_rc);
|
return (ADL_rc);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int hm_ADL_Overdrive6_FanSpeed_Reset (ADL_PTR *adl, int iAdapterIndex)
|
||||||
|
{
|
||||||
|
if (!adl) return (-1);
|
||||||
|
|
||||||
|
int ADL_rc = adl->ADL_Overdrive6_FanSpeed_Reset (iAdapterIndex);
|
||||||
|
|
||||||
|
return (ADL_rc);
|
||||||
|
}
|
||||||
|
@ -78,7 +78,7 @@ double TARGET_MS_PROFILE[4] = { 2, 12, 96, 480 };
|
|||||||
#define NVIDIA_SPIN_DAMP 100
|
#define NVIDIA_SPIN_DAMP 100
|
||||||
#define GPU_TEMP_DISABLE 0
|
#define GPU_TEMP_DISABLE 0
|
||||||
#define GPU_TEMP_ABORT 90
|
#define GPU_TEMP_ABORT 90
|
||||||
#define GPU_TEMP_RETAIN 65
|
#define GPU_TEMP_RETAIN 75
|
||||||
#define WORKLOAD_PROFILE 2
|
#define WORKLOAD_PROFILE 2
|
||||||
#define KERNEL_ACCEL 0
|
#define KERNEL_ACCEL 0
|
||||||
#define KERNEL_LOOPS 0
|
#define KERNEL_LOOPS 0
|
||||||
@ -14657,9 +14657,6 @@ int main (int argc, char **argv)
|
|||||||
* OpenCL devices: allocate buffer for device specific information
|
* OpenCL devices: allocate buffer for device specific information
|
||||||
*/
|
*/
|
||||||
|
|
||||||
int *temp_retain_fanspeed_value = (int *) mycalloc (data.devices_cnt, sizeof (int));
|
|
||||||
int *temp_retain_fanpolicy_value = (int *) mycalloc (data.devices_cnt, sizeof (int));
|
|
||||||
|
|
||||||
ADLOD6MemClockState *od_clock_mem_status = (ADLOD6MemClockState *) mycalloc (data.devices_cnt, sizeof (ADLOD6MemClockState));
|
ADLOD6MemClockState *od_clock_mem_status = (ADLOD6MemClockState *) mycalloc (data.devices_cnt, sizeof (ADLOD6MemClockState));
|
||||||
|
|
||||||
int *od_power_control_status = (int *) mycalloc (data.devices_cnt, sizeof (int));
|
int *od_power_control_status = (int *) mycalloc (data.devices_cnt, sizeof (int));
|
||||||
@ -16323,9 +16320,6 @@ int main (int argc, char **argv)
|
|||||||
const int fanspeed = hm_get_fanspeed_with_device_id (device_id);
|
const int fanspeed = hm_get_fanspeed_with_device_id (device_id);
|
||||||
const int fanpolicy = hm_get_fanpolicy_with_device_id (device_id);
|
const int fanpolicy = hm_get_fanpolicy_with_device_id (device_id);
|
||||||
|
|
||||||
temp_retain_fanspeed_value[device_id] = fanspeed;
|
|
||||||
temp_retain_fanpolicy_value[device_id] = fanpolicy;
|
|
||||||
|
|
||||||
// we also set it to tell the OS we take control over the fan and it's automatic controller
|
// we also set it to tell the OS we take control over the fan and it's automatic controller
|
||||||
// if it was set to automatic. we do not control user-defined fanspeeds.
|
// if it was set to automatic. we do not control user-defined fanspeeds.
|
||||||
|
|
||||||
@ -18453,30 +18447,24 @@ int main (int argc, char **argv)
|
|||||||
|
|
||||||
if (data.hm_device[device_id].fan_set_supported == 1)
|
if (data.hm_device[device_id].fan_set_supported == 1)
|
||||||
{
|
{
|
||||||
int fanspeed = temp_retain_fanspeed_value[device_id];
|
int rc = -1;
|
||||||
int fanpolicy = temp_retain_fanpolicy_value[device_id];
|
|
||||||
|
|
||||||
if (fanpolicy == 1)
|
if (device_param->device_vendor_id == VENDOR_ID_AMD)
|
||||||
{
|
{
|
||||||
int rc = -1;
|
rc = hm_set_fanspeed_with_device_id_adl (device_id, 100, 0);
|
||||||
|
|
||||||
if (device_param->device_vendor_id == VENDOR_ID_AMD)
|
|
||||||
{
|
|
||||||
rc = hm_set_fanspeed_with_device_id_adl (device_id, fanspeed, 0);
|
|
||||||
}
|
|
||||||
else if (device_param->device_vendor_id == VENDOR_ID_NV)
|
|
||||||
{
|
|
||||||
#ifdef LINUX
|
|
||||||
rc = set_fan_control (data.hm_xnvctrl, data.hm_device[device_id].xnvctrl, NV_CTRL_GPU_COOLER_MANUAL_CONTROL_FALSE);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef WIN
|
|
||||||
rc = hm_set_fanspeed_with_device_id_nvapi (device_id, fanspeed, fanpolicy);
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
|
|
||||||
if (rc == -1) log_info ("WARNING: Failed to restore default fan speed and policy for device #%", device_id + 1);
|
|
||||||
}
|
}
|
||||||
|
else if (device_param->device_vendor_id == VENDOR_ID_NV)
|
||||||
|
{
|
||||||
|
#ifdef LINUX
|
||||||
|
rc = set_fan_control (data.hm_xnvctrl, data.hm_device[device_id].xnvctrl, NV_CTRL_GPU_COOLER_MANUAL_CONTROL_FALSE);
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef WIN
|
||||||
|
rc = hm_set_fanspeed_with_device_id_nvapi (device_id, 100, 8);
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
if (rc == -1) log_info ("WARNING: Failed to restore default fan speed and policy for device #%", device_id + 1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -18637,7 +18625,6 @@ int main (int argc, char **argv)
|
|||||||
local_free (bitmap_s2_d);
|
local_free (bitmap_s2_d);
|
||||||
|
|
||||||
#ifdef HAVE_HWMON
|
#ifdef HAVE_HWMON
|
||||||
local_free (temp_retain_fanspeed_value);
|
|
||||||
local_free (od_clock_mem_status);
|
local_free (od_clock_mem_status);
|
||||||
local_free (od_power_control_status);
|
local_free (od_power_control_status);
|
||||||
local_free (nvml_power_limit);
|
local_free (nvml_power_limit);
|
||||||
|
54
src/shared.c
54
src/shared.c
@ -3424,33 +3424,51 @@ int hm_set_fanspeed_with_device_id_adl (const uint device_id, const int fanspeed
|
|||||||
{
|
{
|
||||||
if (data.hm_adl)
|
if (data.hm_adl)
|
||||||
{
|
{
|
||||||
if (data.hm_device[device_id].od_version == 5)
|
if (fanpolicy == 1)
|
||||||
{
|
{
|
||||||
ADLFanSpeedValue lpFanSpeedValue;
|
if (data.hm_device[device_id].od_version == 5)
|
||||||
|
{
|
||||||
|
ADLFanSpeedValue lpFanSpeedValue;
|
||||||
|
|
||||||
memset (&lpFanSpeedValue, 0, sizeof (lpFanSpeedValue));
|
memset (&lpFanSpeedValue, 0, sizeof (lpFanSpeedValue));
|
||||||
|
|
||||||
lpFanSpeedValue.iSize = sizeof (lpFanSpeedValue);
|
lpFanSpeedValue.iSize = sizeof (lpFanSpeedValue);
|
||||||
lpFanSpeedValue.iSpeedType = ADL_DL_FANCTRL_SPEED_TYPE_PERCENT;
|
lpFanSpeedValue.iSpeedType = ADL_DL_FANCTRL_SPEED_TYPE_PERCENT;
|
||||||
lpFanSpeedValue.iFlags = (fanpolicy == 1) ? ADL_DL_FANCTRL_FLAG_USER_DEFINED_SPEED : 0;
|
lpFanSpeedValue.iFlags = ADL_DL_FANCTRL_FLAG_USER_DEFINED_SPEED;
|
||||||
lpFanSpeedValue.iFanSpeed = fanspeed;
|
lpFanSpeedValue.iFanSpeed = fanspeed;
|
||||||
|
|
||||||
if (hm_ADL_Overdrive5_FanSpeed_Set (data.hm_adl, data.hm_device[device_id].adl, 0, &lpFanSpeedValue) != ADL_OK) return -1;
|
if (hm_ADL_Overdrive5_FanSpeed_Set (data.hm_adl, data.hm_device[device_id].adl, 0, &lpFanSpeedValue) != ADL_OK) return -1;
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
}
|
||||||
|
else // od_version == 6
|
||||||
|
{
|
||||||
|
ADLOD6FanSpeedValue fan_speed_value;
|
||||||
|
|
||||||
|
memset (&fan_speed_value, 0, sizeof (fan_speed_value));
|
||||||
|
|
||||||
|
fan_speed_value.iSpeedType = ADL_OD6_FANSPEED_TYPE_PERCENT;
|
||||||
|
fan_speed_value.iFanSpeed = fanspeed;
|
||||||
|
|
||||||
|
if (hm_ADL_Overdrive6_FanSpeed_Set (data.hm_adl, data.hm_device[device_id].adl, &fan_speed_value) != ADL_OK) return -1;
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else // od_version == 6
|
else
|
||||||
{
|
{
|
||||||
ADLOD6FanSpeedValue fan_speed_value;
|
if (data.hm_device[device_id].od_version == 5)
|
||||||
|
{
|
||||||
|
if (hm_ADL_Overdrive5_FanSpeedToDefault_Set (data.hm_adl, data.hm_device[device_id].adl, 0) != ADL_OK) return -1;
|
||||||
|
|
||||||
memset (&fan_speed_value, 0, sizeof (fan_speed_value));
|
return 0;
|
||||||
|
}
|
||||||
|
else // od_version == 6
|
||||||
|
{
|
||||||
|
if (hm_ADL_Overdrive6_FanSpeed_Reset (data.hm_adl, data.hm_device[device_id].adl) != ADL_OK) return -1;
|
||||||
|
|
||||||
fan_speed_value.iSpeedType = ADL_OD6_FANSPEED_TYPE_PERCENT;
|
return 0;
|
||||||
fan_speed_value.iFanSpeed = fanspeed;
|
}
|
||||||
|
|
||||||
if (hm_ADL_Overdrive6_FanSpeed_Set (data.hm_adl, data.hm_device[device_id].adl, &fan_speed_value) != ADL_OK) return -1;
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user