|
|
|
@ -6949,6 +6949,8 @@ static u32 get_kernel_threads (const hc_device_param_t *device_param)
|
|
|
|
|
|
|
|
|
|
static bool load_kernel (hashcat_ctx_t *hashcat_ctx, hc_device_param_t *device_param, const char *kernel_name, char *source_file, char *cached_file, const char *build_options_buf, const bool cache_disable, cl_program *opencl_program, CUmodule *cuda_module)
|
|
|
|
|
{
|
|
|
|
|
const hashconfig_t *hashconfig = hashcat_ctx->hashconfig;
|
|
|
|
|
|
|
|
|
|
bool cached = true;
|
|
|
|
|
|
|
|
|
|
if (cache_disable == true)
|
|
|
|
@ -7052,6 +7054,8 @@ static bool load_kernel (hashcat_ctx_t *hashcat_ctx, hc_device_param_t *device_p
|
|
|
|
|
char *mod_info_log = (char *) hcmalloc (LOG_SIZE + 1);
|
|
|
|
|
char *mod_error_log = (char *) hcmalloc (LOG_SIZE + 1);
|
|
|
|
|
|
|
|
|
|
int mod_cnt = 6;
|
|
|
|
|
|
|
|
|
|
CUjit_option mod_opts[7];
|
|
|
|
|
void *mod_vals[7];
|
|
|
|
|
|
|
|
|
@ -7073,14 +7077,21 @@ static bool load_kernel (hashcat_ctx_t *hashcat_ctx, hc_device_param_t *device_p
|
|
|
|
|
mod_opts[5] = CU_JIT_ERROR_LOG_BUFFER_SIZE_BYTES;
|
|
|
|
|
mod_vals[5] = (void *) LOG_SIZE;
|
|
|
|
|
|
|
|
|
|
mod_opts[6] = CU_JIT_MAX_REGISTERS;
|
|
|
|
|
mod_vals[6] = (void *) 128;
|
|
|
|
|
if (hashconfig->opti_type & OPTI_TYPE_REGISTER_LIMIT)
|
|
|
|
|
{
|
|
|
|
|
mod_opts[6] = CU_JIT_MAX_REGISTERS;
|
|
|
|
|
mod_vals[6] = (void *) 128;
|
|
|
|
|
|
|
|
|
|
mod_cnt++;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#if defined (WITH_CUBIN)
|
|
|
|
|
|
|
|
|
|
char *jit_info_log = (char *) hcmalloc (LOG_SIZE + 1);
|
|
|
|
|
char *jit_error_log = (char *) hcmalloc (LOG_SIZE + 1);
|
|
|
|
|
|
|
|
|
|
int jit_cnt = 6;
|
|
|
|
|
|
|
|
|
|
CUjit_option jit_opts[7];
|
|
|
|
|
void *jit_vals[7];
|
|
|
|
|
|
|
|
|
@ -7102,12 +7113,17 @@ static bool load_kernel (hashcat_ctx_t *hashcat_ctx, hc_device_param_t *device_p
|
|
|
|
|
jit_opts[5] = CU_JIT_ERROR_LOG_BUFFER_SIZE_BYTES;
|
|
|
|
|
jit_vals[5] = (void *) LOG_SIZE;
|
|
|
|
|
|
|
|
|
|
jit_opts[6] = CU_JIT_MAX_REGISTERS;
|
|
|
|
|
jit_vals[6] = (void *) 128;
|
|
|
|
|
if (hashconfig->opti_type & OPTI_TYPE_REGISTER_LIMIT)
|
|
|
|
|
{
|
|
|
|
|
jit_opts[6] = CU_JIT_MAX_REGISTERS;
|
|
|
|
|
jit_vals[6] = (void *) 128;
|
|
|
|
|
|
|
|
|
|
jit_cnt++;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
CUlinkState state;
|
|
|
|
|
|
|
|
|
|
if (hc_cuLinkCreate (hashcat_ctx, 7, jit_opts, jit_vals, &state) == -1)
|
|
|
|
|
if (hc_cuLinkCreate (hashcat_ctx, jit_cnt, jit_opts, jit_vals, &state) == -1)
|
|
|
|
|
{
|
|
|
|
|
event_log_error (hashcat_ctx, "* Device #%u: Kernel %s link failed. Error Log:", device_param->device_id + 1, source_file);
|
|
|
|
|
event_log_error (hashcat_ctx, "%s", jit_error_log);
|
|
|
|
@ -7144,7 +7160,7 @@ static bool load_kernel (hashcat_ctx_t *hashcat_ctx, hc_device_param_t *device_p
|
|
|
|
|
event_log_info (hashcat_ctx, NULL);
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
if (hc_cuModuleLoadDataEx (hashcat_ctx, cuda_module, cubin, 7, mod_opts, mod_vals) == -1)
|
|
|
|
|
if (hc_cuModuleLoadDataEx (hashcat_ctx, cuda_module, cubin, mod_cnt, mod_opts, mod_vals) == -1)
|
|
|
|
|
{
|
|
|
|
|
event_log_error (hashcat_ctx, "* Device #%u: Kernel %s load failed. Error Log:", device_param->device_id + 1, source_file);
|
|
|
|
|
event_log_error (hashcat_ctx, "%s", mod_error_log);
|
|
|
|
@ -7171,7 +7187,7 @@ static bool load_kernel (hashcat_ctx_t *hashcat_ctx, hc_device_param_t *device_p
|
|
|
|
|
|
|
|
|
|
#else
|
|
|
|
|
|
|
|
|
|
if (hc_cuModuleLoadDataEx (hashcat_ctx, cuda_module, binary, 7, mod_opts, mod_vals) == -1)
|
|
|
|
|
if (hc_cuModuleLoadDataEx (hashcat_ctx, cuda_module, binary, mod_cnt, mod_opts, mod_vals) == -1)
|
|
|
|
|
{
|
|
|
|
|
event_log_error (hashcat_ctx, "* Device #%u: Kernel %s load failed. Error Log:", device_param->device_id + 1, source_file);
|
|
|
|
|
event_log_error (hashcat_ctx, "%s", mod_error_log);
|
|
|
|
@ -7259,6 +7275,8 @@ static bool load_kernel (hashcat_ctx_t *hashcat_ctx, hc_device_param_t *device_p
|
|
|
|
|
char *mod_info_log = (char *) hcmalloc (LOG_SIZE + 1);
|
|
|
|
|
char *mod_error_log = (char *) hcmalloc (LOG_SIZE + 1);
|
|
|
|
|
|
|
|
|
|
int mod_cnt = 6;
|
|
|
|
|
|
|
|
|
|
CUjit_option mod_opts[7];
|
|
|
|
|
void *mod_vals[7];
|
|
|
|
|
|
|
|
|
@ -7280,10 +7298,15 @@ static bool load_kernel (hashcat_ctx_t *hashcat_ctx, hc_device_param_t *device_p
|
|
|
|
|
mod_opts[5] = CU_JIT_ERROR_LOG_BUFFER_SIZE_BYTES;
|
|
|
|
|
mod_vals[5] = (void *) LOG_SIZE;
|
|
|
|
|
|
|
|
|
|
mod_opts[6] = CU_JIT_MAX_REGISTERS;
|
|
|
|
|
mod_vals[6] = (void *) 128;
|
|
|
|
|
if (hashconfig->opti_type & OPTI_TYPE_REGISTER_LIMIT)
|
|
|
|
|
{
|
|
|
|
|
mod_opts[6] = CU_JIT_MAX_REGISTERS;
|
|
|
|
|
mod_vals[6] = (void *) 128;
|
|
|
|
|
|
|
|
|
|
mod_cnt++;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (hc_cuModuleLoadDataEx (hashcat_ctx, cuda_module, kernel_sources[0], 7, mod_opts, mod_vals) == -1)
|
|
|
|
|
if (hc_cuModuleLoadDataEx (hashcat_ctx, cuda_module, kernel_sources[0], mod_cnt, mod_opts, mod_vals) == -1)
|
|
|
|
|
{
|
|
|
|
|
event_log_error (hashcat_ctx, "* Device #%u: Kernel %s load failed. Error Log:", device_param->device_id + 1, source_file);
|
|
|
|
|
event_log_error (hashcat_ctx, "%s", mod_error_log);
|
|
|
|
|