[GH-ISSUE #922] RAKP and NTLMv2 OpenCL formats fails limiting to memory when vectorized #525

Closed
opened 2026-10-14 03:11:59 +07:00 by bsakaguchi · 6 comments
Owner

Originally created by @magnumripper on GitHub (Dec 21, 2014).
Original GitHub issue: https://github.com/openwall/john/issues/922

As of c73c0c2 we use things like

        opencl_init_auto_setup(SEED, 0, NULL,
                warn, 3, self, create_clobj, release_clobj,
                2 * v_width * max_len, gws_limit);

The 2 * accounts for an AMD bug (or feature) when using pinned memory,
The v_width * accunts for vectorizing,
and max_len is the largest buffer allocation (with UTF-8 accounted for if applicable)

Still, they fail auto-tune with eg.

OpenCL error (CL_INVALID_BUFFER_SIZE) in file (opencl_rakp_fmt_plug.c) at line (170) - (Error creating keys_buffer out argument)
Originally created by @magnumripper on GitHub (Dec 21, 2014). Original GitHub issue: https://github.com/openwall/john/issues/922 As of c73c0c2 we use things like ``` opencl_init_auto_setup(SEED, 0, NULL, warn, 3, self, create_clobj, release_clobj, 2 * v_width * max_len, gws_limit); ``` The `2 *` accounts for an AMD bug (or feature) when using pinned memory, The `v_width *` accunts for vectorizing, and `max_len` is the largest buffer allocation (with UTF-8 accounted for if applicable) Still, they fail auto-tune with eg. ``` OpenCL error (CL_INVALID_BUFFER_SIZE) in file (opencl_rakp_fmt_plug.c) at line (170) - (Error creating keys_buffer out argument) ```
bsakaguchi 2026-10-14 03:11:59 +07:00
  • closed this issue
  • added the
    bug
    label
Author
Owner

@magnumripper commented on GitHub (Dec 21, 2014):

@claudioandre you have a Juniper, please get to the bottom of this ;-)

<!-- gh-comment-id:67758557 --> @magnumripper commented on GitHub (Dec 21, 2014): @claudioandre you have a Juniper, please get to the bottom of this ;-)
Author
Owner

@magnumripper commented on GitHub (Dec 21, 2014):

Me thinks the shared code ignores that argument when gws_limit is set. Could that be it?

<!-- gh-comment-id:67758755 --> @magnumripper commented on GitHub (Dec 21, 2014): Me thinks the shared code ignores that argument when gws_limit is set. Could that be it?
Author
Owner

@ghost commented on GitHub (Dec 21, 2014):

I will debug tomorrow, but line 1647 in common-opencl shows it is not ignored.

<!-- gh-comment-id:67758782 --> @ghost commented on GitHub (Dec 21, 2014): I will debug tomorrow, but line 1647 in common-opencl shows it is not ignored.
Author
Owner

@magnumripper commented on GitHub (Dec 21, 2014):

I tried this

diff --git a/src/opencl_rakp_fmt_plug.c b/src/opencl_rakp_fmt_plug.c
index 9d256d2..28338f1 100644
--- a/src/opencl_rakp_fmt_plug.c
+++ b/src/opencl_rakp_fmt_plug.c
@@ -233,6 +233,8 @@ static void init(struct fmt_main *self)
         gws_limit = MIN((1 << 26) * 4 / BUFFER_SIZE,
                         get_max_mem_alloc_size(gpu_id) / BUFFER_SIZE);

+        gws_limit /= v_width;
+
        // create kernel to execute
        crypt_kernel = clCreateKernel(program[gpu_id], "rakp_kernel", &ret_code);
        HANDLE_CLERROR(ret_code, "Error creating kernel");

Did not make a difference. We are missing something simple here.

<!-- gh-comment-id:67758848 --> @magnumripper commented on GitHub (Dec 21, 2014): I tried this ``` diff --git a/src/opencl_rakp_fmt_plug.c b/src/opencl_rakp_fmt_plug.c index 9d256d2..28338f1 100644 --- a/src/opencl_rakp_fmt_plug.c +++ b/src/opencl_rakp_fmt_plug.c @@ -233,6 +233,8 @@ static void init(struct fmt_main *self) gws_limit = MIN((1 << 26) * 4 / BUFFER_SIZE, get_max_mem_alloc_size(gpu_id) / BUFFER_SIZE); + gws_limit /= v_width; + // create kernel to execute crypt_kernel = clCreateKernel(program[gpu_id], "rakp_kernel", &ret_code); HANDLE_CLERROR(ret_code, "Error creating kernel"); ``` Did not make a difference. We are missing something simple here.
Author
Owner

@magnumripper commented on GitHub (Dec 21, 2014):

Fixed in 6548bb1 by fixing the gws_limit calculation.

<!-- gh-comment-id:67778128 --> @magnumripper commented on GitHub (Dec 21, 2014): Fixed in 6548bb1 by fixing the gws_limit calculation.
Author
Owner

@magnumripper commented on GitHub (Dec 21, 2014):

I still don't get why the other limit did not do the trick.

<!-- gh-comment-id:67778302 --> @magnumripper commented on GitHub (Dec 21, 2014): I still don't get why the other limit did not do the trick.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
openwall/john#525
No description provided.