From 0309afc273507b0b6749cc6d7c17aa05cc02d530 Mon Sep 17 00:00:00 2001 From: jsteube Date: Sun, 29 Jan 2017 10:11:13 +0100 Subject: [PATCH] OpenCL Device: Do a check on available constant memory size and abort if it's less than 64kB --- docs/changes.txt | 1 + src/opencl.c | 15 +++++++++++++++ 2 files changed, 16 insertions(+) diff --git a/docs/changes.txt b/docs/changes.txt index ac85c46eb..6723284b5 100644 --- a/docs/changes.txt +++ b/docs/changes.txt @@ -41,6 +41,7 @@ - Files: Do several file and folder checks on startup rather than when they are actually used to avoid related error after eventual intense operations - Helper: Added functions to check existence, type, read- and write-permissions and rewrite sources to use them instead of stat() - OpenCL Runtime: Updated AMDGPU-Pro driver version check, do warn if version 16.60 is detected which is known to be broken +- OpenCL Device: Do a check on available constant memory size and abort if it's less than 64kB - Sessions: Move out handling of multiple instance from restore file into separate pidfile * changes v3.20 -> v3.30: diff --git a/src/opencl.c b/src/opencl.c index 8f770c84f..9b3af1181 100644 --- a/src/opencl.c +++ b/src/opencl.c @@ -2741,6 +2741,21 @@ int opencl_ctx_devices_init (hashcat_ctx_t *hashcat_ctx, const int comptime) hcfree (device_extensions); + // device_max_constant_buffer_size + + cl_ulong device_max_constant_buffer_size; + + CL_rc = hc_clGetDeviceInfo (hashcat_ctx, device_param->device, CL_DEVICE_MAX_CONSTANT_BUFFER_SIZE, sizeof (device_max_constant_buffer_size), &device_max_constant_buffer_size, NULL); + + if (CL_rc == -1) return -1; + + if (device_max_constant_buffer_size < 65536) + { + event_log_error (hashcat_ctx, "* Device #%u: Device constant buffer size is too small", device_id + 1); + + device_param->skipped = true; + } + // device_local_mem_size cl_ulong device_local_mem_size;