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_TARGETTEMPERATUREDATA_GET) (int, int *, int *);
|
||||
typedef int (ADL_API_CALL *ADL_OVERDRIVE6_TARGETTEMPERATURERANGEINFO_GET) (int, ADLOD6ParameterRange *);
|
||||
typedef int (ADL_API_CALL *ADL_OVERDRIVE6_FANSPEED_RESET) (int);
|
||||
|
||||
typedef struct
|
||||
{
|
||||
@ -344,6 +345,7 @@ typedef struct
|
||||
ADL_OVERDRIVE6_STATE_SET ADL_Overdrive6_State_Set;
|
||||
ADL_OVERDRIVE6_TARGETTEMPERATUREDATA_GET ADL_Overdrive6_TargetTemperatureData_Get;
|
||||
ADL_OVERDRIVE6_TARGETTEMPERATURERANGEINFO_GET ADL_Overdrive6_TargetTemperatureRangeInfo_Get;
|
||||
ADL_OVERDRIVE6_FANSPEED_RESET ADL_Overdrive6_FanSpeed_Reset;
|
||||
|
||||
} 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_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_FanSpeed_Reset (ADL_PTR *adl, int iAdapterIndex);
|
||||
|
||||
#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_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_FanSpeed_Reset, ADL_OVERDRIVE6_FANSPEED_RESET, ADL, 0)
|
||||
|
||||
return 0;
|
||||
}
|
||||
@ -594,3 +595,12 @@ int hm_ADL_Overdrive6_TargetTemperatureRangeInfo_Get (ADL_PTR *adl, int iAdapter
|
||||
|
||||
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 GPU_TEMP_DISABLE 0
|
||||
#define GPU_TEMP_ABORT 90
|
||||
#define GPU_TEMP_RETAIN 65
|
||||
#define GPU_TEMP_RETAIN 75
|
||||
#define WORKLOAD_PROFILE 2
|
||||
#define KERNEL_ACCEL 0
|
||||
#define KERNEL_LOOPS 0
|
||||
@ -14657,9 +14657,6 @@ int main (int argc, char **argv)
|
||||
* 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));
|
||||
|
||||
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 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
|
||||
// if it was set to automatic. we do not control user-defined fanspeeds.
|
||||
|
||||
@ -18452,17 +18446,12 @@ int main (int argc, char **argv)
|
||||
if (device_param->skipped) continue;
|
||||
|
||||
if (data.hm_device[device_id].fan_set_supported == 1)
|
||||
{
|
||||
int fanspeed = temp_retain_fanspeed_value[device_id];
|
||||
int fanpolicy = temp_retain_fanpolicy_value[device_id];
|
||||
|
||||
if (fanpolicy == 1)
|
||||
{
|
||||
int rc = -1;
|
||||
|
||||
if (device_param->device_vendor_id == VENDOR_ID_AMD)
|
||||
{
|
||||
rc = hm_set_fanspeed_with_device_id_adl (device_id, fanspeed, 0);
|
||||
rc = hm_set_fanspeed_with_device_id_adl (device_id, 100, 0);
|
||||
}
|
||||
else if (device_param->device_vendor_id == VENDOR_ID_NV)
|
||||
{
|
||||
@ -18471,14 +18460,13 @@ int main (int argc, char **argv)
|
||||
#endif
|
||||
|
||||
#ifdef WIN
|
||||
rc = hm_set_fanspeed_with_device_id_nvapi (device_id, fanspeed, fanpolicy);
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
hc_thread_mutex_unlock (mux_adl);
|
||||
}
|
||||
@ -18637,7 +18625,6 @@ int main (int argc, char **argv)
|
||||
local_free (bitmap_s2_d);
|
||||
|
||||
#ifdef HAVE_HWMON
|
||||
local_free (temp_retain_fanspeed_value);
|
||||
local_free (od_clock_mem_status);
|
||||
local_free (od_power_control_status);
|
||||
local_free (nvml_power_limit);
|
||||
|
20
src/shared.c
20
src/shared.c
@ -3423,6 +3423,8 @@ int hm_set_fanspeed_with_device_id_adl (const uint device_id, const int fanspeed
|
||||
if (data.hm_device[device_id].fan_set_supported == 1)
|
||||
{
|
||||
if (data.hm_adl)
|
||||
{
|
||||
if (fanpolicy == 1)
|
||||
{
|
||||
if (data.hm_device[device_id].od_version == 5)
|
||||
{
|
||||
@ -3432,7 +3434,7 @@ int hm_set_fanspeed_with_device_id_adl (const uint device_id, const int fanspeed
|
||||
|
||||
lpFanSpeedValue.iSize = sizeof (lpFanSpeedValue);
|
||||
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;
|
||||
|
||||
if (hm_ADL_Overdrive5_FanSpeed_Set (data.hm_adl, data.hm_device[device_id].adl, 0, &lpFanSpeedValue) != ADL_OK) return -1;
|
||||
@ -3453,6 +3455,22 @@ int hm_set_fanspeed_with_device_id_adl (const uint device_id, const int fanspeed
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
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;
|
||||
|
||||
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;
|
||||
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return -1;
|
||||
|
Loading…
Reference in New Issue
Block a user