mirror of
https://github.com/openwall/john.git
synced 2026-12-03 18:45:21 +07:00
[GH-ISSUE #899] DEScrypt-opencl "goto" tweaks #503
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#503
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 @magnumripper on GitHub (Dec 17, 2014).
Original GitHub issue: https://github.com/openwall/john/issues/899
Originally assigned to: @sayan1an on GitHub.
I am temporarily dropping DEScrypt-opencl from its "hidden" state, disabled in john.conf (it works but is excluded from format enumeration and eg --test) so we do not miss it while testing things.
If we can't get recent AMD drivers to accept the goto spaghetti, we have to disable it again for the J1 release. It would be very nice not to.
I'm assaigning this to @Sayantan2048 but I will do some testing/experiments on my own too.
@sayan1an commented on GitHub (Dec 17, 2014):
The goto s are used to avoid some extra instructions for performance improvement. Since the latest drivers can't digest goto, I'll write a separate compile time path for such devices. On the other hand, my 7970 seems to work fine with 14.9 driver. So, it would be nice if we can isolate devices that can't handle goto; a compile time macro would be helpful.
I'll post a patch by this weekend.
@magnumripper commented on GitHub (Dec 17, 2014):
I think any nvidia I've tried can run it as-is. I've seen problems with R9 290X on 14.6 and 14.9 iirc.
@magnumripper commented on GitHub (Dec 18, 2014):
Also, there is now a (released) Catalyst 14.12 "Omega" driver. I haven't tried it at all yet but Atom doesn't seem to love it...
I wonder if there is some macros (documented or not) for telling the exact version of AMD driver at run-time build of kernel. That would be reallly nice.
@magnumripper commented on GitHub (Dec 18, 2014):
This is slightly OT but in http://developer.amd.com/wordpress/media/2013/07/AMD_Accelerated_Parallel_Processing_OCL_Programming_Guide-2013-06-21.pdf section A.8.12, I found this:
The following macros are predefined when compiling OpenCLTM C kernels. These macros are defined automatically based on the device for which the code is being compiled.
Note that
__GPU__or__CPU__are predefined whenever a GPU or CPU device is the compilation target.@frank-dittrich commented on GitHub (Dec 18, 2014):
On 12/18/2014 01:48 AM, magnum wrote:
Just read http://techreport.com/forums/viewtopic.php?f=3&t=99272
| The Catalyst Omega special edition driver is the biggest and the best
software upgrade AMD has released this year. It’s our way of saying
‘Thank you’ for providing your feedback by using our Issue Reporting
Form all along…very helpful.
May be they like bug reports so much that they provided their user base
new opportunities for bug reports.
But may be OpenCL 2.0 with "Shared Virtual Memory" and "Dynamic
Parallelism" really help for performance.
http://support.amd.com/en-us/kb-articles/Pages/OpenCL2-Driver.aspx
Compatible Operating Systems
The AMD OpenCL 2.0 driveris designed to support the following platforms:
@sayan1an commented on GitHub (Dec 18, 2014):
I just installed the omega driver on desktop and it doesn't seem to produce the 'goto: irreducible control flow' warning produced by previous drivers.
@sayan1an commented on GitHub (Dec 18, 2014):
Will it be possible to give me remote access to devices which fails specifically due to goto ? Most likely goto at line number 329 is causing problem. All other goto/s should be harmless.
@sayan1an commented on GitHub (Dec 18, 2014):
Please test the two latest commits on branch 'descrypt-test-amd' on amd devices that don't support goto.
@magnumripper commented on GitHub (Dec 18, 2014):
I can test on 290X with 14.9 tomorrow.
@magnumripper commented on GitHub (Dec 18, 2014):
FWIW I see one difference on my Macbook's HD Graphics 4000 device: It failed building the kernel prior to these patches. With first patch applied (9e42ad9) it does build and works fine (no great speed but this device is very weak). But with second patch (709df4f) applied too, it again fails building.
The nvidia GT 650M can build all three versions with no warnings. Original speed (one salt) 2259K, first patch 2131K, second patch 2496K. The relative speeds are probably representative for stronger Kepler cards too.
The CPU device can build all three versions with no warnings and speed did not change (maybe it uses another kernel that was not changed?).
@magnumripper commented on GitHub (Dec 19, 2014):
I probably can't test this patch on serious hardware until next week. @claudioandre could you try these patches on your Juniper with 14.12? Either with just first one applied, or both. BTW does 14.12 just complain about control flow, or does it bail out building?
@magnumripper commented on GitHub (Dec 19, 2014):
@Sayantan2048 perhaps you should make a patch with all three versions in there at once, and we could select them with some -DDEFINE from host code depending on driver version and/or other criteria.
Theoretically we could even try to build the fastest version, and instead of crashing when build fails we could revert to a safer code and try building again.
@magnumripper commented on GitHub (Dec 19, 2014):
Obviously it would suffice with just the two newer versions, not the original.
@sayan1an commented on GitHub (Dec 19, 2014):
On Fri, Dec 19, 2014 at 5:32 PM, magnum notifications@github.com wrote:
Okay, will do. For now I'll be forcing 290X(ifdef Hawaii, if it is even
defined) and intel to follow patch1. Rest will follow patch2.
Regards,
Sayantan
@ghost commented on GitHub (Dec 19, 2014):
1st patch (https://raw.githubusercontent.com/magnumripper/JohnTheRipper/9e42ad9fb4dc27a724ea8b82f6159c59c9600c8c/src/opencl/DES_bs_kernel.cl)
2nd patch
(https://raw.githubusercontent.com/magnumripper/JohnTheRipper/709df4f0bd03e05932632f6faa83e0d136a4465e/src/opencl/DES_bs_kernel.cl)
@magnumripper commented on GitHub (Dec 19, 2014):
Here is a patch for the kernel (I could create it semi automagically from the two versions)
@magnumripper commented on GitHub (Dec 19, 2014):
(that patch is for bleeding-jumbo, it's patch1 plus optionally patch2 in one.)
@magnumripper commented on GitHub (Dec 19, 2014):
So instead of
We'd just put
@magnumripper commented on GitHub (Dec 19, 2014):
That if should be negated. Edited the above.
@sayan1an commented on GitHub (Dec 19, 2014):
Cool. Please go ahead.
On Fri, Dec 19, 2014 at 6:16 PM, magnum notifications@github.com wrote:
@magnumripper commented on GitHub (Dec 19, 2014):
OK, committed to bleeding as
a9006a8, in your name of course.@magnumripper commented on GitHub (Dec 19, 2014):
For some (other) reason, the Juniper on
SuperWell fails with or without this patch :-(. The other two devices got slightly faster now.@sayan1an commented on GitHub (Dec 19, 2014):
I'm looking into it.
On Fri, Dec 19, 2014 at 6:32 PM, magnum notifications@github.com wrote:
@sayan1an commented on GitHub (Dec 19, 2014):
I'm also logged in to super. I'll be only testing juniper though!
On Fri, Dec 19, 2014 at 6:35 PM, Sayantan Datta std2048@gmail.com wrote:
@magnumripper commented on GitHub (Dec 19, 2014):
I wrote Super but I meant Well. Super only has Tahitis
@magnumripper commented on GitHub (Dec 19, 2014):
This patch works fine on Bull. Slightly faster on the GTX570. For some reason it did not show any speed difference on the Tahiti
@sayan1an commented on GitHub (Dec 19, 2014):
Oops! Now logged into right machine!
On Fri, Dec 19, 2014 at 6:40 PM, magnum notifications@github.com wrote:
@magnumripper commented on GitHub (Dec 19, 2014):
On Super though, both the Tahiti and the Titan got 2-5% faster
@magnumripper commented on GitHub (Dec 19, 2014):
Once we fix #909 we can do a much better choice, depending on driver version and not just device. I will look into that logic.
@magnumripper commented on GitHub (Dec 19, 2014):
OK #909 is fixed. Now we can use DEV_VER_MAJOR and DEV_VER_MINOR for selecting. For Catalyst 14.9 the driver version is 1573.4 so DEV_VER_MAJOR is 1573 and DEV_VER_MINOR is 4 but we can probably ignore the minor.
@magnumripper commented on GitHub (Dec 19, 2014):
So we need to establish which device/version combinations do fail with "fast goto". I think Hawaii fails with 14.9 but I will double check that first. Claudio reported that it failed building with Juniper and (I think) 14.12.
@sayan1an commented on GitHub (Dec 19, 2014):
I have been juggling around the code for a while but couldn't get it running on Juniper. I tried to eliminate some of the peculiarities and other potential sources of errors but nothing!! I don't think we should spend any more time on this.
@magnumripper commented on GitHub (Dec 19, 2014):
How very very stupid:__HAWAII__is not defined on 290X. At least not with 14.9. Why am I not surprised?It's
__Hawaii__, not__HAWAII__!!GTX 980 on 343.22 works fine with either of the three versions.
"safe goto": Used 159 registers, 15876 bytes smem, 348 bytes cmem[0]
"fast goto": Used 72 registers, 15876 bytes smem, 348 bytes cmem[0]
Despite (or because of?) the more register use, the "safe goto" version is definitely faster. 7% for one salt and 16% for many salts. So
72240d7fpicks the "safe" kernel for nvidia.290X on 14.9 (1573.4) needs the "safer" kernel (67482K/28835K c/s) or crashes while building. It is very strange that your Tahiti is different, they are essentially the same except for number of cores.
@magnumripper commented on GitHub (Dec 19, 2014):
It may be that only nvidia's GM204 likes the "safe" kernel. My Kepler and Super's Titan is a bit faster using the "fast" kernel.
@magnumripper commented on GitHub (Dec 19, 2014):
It may be that I tried
__HAWAII__but not__Hawaii__, so I will have to re-check that later.@magnumripper commented on GitHub (Dec 21, 2014):
707325atweaks it a little. I had it as__TAHITI__but it should be__Tahiti__. And only Maxwell is faster with the "safe" kernel, not Kepler or Fermi.@magnumripper commented on GitHub (Dec 29, 2014):
That was it. PEBCAK. All those device name macros are capitalized lowercase as in
__Juniper__