From 04bb6a46ef12be79ea545a6c0ce7f7882fa41af0 Mon Sep 17 00:00:00 2001 From: Jens Steube Date: Tue, 11 Jul 2017 17:15:16 +0200 Subject: [PATCH] There's a problem with Intels OpenCL runtime. The JiT hangs while trying to compile, for example mode 1700 in -L mode. Disabling the OpenCL optimization using -cl-opt-disable helped. While doing so, it turned out that there's many algorithms that _benefit_ from disabling the compiler optimizations. Other are not. Full list: https://docs.google.com/spreadsheets/d/1w0wZtHsP8ql4JLDRnm3zqi8JyMSBk9zzpXXjQz84Fwc/edit?usp=sharing --- src/opencl.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/opencl.c b/src/opencl.c index 241544dab..cfe58710b 100644 --- a/src/opencl.c +++ b/src/opencl.c @@ -2259,7 +2259,7 @@ int run_cracker (hashcat_ctx_t *hashcat_ctx, hc_device_param_t *device_param, co hc_timer_set (&device_param->timer_speed); } - int rc = choose_kernel (hashcat_ctx, device_param, highest_pw_len, pws_cnt, fast_iteration, salt_pos); + const int rc = choose_kernel (hashcat_ctx, device_param, highest_pw_len, pws_cnt, fast_iteration, salt_pos); if (rc == -1) return -1; @@ -4235,6 +4235,14 @@ int opencl_session_begin (hashcat_ctx_t *hashcat_ctx) snprintf (build_opts_new, sizeof (build_opts_new) - 1, "%s -D VENDOR_ID=%u -D CUDA_ARCH=%u -D VECT_SIZE=%u -D DEVICE_TYPE=%u -D DGST_R0=%u -D DGST_R1=%u -D DGST_R2=%u -D DGST_R3=%u -D DGST_ELEM=%u -D KERN_TYPE=%u -D _unroll -cl-std=CL1.2 -w", build_opts, device_param->platform_vendor_id, (device_param->sm_major * 100) + device_param->sm_minor, device_param->vector_width, (u32) device_param->device_type, hashconfig->dgst_pos0, hashconfig->dgst_pos1, hashconfig->dgst_pos2, hashconfig->dgst_pos3, hashconfig->dgst_size / 4, hashconfig->kern_type); #endif + if (device_param->device_type & CL_DEVICE_TYPE_CPU) + { + if (device_param->platform_vendor_id == VENDOR_ID_INTEL_SDK) + { + strncat (build_opts_new, " -cl-opt-disable", sizeof (build_opts_new) - 1); + } + } + strncpy (build_opts, build_opts_new, sizeof (build_opts) - 1); #if defined (DEBUG)