-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
Doesn't find OpenMP on macOS (though libomp is installed) #5511
Comments
There are several (non-)issues here.
|
Thanks for reaching out!
PS! Adding a stopwatch timestamp at the beginning of each debug line would make it easier to see/share performance! |
That's wrong conclusion - like I wrote, only 1 out of 3 things is supposed to be cached, so the runs would remain slow overall, yet some caching would occur. That's by design. Since the auto-tuning is usually the slowest part, no wonder setting explicit LWS/GWS removes most of the delay for you.
OK, apparently Apple still provides only crippled clang in Xcode. This has some answers: https://stackoverflow.com/questions/71061894/how-to-install-openmp-on-mac-m1 We also have binary builds in https://github.com/openwall/john-packages/releases - I think these are with OpenMP. I don't use macOS myself. |
@solardiz: If you're on another OS and out of ideas, hope someone on macOS can chip in, for optimal performance. |
As some people on that StackOverflow wrote, you may need to use e.g. |
@claudioandre-br Maybe you want to comment on how we're doing our CI builds for macOS - with OpenMP, right? |
|
You can force it to a plain |
Yes, OpenMP on"default" clang. The Version: 1.9.0-jumbo-1+bleeding-f9fedd238b 2024-04-01 13:35:37 +0200
Build: darwin23.5.0 64-bit arm ASIMD AC OMP OPENCL
SIMD: ASIMD, interleaving: MD4:2 MD5:2 SHA1:1 SHA256:1 SHA512:1
OMP fallback binary: john-arm64
$JOHN is ../run/
[...]
Max. Markov mode password length: 30
clang version: 15.0.0 (clang-1500.3.9.4) (gcc 4.2.1 compatibility)
OpenCL headers version: 1.2
Crypto library: OpenSSL
OpenSSL library version: 030300010
OpenSSL 3.3.1 4 Jun 2024
GMP library version: 6.3.0
[...] Build on:
|
@claudioandre-br In other words, you're saying we get OpenMP with the exact same clang version that @forthrin also has, but does not get OpenMP with? Are we perhaps installing something from Homebrew to get this to work? BTW, we have |
@claudioandre-br: Ah! I see this is actually thoroughly described at the bottom of DOC/INSTALL. Should have read the whole thing. Maybe
Happy to say Closing up:
... or is it generally recommended to make such with a scripting language in advance? (Had a look at the mask and rules docs, but couldn't really figure out eg. combining two words.) |
Yes. See the There is some related magic and Google-sama might have an explanation on the matter. By the way: the order of the arguments is important. |
Should we possibly get this into the main project here, perhaps as a change to When linking to specific line numbers, let's also link to specific revisions - GitHub substitutes it when you press if [[ "$TARGET_ARCH" == *"macOS"* ]]; then
SYSTEM_WIDE=''
REGULAR="$SYSTEM_WIDE $ASAN $BUILD_OPTS"
NO_OPENMP="--disable-openmp $SYSTEM_WIDE $ASAN $BUILD_OPTS"
#Libraries and Includes
if [[ "$TARGET_ARCH" == *"macOS X86"* ]]; then
MAC_LOCAL_PATH="usr/local/opt"
else
MAC_LOCAL_PATH="opt/homebrew/opt"
fi
LDFLAGS_ssl="-L/$MAC_LOCAL_PATH/openssl/lib"
LDFLAGS_gmp="-L/$MAC_LOCAL_PATH/gmp/lib"
LDFLAGS_omp="-L/$MAC_LOCAL_PATH/libomp/lib -lomp"
CFLAGS_ssl="-I/$MAC_LOCAL_PATH/openssl/include"
CFLAGS_gmp="-I/$MAC_LOCAL_PATH/gmp/include"
CFLAGS_omp="-I/$MAC_LOCAL_PATH/libomp/include"
if [[ $TARGET_ARCH == *"macOS ARM"* ]]; then
brew link openssl --force
fi
if [[ $TARGET_ARCH == *"macOS X86"* ]]; then
do_configure "$NO_OPENMP" --enable-simd=avx && do_build ../run/john-avx
do_configure "$REGULAR" --enable-simd=avx LDFLAGS="$LDFLAGS_omp" CPPFLAGS="-Xclang -fopenmp $CFLAGS_omp -DOMP_FALLBACK_BINARY=\"\\\"john-avx\\\"\" " && do_build ../run/john-avx-omp
do_configure "$NO_OPENMP" --enable-simd=avx2 && do_build ../run/john-avx2
do_configure "$REGULAR" --enable-simd=avx2 LDFLAGS="$LDFLAGS_omp" CPPFLAGS="-Xclang -fopenmp $CFLAGS_omp -DOMP_FALLBACK_BINARY=\"\\\"john-avx2\\\"\" -DCPU_FALLBACK_BINARY=\"\\\"john-avx-omp\\\"\" " && do_build ../run/john-avx2-omp
BINARY="john-avx2-omp"
else
do_configure "$NO_OPENMP" LDFLAGS="$LDFLAGS_ssl $LDFLAGS_gmp" CPPFLAGS="$CFLAGS_ssl $CFLAGS_gmp" && do_build "../run/john-$arch"
do_configure "$REGULAR" LDFLAGS="$LDFLAGS_ssl $LDFLAGS_gmp $LDFLAGS_omp" CPPFLAGS="-Xclang -fopenmp $CFLAGS_ssl $CFLAGS_gmp $CFLAGS_omp -DOMP_FALLBACK_BINARY=\"\\\"john-$arch\\\"\" " && do_build ../run/john-omp
BINARY="john-omp"
fi
do_release "No" "Yes" $BINARY # --system-wide, --support-opencl, --binary-name
fi |
Maybe what we have now isn't that bad - it's same iteration count. I don't recall what effect on speeds the version has for the same iteration count. Looking at the test vectors we currently have, there aren't any two that look the same anyway - they all have data of different lengths.
|
Those are implementations of hashes that are too fast for efficient scaling with our current use of OpenMP. We recommend usage of
This varies. I'd normally use John itself, but for complicated cases such as yours it may take non-trivial configuration or/and multiple invocations of it. Here's a start, but then you need to write rule sets and likely use two invocations, piping intermediate list between them:
I'd have greater motivation to spend time on a more complete answer if we were discussing this on the john-users list, but here it's just not worth my time. |
@solardiz: Good you're focusing your valuable time. Happy that OP segued into worthwhile compilation issues. Ping me for testing. Thanks for your help and keep up the great work! PS! If the mailing list was moved to "Discussions" at some point that would be convenient! |
Using OpenCL formats is much faster than its CPU counterparts, but they seem to have something of a one minute startup penalty. (Accordingly, when running an actual crack, nothing happens until after about one minute.) Is this:
The text was updated successfully, but these errors were encountered: