Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAGcw5iRj5HknTjEQ4EZQyLA5OLNtxPaGfbFr4t=g6Ykaqxhi+Q@mail.gmail.com>
Date: Fri, 16 Nov 2012 09:11:27 +0100
From: Marc Brinkmann <marc.brinkmann@...il.com>
To: john-users@...ts.openwall.com
Subject: Re: scalar mode

Thank you for the explanation =) i tried to apply your changes this time.
It is already compiling.
In your office2010.c file i think i forced VF=1
"        if (gpu_nvidia(device_info[ocl_gpu_id]) ||
amd_gcn(device_info[ocl_gpu_id])) {
                /* Run scalar code */
                VF = 1;
        } else {
                /* Run vectorized code */
                VF = 1;
                self->params.algorithm_name = "OpenCL DEBUG";
"

As i'm not sure, how to comment the right part out, i tried to adjust the
kernel like this:

"#ifdef SCALAR
inline uint SWAP32(uint x)
{
        x = rotate(x, 16U);
        return ((x & 0x00FF00FF) << 8) + ((x >> 8) & 0x00FF00FF);
}
#else
{
        x = rotate(x, 16U);
        return ((x & 0x00FF00FF) << 8) + ((x >> 8) & 0x00FF00FF);
}

#endif
"

Oh, it fails :(
"marc@...berd:~/JohnTheRipper/run$ ./john --test --format=office2010-opencl
OpenCL platform 0: AMD Accelerated Parallel Processing, 2 device(s).
Using device 0: Juniper
Compilation log: "/tmp/OCL2cJ41l.cl", line 29: error: expected a declaration
  {
  ^

"/tmp/OCL2cJ41l.cl", line 395: error: function "SWAP32" declared implicitly
                block[i] = SWAP32(salt[i]);
                           ^

"/tmp/OCL2cJ41l.cl", line 397: error: function "SWAP32" declared implicitly
                block[i] = SWAP32(unicode_pw[gid * (UNICODE_LENGTH>>2) + i
- 4]);
                           ^

"/tmp/OCL2cJ41l.cl", line 406: error: function "SWAP32" declared implicitly
                        block[i] = SWAP32(unicode_pw[gid *
(UNICODE_LENGTH>>2) + i + 12]);
                                   ^

"/tmp/OCL2cJ41l.cl", line 441: error: function "SWAP32" declared implicitly
                block[0] = SWAP32(base + j);
                           ^

"/tmp/OCL2cJ41l.cl", line 478: error: function "SWAP32" declared implicitly
                block[0] = SWAP32(base + j);
                           ^

"/tmp/OCL2cJ41l.cl", line 508: error: function "SWAP32" declared implicitly
                key[gid * 4 * 32/4 + i] = SWAP32(output[i].s0);
                                          ^

"/tmp/OCL2cJ41l.cl", line 531: error: function "SWAP32" declared implicitly
                key[gid * 4 * 32/4 + 16/4 + i] = SWAP32(output[i].s0);
                                                 ^

8 errors detected in the compilation of "/tmp/OCL2cJ41l.cl".

Internal error: clc compiler invocation failed.

Error building kernel. Returned build code: -11. DEVICE_INFO=4162
OpenCL error (CL_BUILD_PROGRAM_FAILURE) in file (common-opencl.c) at line
(151) - (clBuildProgram failed.)
marc@...berd:~/JohnTheRipper/run$
"

I guess i simplay wait for your patch, as the older version is running fine.
Sorry, that it is not working :(

BR Marc

2012/11/16 magnum <john.magnum@...hmail.com>

> On 16 Nov, 2012, at 7:00 , Marc Brinkmann <marc.brinkmann@...il.com>
> wrote:
> > Based on our discussion here
> >
> https://github.com/magnumripper/JohnTheRipper/commit/6a3aa3c7ffa148e9a24d52039609bcb5fb444b84
> ;
> > may i kindly ask you to repeat the instrctions for scalar mode?
> >
> > I just joind the Mailinglist some weeks ago, and i cannot even find via
> > google, what you are refereing to.
> >
> > I only find that post from john-dev but honestly, i don't know what do i
> > need to perform to enable scalar mode
> > http://www.openwall.com/lists/john-dev/2012/09/26/2
>
>
> The post you mention does show the two code blocks involved, but I meant
> this:
> http://www.openwall.com/lists/john-users/2012/11/09/3
>
> But I can re-write it a little longer here: The Office 2007/2010 OpenCL
> formats will currently run in scalar mode on nvidias and on AMD GCN
> (Tahiti), because scalar mode faster on those. On everything else (ie. CPU
> or older AMD's) they will currently use vectorizing. Due to register
> pressure, Office2013 will currently only run vectorized on CPU, not on any
> GPU. When vectorized mode is used, the format name is printed with "[OpenCL
> 4x]" as opposed to just "[OpenCL]".
>
> To force scalar mode, you need to edit the host source (eg.
> src/opencl_office2010_fmt.c), search for "VF = 4" and comment out (or #if
> 0...#endif) that whole conditional block, so VF is never changed from its
> initial value of 1. Then you need to edit the corresponding OpenCL kernel
> (eg. src/opencl/office2010_kernel.cl) and modify the very first #ifdef so
> that we always #define SCALAR. Then re-build and retry. Please report the
> outcome.
>
> Or, just wait until tomorrow and I'll post a patch that adds two options
> to GPU builds of JtR: --request-scalar and --request-vectorized. This will
> let you do it without hacking the code. With some luck this will also let
> me find any bug in my code (forcing vectorized on the Tahiti just to
> trigger the bug) but I strongly suspect we are dealing with driver bugs
> here as usual.
>
> magnum
>

Powered by blists - more mailing lists

Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.