mirror of
https://github.com/hashcat/hashcat.git
synced 2024-11-22 08:08:10 +00:00
Disable Metal < 200, commented unused and deprecated code
This commit is contained in:
parent
0f63294b8a
commit
15d74b7c1c
@ -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;
|
||||
|
@ -4507,8 +4507,27 @@ int backend_ctx_init (hashcat_ctx_t *hashcat_ctx)
|
||||
|
||||
backend_ctx->metal_runtimeVersion = atoi (backend_ctx->metal_runtimeVersionStr);
|
||||
|
||||
// disable metal < 200
|
||||
|
||||
if (backend_ctx->metal_runtimeVersion < 200)
|
||||
{
|
||||
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)
|
||||
{
|
||||
// disable metal < 300
|
||||
|
||||
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);
|
||||
@ -4524,6 +4543,7 @@ int backend_ctx_init (hashcat_ctx_t *hashcat_ctx)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
rc_metal_init = -1;
|
||||
@ -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
|
||||
|
||||
|
@ -16,6 +16,7 @@
|
||||
#include <Foundation/Foundation.h>
|
||||
#include <Metal/Metal.h>
|
||||
|
||||
/*
|
||||
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)
|
||||
{
|
||||
|
@ -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);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user