1
0
mirror of https://github.com/hashcat/hashcat.git synced 2024-11-28 02:49:18 +00:00
This commit is contained in:
jsteube 2016-11-22 18:39:14 +01:00
commit 7ea6e1c65b
4 changed files with 19 additions and 3 deletions

View File

@ -41,6 +41,7 @@ static int pthread_setaffinity_np (pthread_t thread, size_t cpu_size, cpu_set_t
#endif
#if defined (__FreeBSD__)
#include <pthread_np.h>
typedef cpuset_t cpu_set_t;
#endif

View File

@ -50,6 +50,8 @@ static int get_exec_path (char *exec_path, const size_t exec_path_sz)
#elif defined (__FreeBSD__)
#include <sys/sysctl.h>
int mib[4];
mib[0] = CTL_KERN;

View File

@ -1358,7 +1358,14 @@ static int hm_XNVCTRL_get_fan_control (hashcat_ctx_t *hashcat_ctx, const int gpu
if (rc == false)
{
event_log_error (hashcat_ctx, "XNVCTRLQueryTargetAttribute(NV_CTRL_GPU_COOLER_MANUAL_CONTROL) failed");
event_log_error (hashcat_ctx, "XNVCTRLQueryTargetAttribute() failed");
// help the user to fix the problem
event_log_warning (hashcat_ctx, "This error typically occurs when you did not setup NVidia Coolbits.");
event_log_warning (hashcat_ctx, "Run the following command to fix: sudo nvidia-xconfig --cool-bits=12");
event_log_warning (hashcat_ctx, "Do not forget to restart X afterwards.");
event_log_warning (hashcat_ctx, "");
return -1;
}
@ -2837,6 +2844,7 @@ int hm_get_fanpolicy_with_device_id (hashcat_ctx_t *hashcat_ctx, const u32 devic
if (hm_ADL_Overdrive5_FanSpeed_Get (hashcat_ctx, hwmon_ctx->hm_device[device_id].adl, 0, &lpFanSpeedValue) == -1)
{
hwmon_ctx->hm_device[device_id].fanpolicy_get_supported = false;
hwmon_ctx->hm_device[device_id].fanspeed_get_supported = false;
return -1;
}
@ -2861,6 +2869,7 @@ int hm_get_fanpolicy_with_device_id (hashcat_ctx_t *hashcat_ctx, const u32 devic
}
hwmon_ctx->hm_device[device_id].fanpolicy_get_supported = false;
hwmon_ctx->hm_device[device_id].fanspeed_get_supported = false;
return -1;
}
@ -3472,6 +3481,7 @@ static int hm_set_fanctrl_with_device_id_xnvctrl (hashcat_ctx_t *hashcat_ctx, co
if (hm_XNVCTRL_set_fan_control (hashcat_ctx, hwmon_ctx->hm_device[device_id].xnvctrl, val) == -1)
{
hwmon_ctx->hm_device[device_id].fanpolicy_set_supported = false;
hwmon_ctx->hm_device[device_id].fanspeed_set_supported = false;
return -1;
}
@ -3480,6 +3490,7 @@ static int hm_set_fanctrl_with_device_id_xnvctrl (hashcat_ctx_t *hashcat_ctx, co
}
hwmon_ctx->hm_device[device_id].fanpolicy_set_supported = false;
hwmon_ctx->hm_device[device_id].fanspeed_set_supported = false;
return -1;
}
@ -3497,6 +3508,7 @@ static int hm_set_fanctrl_with_device_id_sysfs (hashcat_ctx_t *hashcat_ctx, cons
if (hm_SYSFS_set_fan_control (hashcat_ctx, device_id, val) == -1)
{
hwmon_ctx->hm_device[device_id].fanpolicy_set_supported = false;
hwmon_ctx->hm_device[device_id].fanspeed_set_supported = false;
return -1;
}
@ -3505,6 +3517,7 @@ static int hm_set_fanctrl_with_device_id_sysfs (hashcat_ctx_t *hashcat_ctx, cons
}
hwmon_ctx->hm_device[device_id].fanpolicy_set_supported = false;
hwmon_ctx->hm_device[device_id].fanspeed_set_supported = false;
return -1;
}

View File

@ -61,7 +61,7 @@ static int monitor (hashcat_ctx_t *hashcat_ctx)
const int sleep_time = 1;
const int temp_threshold = 1; // degrees celcius
const int fan_speed_min = 20; // in percentage
const int fan_speed_min = 33; // in percentage
const int fan_speed_max = 100;
const float exec_low = 50.0f; // in ms
const float util_low = 90.0f; // in percent