From 9c937aa3d3b1b991f40290275447cab2ed3c15e3 Mon Sep 17 00:00:00 2001 From: Nikolai Lifanov Date: Mon, 21 Nov 2016 17:03:40 -0500 Subject: [PATCH 1/4] add missing includes for FreeBSD These were lost during refactoring and found again in preparation for port update to upcoming 3.20. --- src/affinity.c | 1 + src/folder.c | 2 ++ 2 files changed, 3 insertions(+) diff --git a/src/affinity.c b/src/affinity.c index edd62e86b..d0163a95c 100644 --- a/src/affinity.c +++ b/src/affinity.c @@ -41,6 +41,7 @@ static int pthread_setaffinity_np (pthread_t thread, size_t cpu_size, cpu_set_t #endif #if defined (__FreeBSD__) +#include typedef cpuset_t cpu_set_t; #endif diff --git a/src/folder.c b/src/folder.c index 6b2b636d1..d7d504baa 100644 --- a/src/folder.c +++ b/src/folder.c @@ -50,6 +50,8 @@ static int get_exec_path (char *exec_path, const size_t exec_path_sz) #elif defined (__FreeBSD__) + #include + int mib[4]; mib[0] = CTL_KERN; From 4882fa05a16b412a827fead456be696a5fe7cd14 Mon Sep 17 00:00:00 2001 From: jsteube Date: Tue, 22 Nov 2016 16:51:06 +0100 Subject: [PATCH 2/4] Minimum fanspeed increased to 33%, same as NV does on windows --- src/monitor.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/monitor.c b/src/monitor.c index 5405b03e5..4520b5b74 100644 --- a/src/monitor.c +++ b/src/monitor.c @@ -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 From c376c1e96b89b468e8c648bcf76d3ad40070ffde Mon Sep 17 00:00:00 2001 From: jsteube Date: Tue, 22 Nov 2016 17:54:29 +0100 Subject: [PATCH 3/4] Add a notice to user to setup coolbits --- src/hwmon.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/src/hwmon.c b/src/hwmon.c index 41cc650e6..0fd9d4e5b 100644 --- a/src/hwmon.c +++ b/src/hwmon.c @@ -1358,7 +1358,10 @@ 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"); + event_log_error (hashcat_ctx, "This error typically occurs when you did not setup NVidia Coolbits."); + event_log_error (hashcat_ctx, "Run the following command to fix: sudo nvidia-xconfig --cool-bits=12"); + event_log_error (hashcat_ctx, "Do not forget to restart X afterwards."); return -1; } @@ -2837,6 +2840,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 +2865,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; } @@ -3415,7 +3420,7 @@ int hm_set_fanspeed_with_device_id_xnvctrl (hashcat_ctx_t *hashcat_ctx, const u3 if (hwmon_ctx->enabled == false) return -1; - if (hwmon_ctx->hm_device[device_id].fanspeed_set_supported == false) return -1; + if (hwmon_ctx->hm_device[device_id].fanspeed_set_supported == false) return -1; if (hwmon_ctx->hm_xnvctrl) { @@ -3472,6 +3477,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 +3486,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 +3504,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 +3513,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; } From fc38f36701567ffc634143d025c942d33cec1dda Mon Sep 17 00:00:00 2001 From: jsteube Date: Tue, 22 Nov 2016 18:00:44 +0100 Subject: [PATCH 4/4] Help the user to fix the coolbits problem as warning not error --- src/hwmon.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/hwmon.c b/src/hwmon.c index 0fd9d4e5b..a4eb9bd31 100644 --- a/src/hwmon.c +++ b/src/hwmon.c @@ -1359,9 +1359,13 @@ static int hm_XNVCTRL_get_fan_control (hashcat_ctx_t *hashcat_ctx, const int gpu if (rc == false) { event_log_error (hashcat_ctx, "XNVCTRLQueryTargetAttribute() failed"); - event_log_error (hashcat_ctx, "This error typically occurs when you did not setup NVidia Coolbits."); - event_log_error (hashcat_ctx, "Run the following command to fix: sudo nvidia-xconfig --cool-bits=12"); - event_log_error (hashcat_ctx, "Do not forget to restart X afterwards."); + + // 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; }