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

OpenCL formats failing (or emitting new warnings) on recent nvidia driver versions. #5542

Closed
magnumripper opened this issue Sep 24, 2024 · 4 comments
Assignees

Comments

@magnumripper
Copy link
Member

So I tested all OpenCL formats on nvidia 560.35.03 / OpenCL 3.0 CUDA 12.6.65. Nearly every kernel emitted the bogus "Warning: Function [...] is a kernel, so overriding noinline attribute" as seen in #5456.

Oddly enough, these did not:

Testing: electrum-modern-opencl, Electrum Wallet 2.8+ [PBKDF2-SHA512 OpenCL]... (8xOMP) PASS
Testing: krb5asrep-aes-opencl, Kerberos 5 AS-REP etype 17/18 [PBKDF2-SHA1 OpenCL]... PASS
Testing: krb5tgs-sha1-opencl, Kerberos 5 TGS-REP etype 17/18 [PBKDF2-SHA1 AES-CTS OpenCL]... PASS
Testing: lpcli-opencl, LastPass CLI [PBKDF2-SHA256 AES OpenCL]... PASS
Testing: PBKDF2-HMAC-SHA512-opencl, GRUB2 / OS X 10.8+ [PBKDF2-SHA512 OpenCL]... PASS

Two of my newest formats emitted other warnings that may or may not be valid, I did not see them before so will investigate.

I guess (though didn't look yet) the first one is more or less valid and can be easily fixed:

Testing: streebog256crypt-opencl, Astra Linux $gost12256hash$ (rounds=5000) [GOST R 34.11-2012 OpenCL]... 6 warnings generated.
<kernel>:99:30: warning: incompatible pointer types passing 'uint256_u *' to parameter of type 'uint512_u *'
        GOST34112012Final(&alt_ctx, &result, loc_buf);
                                    ^~~~~~~
opencl/opencl_streebog.h:951:56: note: passing argument to parameter 'digest' here
GOST34112012Final(GOST34112012Context *CTX, uint512_u *digest, __local localbuf *loc_buf)
                                                       ^
<kernel>:119:26: warning: incompatible pointer types passing 'uint256_u *' to parameter of type 'uint512_u *'
        GOST34112012Final(&ctx, &result, loc_buf);
                                ^~~~~~~
opencl/opencl_streebog.h:951:56: note: passing argument to parameter 'digest' here
GOST34112012Final(GOST34112012Context *CTX, uint512_u *digest, __local localbuf *loc_buf)
                                                       ^
<kernel>:129:30: warning: incompatible pointer types passing 'uint256_u *' to parameter of type 'uint512_u *'
        GOST34112012Final(&alt_ctx, &temp_result, loc_buf);
                                    ^~~~~~~~~~~~
opencl/opencl_streebog.h:951:56: note: passing argument to parameter 'digest' here
GOST34112012Final(GOST34112012Context *CTX, uint512_u *digest, __local localbuf *loc_buf)
                                                       ^
<kernel>:152:30: warning: incompatible pointer types passing 'uint256_u *' to parameter of type 'uint512_u *'
        GOST34112012Final(&alt_ctx, &temp_result, loc_buf);
                                    ^~~~~~~~~~~~
opencl/opencl_streebog.h:951:56: note: passing argument to parameter 'digest' here
GOST34112012Final(GOST34112012Context *CTX, uint512_u *digest, __local localbuf *loc_buf)
                                                       ^
<kernel>:230:27: warning: incompatible pointer types passing 'uint256_u *' to parameter of type 'uint512_u *'
                GOST34112012Final(&ctx, &result, loc_buf);
                                        ^~~~~~~
opencl/opencl_streebog.h:951:56: note: passing argument to parameter 'digest' here
GOST34112012Final(GOST34112012Context *CTX, uint512_u *digest, __local localbuf *loc_buf)
                                                       ^
<kernel>:298:27: warning: incompatible pointer types passing 'uint256_u *' to parameter of type 'uint512_u *'
                GOST34112012Final(&ctx, &result, loc_buf);
                                        ^~~~~~~
opencl/opencl_streebog.h:951:56: note: passing argument to parameter 'digest' here
GOST34112012Final(GOST34112012Context *CTX, uint512_u *digest, __local localbuf *loc_buf)
                                                       ^

The second one looks like a bogus problem very similar to #5456:

Testing: gost94crypt-opencl, Astra Linux $gost94hash$ (rounds=5000) [GOST R 34.11-94 OpenCL]... 5 warnings generated.
In file included from <kernel>:13:
opencl/opencl_gost94.h:311:3: warning: static function 'rhash_gost94_compute_sum_and_hash' is used in an inline function with external linkage
                rhash_gost94_compute_sum_and_hash(ctx, (uint*)ctx->message, sbox);
                ^
opencl/opencl_gost94.h:298:1: note: use 'static' to give inline function 'gost94_update' internal linkage
inline void gost94_update(gost94_ctx *ctx, const uchar* msg, uint size, MAYBE_LOCAL const rhash_gost94_sbox *sbox)
^
static
opencl/opencl_gost94.h:264:13: note: 'rhash_gost94_compute_sum_and_hash' declared here
static void rhash_gost94_compute_sum_and_hash(gost94_ctx * ctx, const uint* block, MAYBE_LOCAL const rhash_gost94_sbox *sbox)
            ^
opencl/opencl_gost94.h:326:3: warning: static function 'rhash_gost94_compute_sum_and_hash' is used in an inline function with external linkage
                rhash_gost94_compute_sum_and_hash(ctx, aligned_message_block, sbox);
                ^
opencl/opencl_gost94.h:298:1: note: use 'static' to give inline function 'gost94_update' internal linkage
inline void gost94_update(gost94_ctx *ctx, const uchar* msg, uint size, MAYBE_LOCAL const rhash_gost94_sbox *sbox)
^
static
opencl/opencl_gost94.h:264:13: note: 'rhash_gost94_compute_sum_and_hash' declared here
static void rhash_gost94_compute_sum_and_hash(gost94_ctx * ctx, const uint* block, MAYBE_LOCAL const rhash_gost94_sbox *sbox)
            ^
opencl/opencl_gost94.h:367:3: warning: static function 'rhash_gost94_compute_sum_and_hash' is used in an inline function with external linkage
                rhash_gost94_compute_sum_and_hash(ctx, msg32, sbox);
                ^
opencl/opencl_gost94.h:359:1: note: use 'static' to give inline function 'gost94_final' internal linkage
inline void gost94_final(gost94_ctx *ctx, uchar *result, MAYBE_LOCAL const rhash_gost94_sbox *sbox)
^
static
opencl/opencl_gost94.h:264:13: note: 'rhash_gost94_compute_sum_and_hash' declared here
static void rhash_gost94_compute_sum_and_hash(gost94_ctx * ctx, const uint* block, MAYBE_LOCAL const rhash_gost94_sbox *sbox)
            ^
opencl/opencl_gost94.h:375:2: warning: static function 'rhash_gost94_block_compress' is used in an inline function with external linkage
        rhash_gost94_block_compress(ctx, msg32, sbox);
        ^
opencl/opencl_gost94.h:359:1: note: use 'static' to give inline function 'gost94_final' internal linkage
inline void gost94_final(gost94_ctx *ctx, uchar *result, MAYBE_LOCAL const rhash_gost94_sbox *sbox)
^
static
opencl/opencl_gost94.h:122:13: note: 'rhash_gost94_block_compress' declared here
static void rhash_gost94_block_compress(gost94_ctx *ctx, const uint* block, MAYBE_LOCAL const rhash_gost94_sbox *sbox)
            ^
opencl/opencl_gost94.h:376:2: warning: static function 'rhash_gost94_block_compress' is used in an inline function with external linkage
        rhash_gost94_block_compress(ctx, ctx->sum, sbox);
        ^
opencl/opencl_gost94.h:359:1: note: use 'static' to give inline function 'gost94_final' internal linkage
inline void gost94_final(gost94_ctx *ctx, uchar *result, MAYBE_LOCAL const rhash_gost94_sbox *sbox)
^
static
opencl/opencl_gost94.h:122:13: note: 'rhash_gost94_block_compress' declared here
static void rhash_gost94_block_compress(gost94_ctx *ctx, const uint* block, MAYBE_LOCAL const rhash_gost94_sbox *sbox)
            ^

Only two formats failed, that is a relief:

Testing: cryptosafe-opencl [AES-256-CBC OpenCL]... FAILED (crypt_all(1) zero return)
Testing: krb5pa-md5-opencl, Kerberos 5 AS-REQ Pre-Auth etype 23 [MD4 HMAC-MD5 RC4 OpenCL]... FAILED (crypt_all(1) zero return)

I already found out a silly workaround for cryptosafe (will commit soon but unsure how to #ifdef it). I'll look into the Kerberos format too.

@magnumripper magnumripper self-assigned this Sep 24, 2024
@solardiz
Copy link
Member

Testing: krb5pa-md5-opencl, Kerberos 5 AS-REQ Pre-Auth etype 23 [MD4 HMAC-MD5 RC4 OpenCL]... FAILED (crypt_all(1) zero return)

This or at least same-looking failure was also seen on AMD GPUs recently in #5522 (comment) and #3572 (comment)

@magnumripper
Copy link
Member Author

Only two formats failed, that is a relief:

Testing: cryptosafe-opencl [AES-256-CBC OpenCL]... FAILED (crypt_all(1) zero return)
Testing: krb5pa-md5-opencl, Kerberos 5 AS-REQ Pre-Auth etype 23 [MD4 HMAC-MD5 RC4 OpenCL]... FAILED (crypt_all(1) zero return)

Both of these are fixed by #5549 - cryptosafe got a workaround and krb5pa-md5 was apparently healed with the shared RC4 updates.

Interestingly enough, this OP don't mention Tezos. I need to reinstall this 560.35.03 / OpenCL 3.0 CUDA 12.6.65 driver and verify this - if that driver don't have #5546, we should amend #5550 to #if gpu_nvidia(DEVICE_INFO) && DEV_VER_MAJOR > 500 && DEV_VER_MAJOR < 560.

@solardiz
Copy link
Member

solardiz commented Nov 2, 2024

Is this issue fully fixed now? If not, what remains?

@magnumripper
Copy link
Member Author

magnumripper commented Nov 2, 2024

All 100 OpenCL formats now pass self-test. Edit: And no warnings are emitted except the bogus inlining crap. This with 565.57.01 / OpenCL 3.0 CUDA 12.7.33.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants