Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Metal backend doesn't work on supported GPU #3438

Closed
VadimMuhtarov opened this issue Sep 3, 2022 · 2 comments
Closed

Metal backend doesn't work on supported GPU #3438

VadimMuhtarov opened this issue Sep 3, 2022 · 2 comments
Labels

Comments

@VadimMuhtarov
Copy link

VadimMuhtarov commented Sep 3, 2022

I get clCompileProgram(): CL_BUILD_PROGRAM_FAILURE with default settings and No devices found/left. with --backend-ignore-opencl flag when trying to run the benchmark. Also I tried all combinations with -D and -d, used --force flag, recompiled Hashcat from sources, nothing helped.

hashcat -I
hashcat (v6.2.6) starting in backend information mode

Metal Info:
===========

Metal.Version.: 212.8

Backend Device ID #1
  Type...........: GPU
  Vendor.ID......: 2
  Vendor.........: Apple
  Name...........: Intel HD Graphics 4000
  Processor(s)...: 1
  Clock..........: N/A
  Memory.Total...: 1536 MB (limited to 576 MB allocatable in one block)
  Memory.Free....: 704 MB
  Local.Memory...: 32 KB
  Phys.Location..: built-in
  Feature.Set....: macOS GPU Family 1 v4
  Registry.ID....: 1024
  Max.TX.Rate....: N/A
  GPU.Properties.: headless 0, low-power 1, removable 0

OpenCL Info:
============

OpenCL Platform ID #1
  Vendor..: Apple
  Name....: Apple
  Version.: OpenCL 1.2 (Apr 19 2022 00:27:55)

  Backend Device ID #2
    Type...........: CPU
    Vendor.ID......: 8
    Vendor.........: Intel
    Name...........: Intel(R) Core(TM) i5-3210M CPU @ 2.50GHz
    Version........: OpenCL 1.2 
    Processor(s)...: 4
    Clock..........: 2500
    Memory.Total...: 8192 MB (limited to 1024 MB allocatable in one block)
    Memory.Free....: 4064 MB
    Local.Memory...: 32 KB
    OpenCL.Version.: OpenCL C 1.2 
    Driver.Version.: 1.1

  Backend Device ID #3
    Type...........: GPU
    Vendor.ID......: 8
    Vendor.........: Intel
    Name...........: HD Graphics 4000
    Version........: OpenCL 1.2 
    Processor(s)...: 16
    Clock..........: 1100
    Memory.Total...: 1536 MB (limited to 192 MB allocatable in one block)
    Memory.Free....: 704 MB
    Local.Memory...: 64 KB
    OpenCL.Version.: OpenCL C 1.2 
    Driver.Version.: 1.2(Jun 21 2022 21:30:14)

hashcat v6.2.6
macOS Catalina 10.15.7
MBP mid 2012

@emwinkler
Copy link

Looks like Metal has only been enabled for Apple silicon with its multiple processors. If you want to enable it on any Metal supported GPU, you need to edit this line in src/backend.c

// check if we need skip device

if (device_param->device_processors == 1) device_param->skipped = true;

and change it to:

if (device_param->device_processors == 1) device_param->skipped = false;

Here is what I get on my Intel macbook pro with this change:

hashcat -b --backend-ignore-opencl
hashcat (v6.2.6) starting in benchmark mode

Benchmarking uses hand-optimized kernel code by default.
You can use it in your cracking session by setting the -O option.
Note: Using optimized kernel code limits the maximum supported password length.
To disable the optimized kernel code in benchmark mode, use the -w option.

METAL API (Metal 263.8)

Benchmark relevant options:

  • --optimized-kernel-enable

  • Hash-Mode 0 (MD5)

Speed.#1.........: 413.6 MH/s (79.42ms) @ Accel:2048 Loops:512 Thr:32 Vec:1


  • Hash-Mode 100 (SHA1)

Speed.#1.........: 145.0 MH/s (55.78ms) @ Accel:256 Loops:256 Thr:128 Vec:1


  • Hash-Mode 1400 (SHA2-256)

Speed.#1.........: 61307.4 kH/s (66.80ms) @ Accel:1024 Loops:256 Thr:16 Vec:1


  • Hash-Mode 1700 (SHA2-512)

Speed.#1.........: 16102.9 kH/s (63.41ms) @ Accel:2048 Loops:64 Thr:8 Vec:1


  • Hash-Mode 22000 (WPA-PBKDF2-PMKID+EAPOL) [Iterations: 4095]

Speed.#1.........: 6763 H/s (74.02ms) @ Accel:64 Loops:256 Thr:128 Vec:1


  • Hash-Mode 1000 (NTLM)

Speed.#1.........: 652.8 MH/s (47.69ms) @ Accel:2048 Loops:512 Thr:32 Vec:1


  • Hash-Mode 3000 (LM)

Speed.#1.........: 320.0 MH/s (83.89ms) @ Accel:256 Loops:1024 Thr:128 Vec:1


  • Hash-Mode 5500 (NetNTLMv1 / NetNTLMv1+ESS)

Speed.#1.........: 413.4 MH/s (78.42ms) @ Accel:2048 Loops:512 Thr:32 Vec:1


  • Hash-Mode 5600 (NetNTLMv2)

Speed.#1.........: 31332.5 kH/s (64.28ms) @ Accel:256 Loops:64 Thr:128 Vec:1

@VadimMuhtarov
Copy link
Author

Now it works on my new M2 Mac. I think we can close it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants