|
|
|
@ -3376,6 +3376,10 @@ int opencl_ctx_devices_init (hashcat_ctx_t *hashcat_ctx, const int comptime)
|
|
|
|
|
{
|
|
|
|
|
device_vendor_id = VENDOR_ID_NV;
|
|
|
|
|
}
|
|
|
|
|
else if (strcmp (device_vendor, CL_VENDOR_APPLE_USE_INTEL) == 0)
|
|
|
|
|
{
|
|
|
|
|
device_vendor_id = VENDOR_ID_INTEL_SDK;
|
|
|
|
|
}
|
|
|
|
|
else if (strcmp (device_vendor, CL_VENDOR_INTEL_BEIGNET) == 0)
|
|
|
|
|
{
|
|
|
|
|
device_vendor_id = VENDOR_ID_INTEL_BEIGNET;
|
|
|
|
@ -4912,6 +4916,28 @@ int opencl_session_begin (hashcat_ctx_t *hashcat_ctx)
|
|
|
|
|
|
|
|
|
|
snprintf (device_name_chksum_amp_mp, HCBUFSIZ_TINY, "%08x", device_name_digest_amp_mp[0]);
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* kernel cache
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
bool cache_disable = false;
|
|
|
|
|
|
|
|
|
|
// Seems to be completely broken on Apple + (Intel?) CPU
|
|
|
|
|
// To reproduce set cache_disable to false and run benchmark -b
|
|
|
|
|
|
|
|
|
|
if (device_param->platform_vendor_id == VENDOR_ID_APPLE)
|
|
|
|
|
{
|
|
|
|
|
if (device_param->device_type & CL_DEVICE_TYPE_CPU)
|
|
|
|
|
{
|
|
|
|
|
cache_disable = true;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (module_ctx->module_jit_cache_disable != MODULE_DEFAULT)
|
|
|
|
|
{
|
|
|
|
|
cache_disable = module_ctx->module_jit_cache_disable (hashconfig, user_options, user_options_extra, hashes, device_param);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* main kernel
|
|
|
|
|
*/
|
|
|
|
@ -4942,6 +4968,11 @@ int opencl_session_begin (hashcat_ctx_t *hashcat_ctx)
|
|
|
|
|
|
|
|
|
|
bool cached = true;
|
|
|
|
|
|
|
|
|
|
if (cache_disable == true)
|
|
|
|
|
{
|
|
|
|
|
cached = false;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (hc_path_read (cached_file) == false)
|
|
|
|
|
{
|
|
|
|
|
cached = false;
|
|
|
|
@ -4964,15 +4995,6 @@ int opencl_session_begin (hashcat_ctx_t *hashcat_ctx)
|
|
|
|
|
|
|
|
|
|
char **kernel_sources = &kernel_sources_buf;
|
|
|
|
|
|
|
|
|
|
bool cache_disable = false;
|
|
|
|
|
|
|
|
|
|
if (module_ctx->module_jit_cache_disable != MODULE_DEFAULT)
|
|
|
|
|
{
|
|
|
|
|
cache_disable = module_ctx->module_jit_cache_disable (hashconfig, user_options, user_options_extra, hashes, device_param);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (cache_disable == false)
|
|
|
|
|
{
|
|
|
|
|
if (cached == false)
|
|
|
|
|
{
|
|
|
|
|
#if defined (DEBUG)
|
|
|
|
@ -5023,6 +5045,8 @@ int opencl_session_begin (hashcat_ctx_t *hashcat_ctx)
|
|
|
|
|
continue;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (cache_disable == false)
|
|
|
|
|
{
|
|
|
|
|
size_t binary_size;
|
|
|
|
|
|
|
|
|
|
CL_rc = hc_clGetProgramInfo (hashcat_ctx, device_param->program, CL_PROGRAM_BINARY_SIZES, sizeof (size_t), &binary_size, NULL);
|
|
|
|
@ -5041,6 +5065,7 @@ int opencl_session_begin (hashcat_ctx_t *hashcat_ctx)
|
|
|
|
|
|
|
|
|
|
hcfree (binary);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
const bool rc_read_kernel = read_kernel_binary (hashcat_ctx, cached_file, kernel_lengths, kernel_sources, false);
|
|
|
|
@ -5055,53 +5080,6 @@ int opencl_session_begin (hashcat_ctx_t *hashcat_ctx)
|
|
|
|
|
|
|
|
|
|
if (CL_rc == -1) return -1;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
const bool rc_read_kernel = read_kernel_binary (hashcat_ctx, source_file, kernel_lengths, kernel_sources, true);
|
|
|
|
|
|
|
|
|
|
if (rc_read_kernel == false) return -1;
|
|
|
|
|
|
|
|
|
|
CL_rc = hc_clCreateProgramWithSource (hashcat_ctx, device_param->context, 1, (const char **) kernel_sources, NULL, &device_param->program);
|
|
|
|
|
|
|
|
|
|
if (CL_rc == -1) return -1;
|
|
|
|
|
|
|
|
|
|
CL_rc = hc_clBuildProgram (hashcat_ctx, device_param->program, 1, &device_param->device, build_options_module_buf, NULL, NULL);
|
|
|
|
|
|
|
|
|
|
//if (CL_rc == -1) return -1;
|
|
|
|
|
|
|
|
|
|
size_t build_log_size = 0;
|
|
|
|
|
|
|
|
|
|
hc_clGetProgramBuildInfo (hashcat_ctx, device_param->program, device_param->device, CL_PROGRAM_BUILD_LOG, 0, NULL, &build_log_size);
|
|
|
|
|
|
|
|
|
|
//if (CL_rc == -1) return -1;
|
|
|
|
|
|
|
|
|
|
#if defined (DEBUG)
|
|
|
|
|
if ((build_log_size > 1) || (CL_rc == -1))
|
|
|
|
|
#else
|
|
|
|
|
if (CL_rc == -1)
|
|
|
|
|
#endif
|
|
|
|
|
{
|
|
|
|
|
char *build_log = (char *) hcmalloc (build_log_size + 1);
|
|
|
|
|
|
|
|
|
|
int CL_rc_build = hc_clGetProgramBuildInfo (hashcat_ctx, device_param->program, device_param->device, CL_PROGRAM_BUILD_LOG, build_log_size, build_log, NULL);
|
|
|
|
|
|
|
|
|
|
if (CL_rc_build == -1) return -1;
|
|
|
|
|
|
|
|
|
|
puts (build_log);
|
|
|
|
|
|
|
|
|
|
hcfree (build_log);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (CL_rc == -1)
|
|
|
|
|
{
|
|
|
|
|
device_param->skipped_warning = true;
|
|
|
|
|
|
|
|
|
|
event_log_error (hashcat_ctx, "* Device #%u: Kernel %s build failed - proceeding without this device.", device_id + 1, source_file);
|
|
|
|
|
|
|
|
|
|
continue;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
hcfree (kernel_sources[0]);
|
|
|
|
|
}
|
|
|
|
@ -5144,6 +5122,11 @@ int opencl_session_begin (hashcat_ctx_t *hashcat_ctx)
|
|
|
|
|
|
|
|
|
|
bool cached = true;
|
|
|
|
|
|
|
|
|
|
if (cache_disable == true)
|
|
|
|
|
{
|
|
|
|
|
cached = false;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (hc_path_read (cached_file) == false)
|
|
|
|
|
{
|
|
|
|
|
cached = false;
|
|
|
|
@ -5216,6 +5199,8 @@ int opencl_session_begin (hashcat_ctx_t *hashcat_ctx)
|
|
|
|
|
continue;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (cache_disable == false)
|
|
|
|
|
{
|
|
|
|
|
size_t binary_size;
|
|
|
|
|
|
|
|
|
|
CL_rc = hc_clGetProgramInfo (hashcat_ctx, device_param->program_mp, CL_PROGRAM_BINARY_SIZES, sizeof (size_t), &binary_size, NULL);
|
|
|
|
@ -5232,6 +5217,7 @@ int opencl_session_begin (hashcat_ctx_t *hashcat_ctx)
|
|
|
|
|
|
|
|
|
|
hcfree (binary);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
const bool rc_read_kernel = read_kernel_binary (hashcat_ctx, cached_file, kernel_lengths, kernel_sources, false);
|
|
|
|
@ -5291,6 +5277,11 @@ int opencl_session_begin (hashcat_ctx_t *hashcat_ctx)
|
|
|
|
|
|
|
|
|
|
bool cached = true;
|
|
|
|
|
|
|
|
|
|
if (cache_disable == true)
|
|
|
|
|
{
|
|
|
|
|
cached = false;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (hc_path_read (cached_file) == false)
|
|
|
|
|
{
|
|
|
|
|
cached = false;
|
|
|
|
@ -5363,6 +5354,8 @@ int opencl_session_begin (hashcat_ctx_t *hashcat_ctx)
|
|
|
|
|
continue;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (cache_disable == false)
|
|
|
|
|
{
|
|
|
|
|
size_t binary_size;
|
|
|
|
|
|
|
|
|
|
CL_rc = hc_clGetProgramInfo (hashcat_ctx, device_param->program_amp, CL_PROGRAM_BINARY_SIZES, sizeof (size_t), &binary_size, NULL);
|
|
|
|
@ -5379,6 +5372,7 @@ int opencl_session_begin (hashcat_ctx_t *hashcat_ctx)
|
|
|
|
|
|
|
|
|
|
hcfree (binary);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
const bool rc_read_kernel = read_kernel_binary (hashcat_ctx, cached_file, kernel_lengths, kernel_sources, false);
|
|
|
|
|