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
Fix #2083: hashcat not using multiple GPUs on MacOS #2086
Conversation
the question I ask myself is if this is really a valid fix. It's good that you identified the root of the problem (thanks, very very good), but an actually good fix would be to try to understand why backend_ctx_find_alias_devices () thinks that 2 different devices are seen as identical/aliases while they are not (at least I think that is the problem here, but please correct me if that's wrong !). We also should consider the comment here: https://github.com/hashcat/hashcat/pull/2086/files#diff-7af547b52769371de74af0bfca268a62R6645 , which really tells us to not use this check |
Hi @philsmd , probably the backend_ctx_find_alias_devices() do something wrong, as you write, but it's not only this functionality to have some issue. I'm waiting the merge of #2075 before start rewriting something. If you have another solution for that problem please do it :) Thanks |
@philsmd this patch make -D1,2 works without set --force but honestly ... I don't even know what this function is for
|
yeah the alias check is trying to find out if the two devices are identical (like using the OpenCL backend together with the CUDA backend and that's only one device, not 2 different devices). This means that is_same_device () doesn't work for your device list, but I'm not sure why.... we would need to troubleshoot why the values for those devices can be the same even if you have different devices (are we even sure that you really have 3 physical different devices ? how can be distinguish them differently by fixing the is_same_device () function ?) |
Why not by the name?
|
These info are not saved because of the CPU type not handled well in backend.c By debugging is_same_device() ..
Here is where these vars are set, but only for GPU devices |
I am not sure, maybe the only thing missing is to add a check for VENDOR_ID_APPLE for the Iris GPU similar to the 2 checks we already have for AMD and Nvidia:
If I understood this correctly, the problem is not the CPU, but the missing assignment of pcie_bus, pcie_device and pcie_function in case of VENDOR_ID_APPLE. So we should fix this instead, I think !? |
Already tried and I got the following error
when I try to retrive these values. Have you a Mac to confirm this? |
@@ -78,7 +82,7 @@ static int backend_ctx_find_alias_devices (hashcat_ctx_t *hashcat_ctx) | |||
{ | |||
if (device_param_dst->skipped == false) | |||
{ | |||
device_param_dst->skipped = true; | |||
device_param_src->skipped = true; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please explain switch to device_param_src?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
because with APPLE the right device is skipped instead of get selected
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK, but will not be needed if fixed based on vendor_id is used.
I'm not 100% certain since I do not have access to OSX to confirm. I think @philsmd is right that for non-nvidia devices the pci-express information is set to zero and the is_same_device () should not be called.
This will work only since the frequency is very likely to be not same for CPU and AMD GPU. It's however not the right way to check it. We should aim to have the most minimal checks. The reason, for instance, is to avoid problems with frequency scaling by GPU bios. These days they change clock speed multiple times per second to save power consumption and it's possible to have a bad outcome if we use it as a reference. @matrix can you please do the change as @philsmd suggested and update the PR? |
I can't because also with APPLE the pci-express info are not set. The only way I found is what I pushed in this patch. Without I don't know how to make it work with APPLE. |
Can you please try and post here what happens if you apply only this patch and nothing else:
This one will work because on Windows and Linux for NV based systems. The opencl_device_vendor_id value is set fixed to VENDOR_ID_NV for backward compatibility with some OpenCL kernel code. I think it will also solve OSX problem. If not, maybe I did not fully understand the problem. |
with APPLE don't work (same vendor_id)
|
What I mean is that for the original issue in #2083 this should fix the issue because of value for vendor_id will be Intel and Apple. The device number 3 will no longer be skipped. For your case it's something completely different and we need to make sure to not confuse this. You have GPU and CPU. In this situation, the CPU should be disabled by default no matter which vendors are involved. That's the way we want it to work. Only if the user sets -D1,2 then both devices should be enabled at the same time. Can you confirm this works? |
The bug it's here, if I set -D1,2 only the first is enabled |
I applied just that patch to the latest commit to master (6ecc662). While it fixes the multiple GPU problem, now nothing cracks:
|
@singe please restart from cloning the official repository (do not apply other PR not jet approved). It should work. |
I’m confused. If master isn’t the official repo, what is?
|
I thought you applied some extra patches :) As soon as I can I do some tests and let you know |
@singe without this hashcat works? |
Commit 57a1492 will replace this PR |
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.
as the title, check the issue #2083 for details