1
0
mirror of https://github.com/hashcat/hashcat.git synced 2025-01-08 14:51:10 +00:00

Startup: Show OpenCL runtime initialization message (per device)

This commit is contained in:
Jens Steube 2018-11-12 20:45:05 +01:00
parent a5e8818805
commit 06b39dc3d5
4 changed files with 31 additions and 1 deletions

View File

@ -57,6 +57,7 @@
- Hardware Monitor: Renamed --gpu-temp-disable to --hwmon-disable
- Memory: Limit maximum host memory to allocate depending on bitness
- Memory: Reduced default maximum bitmap size from 24 to 18 and give a notice to use --bitmap-max to restore
- Startup: Show OpenCL runtime initialization message (per device)
- Tests: Added hash-mode 11700 (Streebog-256)
- Tests: Added hash-mode 11750 (HMAC-Streebog-256 (key = $pass), big-endian)
- Tests: Added hash-mode 11760 (HMAC-Streebog-256 (key = $salt), big-endian)

View File

@ -125,6 +125,8 @@ typedef enum event_identifier
EVENT_MONITOR_NOINPUT_ABORT = 0x00000088,
EVENT_OPENCL_SESSION_POST = 0x00000090,
EVENT_OPENCL_SESSION_PRE = 0x00000091,
EVENT_OPENCL_DEVICE_INIT_POST = 0x00000092,
EVENT_OPENCL_DEVICE_INIT_PRE = 0x00000093,
EVENT_OUTERLOOP_FINISHED = 0x000000a0,
EVENT_OUTERLOOP_MAINSCREEN = 0x000000a1,
EVENT_OUTERLOOP_STARTING = 0x000000a2,

View File

@ -541,7 +541,6 @@ static void main_outerloop_mainscreen (MAYBE_UNUSED hashcat_ctx_t *hashcat_ctx,
}
event_log_info (hashcat_ctx, NULL);
}
static void main_opencl_session_pre (MAYBE_UNUSED hashcat_ctx_t *hashcat_ctx, MAYBE_UNUSED const void *buf, MAYBE_UNUSED const size_t len)
@ -562,6 +561,28 @@ static void main_opencl_session_post (MAYBE_UNUSED hashcat_ctx_t *hashcat_ctx, M
event_log_info_nn (hashcat_ctx, "Initialized device kernels and memory...");
}
static void main_opencl_device_init_pre (MAYBE_UNUSED hashcat_ctx_t *hashcat_ctx, MAYBE_UNUSED const void *buf, MAYBE_UNUSED const size_t len)
{
const user_options_t *user_options = hashcat_ctx->user_options;
if (user_options->quiet == true) return;
const u32 *device_id = (const u32 *) buf;
event_log_info_nn (hashcat_ctx, "Initializing OpenCL runtime for device #%u...", *device_id + 1);
}
static void main_opencl_device_init_post (MAYBE_UNUSED hashcat_ctx_t *hashcat_ctx, MAYBE_UNUSED const void *buf, MAYBE_UNUSED const size_t len)
{
const user_options_t *user_options = hashcat_ctx->user_options;
if (user_options->quiet == true) return;
const u32 *device_id = (const u32 *) buf;
event_log_info_nn (hashcat_ctx, "Initialized OpenCL runtime for device #%u...", *device_id + 1);
}
static void main_bitmap_init_pre (MAYBE_UNUSED hashcat_ctx_t *hashcat_ctx, MAYBE_UNUSED const void *buf, MAYBE_UNUSED const size_t len)
{
const user_options_t *user_options = hashcat_ctx->user_options;
@ -997,6 +1018,8 @@ static void event (const u32 id, hashcat_ctx_t *hashcat_ctx, const void *buf, co
case EVENT_MONITOR_NOINPUT_ABORT: main_monitor_noinput_abort (hashcat_ctx, buf, len); break;
case EVENT_OPENCL_SESSION_POST: main_opencl_session_post (hashcat_ctx, buf, len); break;
case EVENT_OPENCL_SESSION_PRE: main_opencl_session_pre (hashcat_ctx, buf, len); break;
case EVENT_OPENCL_DEVICE_INIT_POST: main_opencl_device_init_post (hashcat_ctx, buf, len); break;
case EVENT_OPENCL_DEVICE_INIT_PRE: main_opencl_device_init_pre (hashcat_ctx, buf, len); break;
case EVENT_OUTERLOOP_FINISHED: main_outerloop_finished (hashcat_ctx, buf, len); break;
case EVENT_OUTERLOOP_MAINSCREEN: main_outerloop_mainscreen (hashcat_ctx, buf, len); break;
case EVENT_OUTERLOOP_STARTING: main_outerloop_starting (hashcat_ctx, buf, len); break;

View File

@ -4279,6 +4279,8 @@ int opencl_session_begin (hashcat_ctx_t *hashcat_ctx)
if (device_param->skipped == true) continue;
EVENT_DATA (EVENT_OPENCL_DEVICE_INIT_PRE, &device_id, sizeof (u32));
bool skipped_temp = false;
#if defined (__APPLE__)
@ -6762,6 +6764,8 @@ int opencl_session_begin (hashcat_ctx_t *hashcat_ctx)
CL_rc = hc_clSetKernelArg (hashcat_ctx, device_param->kernel_decompress, 2, sizeof (cl_mem), device_param->kernel_params_decompress[2]); if (CL_rc == -1) return -1;
hardware_power_all += device_param->hardware_power;
EVENT_DATA (EVENT_OPENCL_DEVICE_INIT_POST, &device_id, sizeof (u32));
}
// Prevent exit from benchmark mode if all devices are skipped due to unstable hash-modes (macOS)