mirror of
https://github.com/openwall/john.git
synced 2026-12-03 18:45:21 +07:00
[GH-ISSUE #1822] Create a mechanism to benchmark GPU mask mode. #1210
Labels
No labels
bug
core branch
documentation
enhancement
enhancement
fixed - pending verify
fuzz bug
good first issue
invalid
invalid
maintenance/cleanup
new cracking mode
new format
new tool
non-trivial
notes/external issues
portability
question
RFC / discussion
testing
WONTFIX
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
openwall/john#1210
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @ghost on GitHub (Oct 13, 2015).
Original GitHub issue: https://github.com/openwall/john/issues/1822
Since it could be hard to implement a full/regular benchmark for GPU mask mode, I created a hack that might help:
Please, take a look and check if this is desirable, useful and mergeable. Patch,
ec2aa6ccd9ebfcf401bb7caa81a9bd9c8429e672
To use it (skip_self_test is mandatory)
_MASK_MODE_DSV0=1 ../run/john -test -form:raw-sha256-opencl -dev=0 --skip@magnumripper commented on GitHub (Oct 13, 2015):
Maybe instead of using that environment variable, we could let
-test -mask=(...)imply this (and also imply -skip-self-test). I tried something similar a while ago but got stuck with options.c not allowing -test and -mask simultaneously and for some reason I couldn't get past that.That would also mean we can choose any mask we want for benchmarking.
@ghost commented on GitHub (Oct 13, 2015):
Since you got stuck in core code, I will wait to see if you get a way to solve it.
@magnumripper commented on GitHub (Oct 13, 2015):
Should there be any need for per-format code for this? My approach was to simply try to run a hybrid mask-mode code path (and ignore self-test).
@ghost commented on GitHub (Oct 13, 2015):
No. Your approach is much better.
@magnumripper commented on GitHub (Oct 13, 2015):
@claudioandre @Sayantan2048 I think I did it... some testing remains.
You can also specify a mask (including hybrid ones) to see performance for eg. a very short mask.
We might have some tweaking to do. I'm not sure whether all formats actually auto-tune correctly for this feature. NT seems to do so but some salted ones might not. But this should be a good start!
@magnumripper commented on GitHub (Oct 13, 2015):
DEScrypt does not work well with this
LM does get faster, but not optimal speed. I guess both of them currently doesn't auto-tune for mask when this feature is used - some tweaks will be needed.
@ghost commented on GitHub (Oct 13, 2015):
Kudos.
Please, commit in a branch so we can test it.
@magnumripper commented on GitHub (Oct 13, 2015):
It is committed,
4592cc6b@magnumripper commented on GitHub (Oct 13, 2015):
Right now I'm actually never calling
do_mask_crack(word)or anything like that from benchmark_format() - I just init mask mode. Maybe this is not quite sufficient. But we can't call crk_process_key() like we do in a real crack. We may need to write a benchmark version of do_mask_crack().@magnumripper commented on GitHub (Oct 13, 2015):
They do. It's probably the lack of
do_mask_crack()orgenerate_keys()or whatever.@ghost commented on GitHub (Oct 13, 2015):
Seems to be fine. I will change some details in format code and submit.
@magnumripper commented on GitHub (Oct 13, 2015):
500ms is plenty. I think Sayantan aims for 300ms in some format I visited.
@magnumripper commented on GitHub (Oct 13, 2015):
Hold on, I will commit enhancements.
@magnumripper commented on GitHub (Oct 14, 2015):
c8d543cadded more proper handling. We now do calldo_mask_crack()although it's handled a bit different under --test.DEScrypt and LM formats has a weird bug but it appears this is an old bug (using default mask):
Opened a separate issue #1828 for this.
@ghost commented on GitHub (Oct 14, 2015):
I get your point, but remember, I'm always thinking about super --dev=0. Example:
@ghost commented on GitHub (Oct 14, 2015):
Forget it. The solution is more brain and less bla bla bla.
@magnumripper commented on GitHub (Oct 14, 2015):
I also see now 300ms is a bit on the low side for weak GPUs (like my laptop's GT650). But instead of increasing auto-tune time, it should be better to decrease
mask_int_cand_targetfor weak devices.Ideally we should have a simple and fast shared function you could call for a rough "performance class" figure for a device. But what should it return? Perhaps a duration, in ms, for a given speed-test kernel?
@ghost commented on GitHub (Oct 14, 2015):
Indeed. I reduced
mask_int_cand_target. Have to see if/how it will impact strong GPUs.@magnumripper commented on GitHub (Oct 14, 2015):
It's probably hard to find a good compromise. A Titan X can do over 15-20 Gp/s with NT. My laptop can do 0.3 Gp/s.
Also, the lower number for mask_int_cand_target, the less chance for mask mode to find a good multiple (eg. if 95x95 is too high, it has to decrease to just 95, which is too low for a good GPU).
@magnumripper commented on GitHub (Oct 14, 2015):
That "first GWS check in half target time" that Solar added was one of the problems. Fixed in
ce8c882.@magnumripper commented on GitHub (Oct 14, 2015):
I see you had it has 20000 though. You should definitely decrease it to 10000. No other format has over 10000, DEScrypt has just 1024.
@magnumripper commented on GitHub (Oct 14, 2015):
That problem solved canonically in #1831 and some follow-ups 😎