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

hashcat not using multiple GPUs on MacOS #2083

Closed
singe opened this issue Jul 3, 2019 · 8 comments
Closed

hashcat not using multiple GPUs on MacOS #2083

singe opened this issue Jul 3, 2019 · 8 comments

Comments

@singe
Copy link

singe commented Jul 3, 2019

After commit e3500ff hashcat won't make use of the Intel and AMD GPU on a MBP 2016 running MacOS Mojave 10.14.5.

At the last working commit, running gave:
hashcat (v5.1.0-968-ge3500ff4) starting in benchmark mode...

[snip CUDA warnings ...]

OpenCL Platform #1: Apple
=========================
* Device #1: Intel(R) Core(TM) i7-6820HQ CPU @ 2.70GHz, skipped.
* Device #2: Intel(R) HD Graphics 530, 384/1536 MB allocatable, 24MCU
* Device #3: AMD Radeon Pro 455 Compute Engine, 512/2048 MB allocatable, 12MCU

The first commit that introduces the bad behaviour is 6fd936b), where running gives:

hashcat (v5.1.0-969-g6fd936b4) starting in benchmark mode...

OpenCL API (OpenCL 1.2 (Apr  7 2019 18:38:19)) - Platform #1 [Apple]
====================================================================
* Device #1: Intel(R) Core(TM) i7-6820HQ CPU @ 2.70GHz, skipped
* Device #2: Intel(R) HD Graphics 530, 384/1536 MB allocatable, 24MCU
* Device #3: AMD Radeon Pro 455 Compute Engine, skipped

As you can see only device 2 is used, and the second GPU device 3 is skipped. Device 3 can be forced with -d3, but then device 2 will be skipped. Specifying -d2,3 will just use device 2.

@matrix
Copy link
Member

matrix commented Jul 8, 2019

@singe I have the same issue with a previous version of OSX.
I'll let you know as soon as I understand the cause.

@matrix
Copy link
Member

matrix commented Jul 8, 2019

@singe I found the "bug". Try manually patch src/backend.c and retry (using -D1,2 --force) :

-  //if (user_options->force == false)
-  //{
-  backend_ctx_find_alias_devices (hashcat_ctx);
-  //}
+  if (user_options->force == false)
+  {
+    backend_ctx_find_alias_devices (hashcat_ctx);
+  }

Let me known :)

@matrix
Copy link
Member

matrix commented Jul 11, 2019

@singe could you try to apply PR #2086 patch to check if the bug is out ?
Thanks!

@singe
Copy link
Author

singe commented Jul 14, 2019

Confirmed that fixes the bug, thanks!

@jsteube
Copy link
Member

jsteube commented Aug 6, 2019

Commit 57a1492 should fix this issue. Please check and reopen if it's not working.

@jsteube jsteube closed this as completed Aug 6, 2019
@singe
Copy link
Author

singe commented Jun 17, 2020

Looks like this issue is back with the latest 6.0.0 release and commit. I did a quick check, and applying the same patch @matrix did earlier to allow --force fixes it, so there's no technical reason why it shouldn't work, just looks like an error in the selection logic I haven't had time to dig into yet.

The diff:

diff --git a/src/backend.c b/src/backend.c
index 80fdbb38..e0c9246d 100644
--- a/src/backend.c
+++ b/src/backend.c
@@ -6606,7 +6606,7 @@ int backend_ctx_devices_init (hashcat_ctx_t *hashcat_ctx, const int comptime)
     // using force here enables both devices, which is the worst possible outcome
     // many users force by default, so this is not a good idea
 
-    //if (user_options->force == false)
+    if (user_options->force == false)
     //{
     backend_ctx_find_alias_devices (hashcat_ctx);
     //{

For completeness sake, here's the output from hashcat 5.1.0, 6.0.0 and 6.0.0 with my patch and --force:

5.1.0 (homebrew)

/usr/local/Cellar/hashcat/5.1.0/bin/hashcat -m1000 --benchmark
hashcat (v5.1.0) 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.

OpenCL Platform #1: Apple
=========================
* Device #1: Intel(R) Core(TM) i7-6820HQ CPU @ 2.70GHz, skipped.
* Device #2: Intel(R) HD Graphics 530, 384/1536 MB allocatable, 24MCU
* Device #3: AMD Radeon Pro 455 Compute Engine, 512/2048 MB allocatable, 12MCU

Benchmark relevant options:
===========================
* --optimized-kernel-enable

Hashmode: 1000 - NTLM

Speed.#2.........:   739.5 MH/s (32.47ms) @ Accel:128 Loops:32 Thr:256 Vec:1
Speed.#3.........:  4081.5 MH/s (95.39ms) @ Accel:512 Loops:256 Thr:256 Vec:1
Speed.#*.........:  4821.0 MH/s

Started: Wed Jun 17 13:01:44 2020
Stopped: Wed Jun 17 13:01:55 2020

6.0.0

./hashcat -m1000 --benchmark
hashcat (v6.0.0) 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.

OpenCL API (OpenCL 1.2 (May  3 2020 20:15:19)) - Platform #1 [Apple]
====================================================================
* Device #1: Intel(R) Core(TM) i7-6820HQ CPU @ 2.70GHz, skipped
* Device #2: Intel(R) HD Graphics 530, 1472/1536 MB (384 MB allocatable), 24MCU
* Device #3: AMD Radeon Pro 455 Compute Engine, skipped

Benchmark relevant options:
===========================
* --optimized-kernel-enable

Hashmode: 1000 - NTLM

Speed.#2.........:   669.5 MH/s (73.83ms) @ Accel:1024 Loops:256 Thr:8 Vec:1

Started: Wed Jun 17 13:00:49 2020
Stopped: Wed Jun 17 13:00:54 2020

6.0.0 patched with --force

./hashcat -m1000 --benchmark --force
hashcat (v6.0.0) 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.

You have enabled --force to bypass dangerous warnings and errors!
This can hide serious problems and should only be done when debugging.
Do not report hashcat issues encountered when using --force.
OpenCL API (OpenCL 1.2 (May  3 2020 20:15:19)) - Platform #1 [Apple]
====================================================================
* Device #1: Intel(R) Core(TM) i7-6820HQ CPU @ 2.70GHz, skipped
* Device #2: Intel(R) HD Graphics 530, 1472/1536 MB (384 MB allocatable), 24MCU
* Device #3: AMD Radeon Pro 455 Compute Engine, 1984/2048 MB (512 MB allocatable), 12MCU

Benchmark relevant options:
===========================
* --force
* --optimized-kernel-enable

Hashmode: 1000 - NTLM

Speed.#2.........:   674.1 MH/s (73.28ms) @ Accel:1024 Loops:256 Thr:8 Vec:1
Speed.#3.........:  4171.1 MH/s (95.53ms) @ Accel:1024 Loops:512 Thr:64 Vec:1
Speed.#*.........:  4845.2 MH/s

Started: Wed Jun 17 13:01:06 2020
Stopped: Wed Jun 17 13:01:11 2020

@jsteube
Copy link
Member

jsteube commented Jun 17, 2020

I have no way to reproduce this because I do not have access to an OSX system with AMD GPU. Therefore I can't patch the sources, because I can't reproduce if the patch is actually doing what it should do.

However, the original issue is very different from the problem you have now, because the device is not being ignored but not being selected. IOW, the issue is a very different one, even if it seems the same.

@singe
Copy link
Author

singe commented Jun 17, 2020

Ok, I'll open a new issue. Happy to do some testing when I get some time and try submit a patch.

singe added a commit to singe/hashcat that referenced this issue Jun 22, 2020
This is a repeat of
hashcat@57a1492
which was undone in this commit
34f71aa#diff-7af547b52769371de74af0bfca268a62R6599

The original issue was hashcat#2083 and discussion of a fix was hashcat#2086.

The problem is with Apple devices with an Intel and AMD GPU and using both
simultaneously and the alias check.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants