From ef8223b17a3a235717e4cf382c01fc18e706ff97 Mon Sep 17 00:00:00 2001 From: Gabriele Gristina Date: Tue, 10 Jun 2025 21:49:21 +0200 Subject: [PATCH] Alias Devices: Prevents hashcat, when started with x86_64 emulation on Apple Silicon, from showing the Apple M1 OpenCL CPU as an alias for the Apple M1 Metal GPU --- docs/changes.txt | 1 + src/backend.c | 9 +++++++++ 2 files changed, 10 insertions(+) diff --git a/docs/changes.txt b/docs/changes.txt index 63ef1844f..95f630a97 100644 --- a/docs/changes.txt +++ b/docs/changes.txt @@ -117,6 +117,7 @@ ## - AMD Driver: Updated requirements for AMD Windows drivers to "AMD Adrenalin Edition" (23.7.2 or later) and "AMD HIP SDK" (23.Q3 or later) +- Alias Devices: Prevents hashcat, when started with x86_64 emulation on Apple Silicon, from showing the Apple M1 OpenCL CPU as an alias for the Apple M1 Metal GPU - Apple Driver: Automatically enable GPU support on Apple OpenCL instead of CPU support - Apple Driver: Updated requirements to use Apple OpenCL API to macOS 13.0 - use - Backend Checks: Describe workaround in error message when detecting more than 64 backend devices diff --git a/src/backend.c b/src/backend.c index 5bf1d3c98..ec58ac8a8 100644 --- a/src/backend.c +++ b/src/backend.c @@ -70,6 +70,15 @@ static bool is_same_device (const hc_device_param_t *src, const hc_device_param_ // Metal can't have aliases if ((src->is_metal == true) && (dst->is_metal == true)) return false; + + // But Metal and OpenCL can have aliases + + if ((src->is_metal == true) && (dst->is_opencl == true)) + { + // Prevents hashcat, when started with x86_64 emulation on Apple Silicon, from showing the Apple M1 OpenCL CPU as an alias for the Apple M1 Metal GPU + + if (src->opencl_device_type != dst->opencl_device_type) return false; + } #endif // But OpenCL can have aliases