diff --git a/include/types.h b/include/types.h index 864e53a10..ce5270c6b 100644 --- a/include/types.h +++ b/include/types.h @@ -1640,8 +1640,8 @@ typedef struct hc_device_param #if defined (__APPLE__) - int mtl_major; - int mtl_minor; + //int mtl_major; + //int mtl_minor; int device_physical_location; int device_location_number; diff --git a/src/backend.c b/src/backend.c index 15887e763..d6e7ae38f 100644 --- a/src/backend.c +++ b/src/backend.c @@ -4507,20 +4507,40 @@ int backend_ctx_init (hashcat_ctx_t *hashcat_ctx) backend_ctx->metal_runtimeVersion = atoi (backend_ctx->metal_runtimeVersionStr); - if (user_options->force == false) + // disable metal < 200 + + if (backend_ctx->metal_runtimeVersion < 200) { - if (backend_ctx->metal_runtimeVersion < 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 + { + if (user_options->force == false) { - 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); + // disable metal < 300 - rc_metal_init = -1; + if (backend_ctx->metal_runtimeVersion < 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->rc_metal_init = rc_metal_init; - backend_ctx->mtl = NULL; + backend_ctx->mtl = NULL; - mtl_close (hashcat_ctx); + mtl_close (hashcat_ctx); + } } } } @@ -5832,29 +5852,28 @@ int backend_ctx_devices_init (hashcat_ctx_t *hashcat_ctx, const int comptime) device_param->opencl_device_vendor = strdup ("Apple"); device_param->opencl_device_c_version = ""; + /* unused and deprecated + // sm_minor, sm_major int mtl_major = 0; int mtl_minor = 0; - /* unused and deprecated if (hc_mtlDeviceGetAttribute (hashcat_ctx, &mtl_major, MTL_DEVICE_ATTRIBUTE_COMPUTE_CAPABILITY_MAJOR, metal_device) == -1) { device_param->skipped = true; continue; } - */ - /* unused and deprecated if (hc_mtlDeviceGetAttribute (hashcat_ctx, &mtl_minor, MTL_DEVICE_ATTRIBUTE_COMPUTE_CAPABILITY_MINOR, metal_device) == -1) { device_param->skipped = true; continue; } - */ device_param->mtl_major = mtl_major; device_param->mtl_minor = mtl_minor; + */ // device_name diff --git a/src/ext_metal.m b/src/ext_metal.m index c894941c3..b8428369c 100644 --- a/src/ext_metal.m +++ b/src/ext_metal.m @@ -16,6 +16,7 @@ #include #include +/* typedef NS_ENUM(NSUInteger, hc_mtlFeatureSet) { MTL_FEATURESET_MACOS_GPUFAMILY_1_V1 = 10000, @@ -25,6 +26,7 @@ typedef NS_ENUM(NSUInteger, hc_mtlFeatureSet) MTL_FEATURESET_MACOS_GPUFAMILY_2_V1 = 10005, } metalDeviceFeatureSet_macOS_t; +*/ typedef NS_ENUM(NSUInteger, hc_mtlLanguageVersion) { diff --git a/src/terminal.c b/src/terminal.c index 6107a14cd..2de912e0a 100644 --- a/src/terminal.c +++ b/src/terminal.c @@ -1234,8 +1234,8 @@ void backend_info (hashcat_ctx_t *hashcat_ctx) const hc_device_param_t *device_param = backend_ctx->devices_param + backend_devices_idx; int device_id = device_param->device_id; - int device_mtl_maj = device_param->mtl_major; - int device_mtl_min = device_param->mtl_minor; + //int device_mtl_maj = device_param->mtl_major; + //int device_mtl_min = device_param->mtl_minor; int device_max_transfer_rate = device_param->device_max_transfer_rate; int device_physical_location = device_param->device_physical_location; int device_location_number = device_param->device_location_number; @@ -1285,6 +1285,7 @@ void backend_info (hashcat_ctx_t *hashcat_ctx) default: event_log_info (hashcat_ctx, " Phys.Location..: N/A"); break; } + /* if (device_mtl_maj > 0 && device_mtl_min > 0) { event_log_info (hashcat_ctx, " Feature.Set....: macOS GPU Family %u v%u", device_mtl_maj, device_mtl_min); @@ -1293,6 +1294,7 @@ void backend_info (hashcat_ctx_t *hashcat_ctx) { event_log_info (hashcat_ctx, " Feature.Set....: N/A"); } + */ event_log_info (hashcat_ctx, " Registry.ID....: %u", device_registryID);