mirror of
https://github.com/hashcat/hashcat.git
synced 2025-01-22 05:31:11 +00:00
Add support for Metal > 300 and reject support for older version
This commit is contained in:
parent
adcd3e3e87
commit
66b22fa644
@ -12,7 +12,7 @@
|
||||
#define IS_CUDA
|
||||
#elif defined __HIPCC__
|
||||
#define IS_HIP
|
||||
#elif defined __METAL_MACOS__
|
||||
#elif defined __METAL__
|
||||
#define IS_METAL
|
||||
#else
|
||||
#define IS_OPENCL
|
||||
|
@ -4503,7 +4503,19 @@ int backend_ctx_init (hashcat_ctx_t *hashcat_ctx)
|
||||
|
||||
if (hc_mtlRuntimeGetVersionString (hashcat_ctx, backend_ctx->metal_runtimeVersionStr, &version_len) == -1) return -1;
|
||||
|
||||
// TODO: needs version check
|
||||
if (atoi (backend_ctx->metal_runtimeVersionStr) < 300)
|
||||
{
|
||||
event_log_warning (hashcat_ctx, "Unsupported Apple Metal runtime version '%s' detected! Falling back to OpenCL...", backend_ctx->metal_runtimeVersionStr);
|
||||
event_log_warning (hashcat_ctx, NULL);
|
||||
|
||||
rc_metal_init = -1;
|
||||
|
||||
backend_ctx->rc_metal_init = rc_metal_init;
|
||||
|
||||
backend_ctx->mtl = NULL;
|
||||
|
||||
mtl_close (hashcat_ctx);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -4511,6 +4523,8 @@ int backend_ctx_init (hashcat_ctx_t *hashcat_ctx)
|
||||
|
||||
backend_ctx->rc_metal_init = rc_metal_init;
|
||||
|
||||
backend_ctx->mtl = NULL;
|
||||
|
||||
mtl_close (hashcat_ctx);
|
||||
}
|
||||
}
|
||||
@ -9265,8 +9279,11 @@ int backend_session_begin (hashcat_ctx_t *hashcat_ctx)
|
||||
{
|
||||
// set some limits with Metal
|
||||
|
||||
device_param->kernel_threads_max = 128;
|
||||
device_param->kernel_threads_max = 64;
|
||||
device_param->kernel_threads_min = MIN (device_param->kernel_threads_min, device_param->kernel_threads_max);
|
||||
|
||||
device_param->kernel_loops_max = 1024; // autotune go over ...
|
||||
device_param->kernel_loops_min = MIN (device_param->kernel_loops_min, device_param->kernel_loops_max);
|
||||
}
|
||||
#endif
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user