[GH-ISSUE #2215] sha512crypt-opencl fails self tests on NVidia hardware #1474

Closed
opened 2026-10-15 04:18:16 +07:00 by bsakaguchi · 12 comments
Owner

Originally created by @crioux on GitHub (Aug 16, 2016).
Original GitHub issue: https://github.com/openwall/john/issues/2215

SHA512 kernel is missing a few #pragma unpacks that are present on the SHA256 opencl kernel.
The result is my GTX 980 was failing self tests for sha512crypt-opencl. Adding the #pragma unpacks caused it to 'work for me'.

The patch for this is on my jtrdll fork, here:
github.com/L0phtCrack/jtrdll@6164472196

Originally created by @crioux on GitHub (Aug 16, 2016). Original GitHub issue: https://github.com/openwall/john/issues/2215 SHA512 kernel is missing a few #pragma unpacks that are present on the SHA256 opencl kernel. The result is my GTX 980 was failing self tests for sha512crypt-opencl. Adding the #pragma unpacks caused it to 'work for me'. The patch for this is on my jtrdll fork, here: https://github.com/L0phtCrack/jtrdll/commit/61644721965b81f836eb5b49f784194fe8cb9d6e
bsakaguchi 2026-10-15 04:18:16 +07:00
Author
Owner

@magnumripper commented on GitHub (Aug 16, 2016):

You mean unrolls. This really shouldn't make any device fail - it should only affect speed. Likely an nvidia driver bug.

Anyway we might want to merge your patch but I'm not sure whether it was left out on purpose or not. @claudioandre this is yours, right?

<!-- gh-comment-id:240099408 --> @magnumripper commented on GitHub (Aug 16, 2016): You mean unrolls. This really shouldn't make any device fail - it should only affect speed. Likely an nvidia driver bug. Anyway we might want to merge your patch but I'm not sure whether it was left out on purpose or not. @claudioandre this is yours, right?
Author
Owner

@magnumripper commented on GitHub (Aug 16, 2016):

Oh and @crioux what nvidia driver version did you use when it failed?

<!-- gh-comment-id:240099699 --> @magnumripper commented on GitHub (Aug 16, 2016): Oh and @crioux what nvidia driver version did you use when it failed?
Author
Owner

@crioux commented on GitHub (Aug 16, 2016):

Yea, oops, I meant unroll. An it's Nvidia driver version 368.81

Platform #0 name: AMD Accelerated Parallel Processing, version: OpenCL 2.0 AMD-APP (2117.9)
    Device #0 (0) name:     AMD FX(tm)-8350 Eight-Core Processor
    Device vendor:          AuthenticAMD
    Device type:            CPU (LE)
    Device version:         OpenCL 1.2 AMD-APP (2117.9)
    Driver version:         2117.9 (sse2,avx,fma4)
    Native vector widths:   char 16, short 8, int 4, long 2
    Preferred vector width: char 16, short 8, int 4, long 2
    Global Memory:          31.0 GB
    Global Memory Cache:    16.0 KB
    Local Memory:           32.0 KB (Global)
    Max memory alloc. size: 7.0 GB
    Max clock (MHz):        4018
    Profiling timer res.:   69 ns
    Max Work Group Size:    1024
    Parallel compute cores: 8
    Speed index:            128576
    PCI device topology:

Platform #1 name: NVIDIA CUDA, version: OpenCL 1.2 CUDA 8.0.0
    Device #0 (1) name:     GeForce GTX 980
    Device vendor:          NVIDIA Corporation
    Device type:            GPU (LE)
    Device version:         OpenCL 1.2 CUDA
    Driver version:         368.81
    Native vector widths:   char 1, short 1, int 1, long 1
    Preferred vector width: char 1, short 1, int 1, long 1
    Global Memory:          4.0 GB
    Global Memory Cache:    256.2 KB
    Local Memory:           48.0 KB (Local)
    Max memory alloc. size: 1024.0 MB
    Max clock (MHz):        1329
    Profiling timer res.:   1000 ns
    Max Work Group Size:    1024
    Parallel compute cores: 16
    Speed index:            21264
    Warp size:              32
    Max. GPRs/work-group:   65536
    Kernel exec. timeout:   yes
    PCI device topology:

Detected xop instruction set
<!-- gh-comment-id:240104271 --> @crioux commented on GitHub (Aug 16, 2016): Yea, oops, I meant unroll. An it's Nvidia driver version 368.81 ``` Platform #0 name: AMD Accelerated Parallel Processing, version: OpenCL 2.0 AMD-APP (2117.9) Device #0 (0) name: AMD FX(tm)-8350 Eight-Core Processor Device vendor: AuthenticAMD Device type: CPU (LE) Device version: OpenCL 1.2 AMD-APP (2117.9) Driver version: 2117.9 (sse2,avx,fma4) Native vector widths: char 16, short 8, int 4, long 2 Preferred vector width: char 16, short 8, int 4, long 2 Global Memory: 31.0 GB Global Memory Cache: 16.0 KB Local Memory: 32.0 KB (Global) Max memory alloc. size: 7.0 GB Max clock (MHz): 4018 Profiling timer res.: 69 ns Max Work Group Size: 1024 Parallel compute cores: 8 Speed index: 128576 PCI device topology: Platform #1 name: NVIDIA CUDA, version: OpenCL 1.2 CUDA 8.0.0 Device #0 (1) name: GeForce GTX 980 Device vendor: NVIDIA Corporation Device type: GPU (LE) Device version: OpenCL 1.2 CUDA Driver version: 368.81 Native vector widths: char 1, short 1, int 1, long 1 Preferred vector width: char 1, short 1, int 1, long 1 Global Memory: 4.0 GB Global Memory Cache: 256.2 KB Local Memory: 48.0 KB (Local) Max memory alloc. size: 1024.0 MB Max clock (MHz): 1329 Profiling timer res.: 1000 ns Max Work Group Size: 1024 Parallel compute cores: 16 Speed index: 21264 Warp size: 32 Max. GPRs/work-group: 65536 Kernel exec. timeout: yes PCI device topology: Detected xop instruction set ```
Author
Owner

@ghost commented on GitHub (Aug 16, 2016):

You mean unrolls. This really shouldn't make any device fail - it should only affect speed.

It is not unusual, in fact I saw this more than a couple of times.

Likely an nvidia driver bug.

It has to be a driver/compiler bug (I failed to see any other explanations in the past). Unexpected and undesired is NVIDIA 'misbehaving' at this point in time; I mean, everything should be stable now.


BTW: we need to take a look at how some detection code behaves while at new hardware. E.g.

  • See above: Speed index: 21264 (wrong)
  • Missing info: CUDA cores, Compute capability, ...
  • What is happening in DEVICE_INFO?

@crioux, could you please test your fancy new boards using --verb=5 (or what you use on Windows)? Have you noticed anything else strange on new boards? Even the -list=opencl-devices output. In fact, if you are in the mood, I would like to see if everything is ok - I mean, a few tests with verbosity on.

Focus on this line / or post everything:

Options used: -I /home/claudio/bleeding/run/kernels -cl-mad-enable -DSM_MAJOR=3 -DSM_MINOR=5 -cl-nv-verbose -D__GPU__ -DDEVICE_INFO=131090 -DSIZEOF_SIZE_T=8 -DDEV_VER_MAJOR=361 -DDEV_VER_MINOR=28 -D_OPENCL_COMPILER  $JOHN/kernels/cryptsha256_kernel_GPU.cl

Thinking loud, maybe not important:

  • CUDA 8.0? What we know about it? A full rewrite? New stack?
<!-- gh-comment-id:240168320 --> @ghost commented on GitHub (Aug 16, 2016): > You mean unrolls. This really shouldn't make any device fail - it should only affect speed. It is not unusual, in fact I saw this more than a couple of times. > Likely an nvidia driver bug. It has to be a driver/compiler bug (I failed to see any other explanations in the past). Unexpected and undesired is NVIDIA 'misbehaving' at this point in time; I mean, everything should be stable now. --- BTW: we need to take a look at how some detection code behaves while at new hardware. E.g. - See above: Speed index: 21264 (wrong) - Missing info: CUDA cores, Compute capability, ... - What is happening in DEVICE_INFO? @crioux, could you please test your fancy new boards using --verb=5 (or what you use on Windows)? Have you noticed anything else strange on new boards? Even the -list=opencl-devices output. In fact, if you are in the mood, I would like to see if everything is ok - I mean, a few tests with verbosity on. Focus on this line / or post everything: ``` Options used: -I /home/claudio/bleeding/run/kernels -cl-mad-enable -DSM_MAJOR=3 -DSM_MINOR=5 -cl-nv-verbose -D__GPU__ -DDEVICE_INFO=131090 -DSIZEOF_SIZE_T=8 -DDEV_VER_MAJOR=361 -DDEV_VER_MINOR=28 -D_OPENCL_COMPILER $JOHN/kernels/cryptsha256_kernel_GPU.cl ``` --- Thinking loud, maybe not important: - CUDA 8.0? What we know about it? A full rewrite? New stack?
Author
Owner

@crioux commented on GitHub (Aug 16, 2016):

GTX 980

./jtrexe --verb=5 --list=opencl-devices
Platform #0 name: AMD Accelerated Parallel Processing, version: OpenCL 2.0 AMD-APP (2117.9)
    Platform extensions:    cl_khr_icd cl_khr_d3d10_sharing cl_khr_d3d11_sharing cl_khr_dx9_media_sharing cl_amd_event_callback cl_amd_offline_devices
    Device #0 (0) name:     AMD FX(tm)-8350 Eight-Core Processor
    Device vendor:          AuthenticAMD
    Device type:            CPU (LE)
    Device version:         OpenCL 1.2 AMD-APP (2117.9)
    Driver version:         2117.9 (sse2,avx,fma4)
    Native vector widths:   char 16, short 8, int 4, long 2
    Preferred vector width: char 16, short 8, int 4, long 2
    Global Memory:          31.0 GB
    Device extensions:      cl_khr_fp64 cl_amd_fp64 cl_khr_global_int32_base_atomics cl_khr_global_int32_extended_atomics cl_khr_local_int32_base_atomics cl_khr_local_int32_extended_atomics cl_khr_int64_base_atomics cl_khr_int64_extended_atomics cl_khr_3d_image_writes cl_khr_byte_addressable_store cl_khr_gl_sharing cl_ext_device_fission cl_amd_device_attribute_query cl_amd_vec3 cl_amd_printf cl_amd_media_ops cl_amd_media_ops2 cl_amd_popcnt cl_khr_d3d10_sharing cl_khr_spir cl_khr_gl_event
    Global Memory Cache:    16.0 KB
    Local Memory:           32.0 KB (Global)
    Max memory alloc. size: 7.0 GB
    Max clock (MHz):        4018
    Profiling timer res.:   69 ns
    Max Work Group Size:    1024
    Parallel compute cores: 8
    Speed index:            128576
    PCI device topology:

Platform #1 name: NVIDIA CUDA, version: OpenCL 1.2 CUDA 8.0.0
    Platform extensions:    cl_khr_global_int32_base_atomics cl_khr_global_int32_extended_atomics cl_khr_local_int32_base_atomics cl_khr_local_int32_extended_atomics cl_khr_fp64 cl_khr_byte_addressable_store cl_khr_icd cl_khr_gl_sharing cl_nv_compiler_options cl_nv_device_attribute_query cl_nv_pragma_unroll cl_nv_d3d10_sharing cl_khr_d3d10_sharing cl_nv_d3d11_sharing cl_nv_copy_opts
    Device #0 (1) name:     GeForce GTX 980
    Device vendor:          NVIDIA Corporation
    Device type:            GPU (LE)
    Device version:         OpenCL 1.2 CUDA
    Driver version:         368.81
    Native vector widths:   char 1, short 1, int 1, long 1
    Preferred vector width: char 1, short 1, int 1, long 1
    Global Memory:          4.0 GB
    Device extensions:      cl_khr_global_int32_base_atomics cl_khr_global_int32_extended_atomics cl_khr_local_int32_base_atomics cl_khr_local_int32_extended_atomics cl_khr_fp64 cl_khr_byte_addressable_store cl_khr_icd cl_khr_gl_sharing cl_nv_compiler_options cl_nv_device_attribute_query cl_nv_pragma_unroll cl_nv_d3d10_sharing cl_khr_d3d10_sharing cl_nv_d3d11_sharing cl_nv_copy_opts
    Global Memory Cache:    256.2 KB
    Local Memory:           48.0 KB (Local)
    Max memory alloc. size: 1024.0 MB
    Max clock (MHz):        1329
    Profiling timer res.:   1000 ns
    Max Work Group Size:    1024
    Parallel compute cores: 16
    Speed index:            21264
    Warp size:              32
    Max. GPRs/work-group:   65536
    Kernel exec. timeout:   yes
    PCI device topology:

Detected xop instruction set
initUnicode(UNICODE, UTF-8/ISO-8859-1)
UTF-8 -> UTF-8 -> UTF-8
<!-- gh-comment-id:240174211 --> @crioux commented on GitHub (Aug 16, 2016): GTX 980 ``` ./jtrexe --verb=5 --list=opencl-devices Platform #0 name: AMD Accelerated Parallel Processing, version: OpenCL 2.0 AMD-APP (2117.9) Platform extensions: cl_khr_icd cl_khr_d3d10_sharing cl_khr_d3d11_sharing cl_khr_dx9_media_sharing cl_amd_event_callback cl_amd_offline_devices Device #0 (0) name: AMD FX(tm)-8350 Eight-Core Processor Device vendor: AuthenticAMD Device type: CPU (LE) Device version: OpenCL 1.2 AMD-APP (2117.9) Driver version: 2117.9 (sse2,avx,fma4) Native vector widths: char 16, short 8, int 4, long 2 Preferred vector width: char 16, short 8, int 4, long 2 Global Memory: 31.0 GB Device extensions: cl_khr_fp64 cl_amd_fp64 cl_khr_global_int32_base_atomics cl_khr_global_int32_extended_atomics cl_khr_local_int32_base_atomics cl_khr_local_int32_extended_atomics cl_khr_int64_base_atomics cl_khr_int64_extended_atomics cl_khr_3d_image_writes cl_khr_byte_addressable_store cl_khr_gl_sharing cl_ext_device_fission cl_amd_device_attribute_query cl_amd_vec3 cl_amd_printf cl_amd_media_ops cl_amd_media_ops2 cl_amd_popcnt cl_khr_d3d10_sharing cl_khr_spir cl_khr_gl_event Global Memory Cache: 16.0 KB Local Memory: 32.0 KB (Global) Max memory alloc. size: 7.0 GB Max clock (MHz): 4018 Profiling timer res.: 69 ns Max Work Group Size: 1024 Parallel compute cores: 8 Speed index: 128576 PCI device topology: Platform #1 name: NVIDIA CUDA, version: OpenCL 1.2 CUDA 8.0.0 Platform extensions: cl_khr_global_int32_base_atomics cl_khr_global_int32_extended_atomics cl_khr_local_int32_base_atomics cl_khr_local_int32_extended_atomics cl_khr_fp64 cl_khr_byte_addressable_store cl_khr_icd cl_khr_gl_sharing cl_nv_compiler_options cl_nv_device_attribute_query cl_nv_pragma_unroll cl_nv_d3d10_sharing cl_khr_d3d10_sharing cl_nv_d3d11_sharing cl_nv_copy_opts Device #0 (1) name: GeForce GTX 980 Device vendor: NVIDIA Corporation Device type: GPU (LE) Device version: OpenCL 1.2 CUDA Driver version: 368.81 Native vector widths: char 1, short 1, int 1, long 1 Preferred vector width: char 1, short 1, int 1, long 1 Global Memory: 4.0 GB Device extensions: cl_khr_global_int32_base_atomics cl_khr_global_int32_extended_atomics cl_khr_local_int32_base_atomics cl_khr_local_int32_extended_atomics cl_khr_fp64 cl_khr_byte_addressable_store cl_khr_icd cl_khr_gl_sharing cl_nv_compiler_options cl_nv_device_attribute_query cl_nv_pragma_unroll cl_nv_d3d10_sharing cl_khr_d3d10_sharing cl_nv_d3d11_sharing cl_nv_copy_opts Global Memory Cache: 256.2 KB Local Memory: 48.0 KB (Local) Max memory alloc. size: 1024.0 MB Max clock (MHz): 1329 Profiling timer res.: 1000 ns Max Work Group Size: 1024 Parallel compute cores: 16 Speed index: 21264 Warp size: 32 Max. GPRs/work-group: 65536 Kernel exec. timeout: yes PCI device topology: Detected xop instruction set initUnicode(UNICODE, UTF-8/ISO-8859-1) UTF-8 -> UTF-8 -> UTF-8 ```
Author
Owner

@crioux commented on GitHub (Aug 16, 2016):

GTX 980 Test:

./jtrexe --verb=5 --device=1 --format=sha256crypt-opencl --test=5
Benchmarking: sha256crypt-opencl, crypt(3) $5$ (rounds=5000) [SHA256 OpenCL]... Detected xop instruction set
initUnicode(UNICODE, ASCII/ASCII)
ASCII -> ASCII -> ASCII
Device 1: GeForce GTX 980
Loaded 7 hashes with 5 different salts to test db from test vectors
Options used: -I G:\l0phtcrack\lc7\build_win64\dist\Beta\lcplugins\lc7jtr{9846c8cf-1db1-467e-83c2-c5655aa81936}\kernels -cl-mad-enable  -DSM_MAJOR=5 -DSM_MINOR=2 -cl-nv-verbose -D__GPU__ -DDEVICE_INFO=262162 -DSIZEOF_SIZE_T=8 -DDEV_VER_MAJOR=368 -DDEV_VER_MINOR=81 -D_OPENCL_COMPILER   $JOHN/kernels/cryptsha256_kernel_GPU.cl
Calculating best GWS for LWS=32; max. 100ms single kernel invocation.
Raw speed figures including buffer transfers:
xfer: 9.920us, crypt: 119x334.240us, xfer back: 7.104us, prep: 765.600us, pp: 25.120us, final: 36.896us, var: 317.280us/316.608us
gws: 1024         26080c/s130400000 rounds/s  39.262ms per crypt_all()!
xfer: 17.440us, crypt: 119x330.240us, xfer back: 12.224us, prep: 752.160us, pp: 25.856us, final: 45.856us, var: 315.104us/313.760us
gws: 2048         52629c/s263145000 rounds/s  38.913ms per crypt_all()!
xfer: 33.408us, crypt: 119x357.472us, xfer back: 22.016us, prep: 775.744us, pp: 28.896us, final: 41.888us, var: 360.576us/344.576us
gws: 4096         95101c/s475505000 rounds/s  43.069ms per crypt_all()+
xfer: 46.112us, crypt: 119x618.752us, xfer back: 41.504us, prep: 904.544us, pp: 35.264us, final: 56.224us, var: 673.024us/623.136us
gws: 8192        106289c/s531445000 rounds/s  77.072ms per crypt_all()+
xfer: 85.280us, crypt: 119x1.256ms, xfer back: 80.416us, prep: 1.698ms, pp: 55.392us, final: 97.024us, var: 1.271ms/1.251ms
gws: 16384       107815c/s539075000 rounds/s 151.963ms per crypt_all()+
xfer: 157.344us, crypt: 119x2.480ms, xfer back: 158.816us, prep: 3.331ms, pp: 114.784us, final: 173.760us, var: 2.501ms/2.479ms
gws: 32768       109217c/s546085000 rounds/s 300.025ms per crypt_all()+
xfer: 320.896us, crypt: 119x4.925ms, xfer back: 316.096us, prep: 6.766ms, pp: 215.104us, final: 294.624us, var: 4.954ms/4.929ms
gws: 65536       110042c/s550210000 rounds/s 595.551ms per crypt_all()
xfer: 641.568us, crypt: 119x8.872ms, xfer back: 633.408us, prep: 12.793ms, pp: 426.464us, final: 508.576us, var: 9.036ms/9.008ms
gws: 131072      121006c/s605030000 rounds/s    1.083s per crypt_all()+
xfer: 1.299ms, crypt: 119x17.857ms, xfer back: 1.258ms, prep: 25.209ms, pp: 853.760us, final: 958.848us, var: 17.855ms/17.896ms
gws: 262144      121534c/s607670000 rounds/s    2.156s per crypt_all()
xfer: 2.605ms, crypt: 119x35.573ms, xfer back: 5.731ms, prep: 49.729ms, pp: 1.749ms, final: 1.867ms, var: 35.581ms/35.577ms
gws: 524288      122009c/s610045000 rounds/s    4.297s per crypt_all()
Hardware resources exhausted
Calculating best LWS for GWS=131072
Testing LWS=32 GWS=131072 ... 45.036ms+
Testing LWS=64 GWS=131072 ... 44.439ms+
Testing LWS=128 GWS=131072 ... 44.479ms
Testing LWS=256 GWS=131072 ... 42.896ms+
Testing LWS=512 GWS=131072 ... 42.131ms+
Testing LWS=1024 GWS=131072 ... 39.255ms+
Calculating best GWS for LWS=1024; max. 200ms single kernel invocation.
Raw speed figures including buffer transfers:
xfer: 18.048us, crypt: 119x948.736us, xfer back: 11.456us, prep: 1.383ms, pp: 35.328us, final: 73.984us, var: 932.544us/939.456us
gws: 2048         18051c/s90255000 rounds/s 113.456ms per crypt_all()!
xfer: 22.400us, crypt: 119x948.832us, xfer back: 21.952us, prep: 1.413ms, pp: 36.384us, final: 76.416us, var: 943.968us/942.688us
gws: 4096         35901c/s179505000 rounds/s 114.089ms per crypt_all()+
xfer: 57.888us, crypt: 119x960.608us, xfer back: 41.440us, prep: 1.426ms, pp: 40.576us, final: 77.440us, var: 953.920us/951.104us
gws: 8192         71013c/s355065000 rounds/s 115.359ms per crypt_all()+
xfer: 79.456us, crypt: 119x1.033ms, xfer back: 80.256us, prep: 1.938ms, pp: 55.712us, final: 103.744us, var: 1.052ms/1.035ms
gws: 16384       129860c/s649300000 rounds/s 126.165ms per crypt_all()+
xfer: 159.904us, crypt: 119x1.990ms, xfer back: 158.848us, prep: 3.691ms, pp: 108.512us, final: 181.216us, var: 1.979ms/1.987ms
gws: 32768       136124c/s680620000 rounds/s 240.721ms per crypt_all()+
xfer: 318.336us, crypt: 119x3.933ms, xfer back: 314.656us, prep: 7.176ms, pp: 206.528us, final: 337.856us, var: 3.937msDONE
Speed for cost 1 (iteration count) of 5000
Raw:    115775 c/s

/3.935ms
gws: 65536       137427c/s687135000 rounds/s 476.877ms per crypt_all()
xfer: 666.080us, crypt: 119x7.873ms, xfer back: 643.808us, prep: 13.996ms, pp: 405.888us, final: 617.888us, var: 7.966ms/7.814ms
gws: 131072      137252c/s686260000 rounds/s 954.970ms per crypt_all()
xfer: 1.291ms, crypt: 119x15.564ms, xfer back: 1.279ms, prep: 27.280ms, pp: 815.616us, final: 1.176ms, var: 15.706ms/15.653ms
gws: 262144      138414c/s692070000 rounds/s    1.893s per crypt_all()+
xfer: 2.595ms, crypt: 119x31.075ms, xfer back: 2.534ms, prep: 53.156ms, pp: 1.616ms, final: 2.273ms, var: 31.179ms/31.139ms
gws: 524288      139132c/s695660000 rounds/s    3.768s per crypt_all()
Hardware resources exhausted
Local worksize (LWS) 1024, global worksize (GWS) 262144
<!-- gh-comment-id:240175000 --> @crioux commented on GitHub (Aug 16, 2016): GTX 980 Test: ``` ./jtrexe --verb=5 --device=1 --format=sha256crypt-opencl --test=5 Benchmarking: sha256crypt-opencl, crypt(3) $5$ (rounds=5000) [SHA256 OpenCL]... Detected xop instruction set initUnicode(UNICODE, ASCII/ASCII) ASCII -> ASCII -> ASCII Device 1: GeForce GTX 980 Loaded 7 hashes with 5 different salts to test db from test vectors Options used: -I G:\l0phtcrack\lc7\build_win64\dist\Beta\lcplugins\lc7jtr{9846c8cf-1db1-467e-83c2-c5655aa81936}\kernels -cl-mad-enable -DSM_MAJOR=5 -DSM_MINOR=2 -cl-nv-verbose -D__GPU__ -DDEVICE_INFO=262162 -DSIZEOF_SIZE_T=8 -DDEV_VER_MAJOR=368 -DDEV_VER_MINOR=81 -D_OPENCL_COMPILER $JOHN/kernels/cryptsha256_kernel_GPU.cl Calculating best GWS for LWS=32; max. 100ms single kernel invocation. Raw speed figures including buffer transfers: xfer: 9.920us, crypt: 119x334.240us, xfer back: 7.104us, prep: 765.600us, pp: 25.120us, final: 36.896us, var: 317.280us/316.608us gws: 1024 26080c/s130400000 rounds/s 39.262ms per crypt_all()! xfer: 17.440us, crypt: 119x330.240us, xfer back: 12.224us, prep: 752.160us, pp: 25.856us, final: 45.856us, var: 315.104us/313.760us gws: 2048 52629c/s263145000 rounds/s 38.913ms per crypt_all()! xfer: 33.408us, crypt: 119x357.472us, xfer back: 22.016us, prep: 775.744us, pp: 28.896us, final: 41.888us, var: 360.576us/344.576us gws: 4096 95101c/s475505000 rounds/s 43.069ms per crypt_all()+ xfer: 46.112us, crypt: 119x618.752us, xfer back: 41.504us, prep: 904.544us, pp: 35.264us, final: 56.224us, var: 673.024us/623.136us gws: 8192 106289c/s531445000 rounds/s 77.072ms per crypt_all()+ xfer: 85.280us, crypt: 119x1.256ms, xfer back: 80.416us, prep: 1.698ms, pp: 55.392us, final: 97.024us, var: 1.271ms/1.251ms gws: 16384 107815c/s539075000 rounds/s 151.963ms per crypt_all()+ xfer: 157.344us, crypt: 119x2.480ms, xfer back: 158.816us, prep: 3.331ms, pp: 114.784us, final: 173.760us, var: 2.501ms/2.479ms gws: 32768 109217c/s546085000 rounds/s 300.025ms per crypt_all()+ xfer: 320.896us, crypt: 119x4.925ms, xfer back: 316.096us, prep: 6.766ms, pp: 215.104us, final: 294.624us, var: 4.954ms/4.929ms gws: 65536 110042c/s550210000 rounds/s 595.551ms per crypt_all() xfer: 641.568us, crypt: 119x8.872ms, xfer back: 633.408us, prep: 12.793ms, pp: 426.464us, final: 508.576us, var: 9.036ms/9.008ms gws: 131072 121006c/s605030000 rounds/s 1.083s per crypt_all()+ xfer: 1.299ms, crypt: 119x17.857ms, xfer back: 1.258ms, prep: 25.209ms, pp: 853.760us, final: 958.848us, var: 17.855ms/17.896ms gws: 262144 121534c/s607670000 rounds/s 2.156s per crypt_all() xfer: 2.605ms, crypt: 119x35.573ms, xfer back: 5.731ms, prep: 49.729ms, pp: 1.749ms, final: 1.867ms, var: 35.581ms/35.577ms gws: 524288 122009c/s610045000 rounds/s 4.297s per crypt_all() Hardware resources exhausted Calculating best LWS for GWS=131072 Testing LWS=32 GWS=131072 ... 45.036ms+ Testing LWS=64 GWS=131072 ... 44.439ms+ Testing LWS=128 GWS=131072 ... 44.479ms Testing LWS=256 GWS=131072 ... 42.896ms+ Testing LWS=512 GWS=131072 ... 42.131ms+ Testing LWS=1024 GWS=131072 ... 39.255ms+ Calculating best GWS for LWS=1024; max. 200ms single kernel invocation. Raw speed figures including buffer transfers: xfer: 18.048us, crypt: 119x948.736us, xfer back: 11.456us, prep: 1.383ms, pp: 35.328us, final: 73.984us, var: 932.544us/939.456us gws: 2048 18051c/s90255000 rounds/s 113.456ms per crypt_all()! xfer: 22.400us, crypt: 119x948.832us, xfer back: 21.952us, prep: 1.413ms, pp: 36.384us, final: 76.416us, var: 943.968us/942.688us gws: 4096 35901c/s179505000 rounds/s 114.089ms per crypt_all()+ xfer: 57.888us, crypt: 119x960.608us, xfer back: 41.440us, prep: 1.426ms, pp: 40.576us, final: 77.440us, var: 953.920us/951.104us gws: 8192 71013c/s355065000 rounds/s 115.359ms per crypt_all()+ xfer: 79.456us, crypt: 119x1.033ms, xfer back: 80.256us, prep: 1.938ms, pp: 55.712us, final: 103.744us, var: 1.052ms/1.035ms gws: 16384 129860c/s649300000 rounds/s 126.165ms per crypt_all()+ xfer: 159.904us, crypt: 119x1.990ms, xfer back: 158.848us, prep: 3.691ms, pp: 108.512us, final: 181.216us, var: 1.979ms/1.987ms gws: 32768 136124c/s680620000 rounds/s 240.721ms per crypt_all()+ xfer: 318.336us, crypt: 119x3.933ms, xfer back: 314.656us, prep: 7.176ms, pp: 206.528us, final: 337.856us, var: 3.937msDONE Speed for cost 1 (iteration count) of 5000 Raw: 115775 c/s /3.935ms gws: 65536 137427c/s687135000 rounds/s 476.877ms per crypt_all() xfer: 666.080us, crypt: 119x7.873ms, xfer back: 643.808us, prep: 13.996ms, pp: 405.888us, final: 617.888us, var: 7.966ms/7.814ms gws: 131072 137252c/s686260000 rounds/s 954.970ms per crypt_all() xfer: 1.291ms, crypt: 119x15.564ms, xfer back: 1.279ms, prep: 27.280ms, pp: 815.616us, final: 1.176ms, var: 15.706ms/15.653ms gws: 262144 138414c/s692070000 rounds/s 1.893s per crypt_all()+ xfer: 2.595ms, crypt: 119x31.075ms, xfer back: 2.534ms, prep: 53.156ms, pp: 1.616ms, final: 2.273ms, var: 31.179ms/31.139ms gws: 524288 139132c/s695660000 rounds/s 3.768s per crypt_all() Hardware resources exhausted Local worksize (LWS) 1024, global worksize (GWS) 262144 ```
Author
Owner

@crioux commented on GitHub (Aug 16, 2016):

GTX 980 Test, sha512crypt-opencl:

./jtrexe --verb=5 --device=1 --format=sha512crypt-opencl --test=5
Benchmarking: sha512crypt-opencl, crypt(3) $6$ (rounds=5000) [SHA512 OpenCL]... Detected xop instruction set
initUnicode(UNICODE, ASCII/ASCII)
ASCII -> ASCII -> ASCII
Device 1: GeForce GTX 980
Loaded 6 hashes with 4 different salts to test db from test vectors
Options used: -I G:\l0phtcrack\lc7\build_win64\dist\Beta\lcplugins\lc7jtr{9846c8cf-1db1-467e-83c2-c5655aa81936}\kernels -cl-mad-enable  -DSM_MAJOR=5 -DSM_MINOR=2 -cl-nv-verbose -D__GPU__ -DDEVICE_INFO=262162 -DSIZEOF_SIZE_T=8 -DDEV_VER_MAJOR=368 -DDEV_VER_MINOR=81 -D_OPENCL_COMPILER   $JOHN/kernels/cryptsha512_kernel_GPU.cl
Calculating best GWS for LWS=32; max. 100ms single kernel invocation.
Raw speed figures including buffer transfers:
xfer: 11.808us, crypt: 119x470.240us, xfer back: 11.520us, prep: 1.370ms, pp: 21.312us, final: 43.712us, var: 461.376us/463.808us
gws: 1024         18017c/s90085000 rounds/s  56.833ms per crypt_all()!
xfer: 18.912us, crypt: 119x456.192us, xfer back: 21.760us, prep: 1.389ms, pp: 21.888us, final: 46.400us, var: 447.584us/448.896us
gws: 2048         37117c/s185585000 rounds/s  55.175ms per crypt_all()!
xfer: 35.232us, crypt: 119x515.904us, xfer back: 41.312us, prep: 1.455ms, pp: 26.336us, final: 50.624us, var: 513.856us/512.512us
gws: 4096         65211c/s326055000 rounds/s  62.810ms per crypt_all()+
xfer: 74.528us, crypt: 119x867.360us, xfer back: 80.352us, prep: 1.929ms, pp: 40.640us, final: 76.928us, var: 869.728us/862.432us
gws: 8192         77753c/s388765000 rounds/s 105.357ms per crypt_all()+
xfer: 137.120us, crypt: 119x2.019ms, xfer back: 158.784us, prep: 3.690ms, pp: 92.704us, final: 135.712us, var: 1.926ms/1.920ms
gws: 16384        69120c/s345600000 rounds/s 237.033ms per crypt_all()
xfer: 179.936us, crypt: 119x3.772ms, xfer back: 315.424us, prep: 7.306ms, pp: 191.872us, final: 230.112us, var: 3.766ms/3.582ms
gws: 32768        72892c/s364460000 rounds/s 449.536ms per crypt_all()
xfer: 364us, crypt: 119x6.726ms, xfer back: 633.472us, prep: 13.724ms, pp: 379.968us, final: 390.496us, var: 6.701ms/6.633ms
gws: 65536        80750c/s403750000 rounds/s 811.586ms per crypt_all()+
xfer: 756.672us, crypt: 119x12.018ms, xfer back: 1.268ms, prep: 23.897ms, pp: 785.408us, final: 670.688us, var: 11.927ms/11.877ms
gws: 131072       90458c/s452290000 rounds/s    1.448s per crypt_all()+
xfer: 1.483ms, crypt: 119x23.371ms, xfer back: 2.536ms, prep: 45.890ms, pp: 1.589ms, final: 1.279ms, var: 23.483ms/23.440ms
gws: 262144       92230c/s461150000 rounds/s    2.842s per crypt_all()+
xfer: 2.977ms, crypt: 119x46.380ms, xfer back: 6.688ms, prep: 90.774ms, pp: 3.209ms, final: 2.474ms, var: 46.484ms/46.528ms
gws: 524288       92998c/s464990000 rounds/s    5.637s per crypt_all()
xfer: 5.927ms, crypt: 119x92.438ms, xfer back: 15.951ms, prep: 179.691ms (exceeds 100ms)
Calculating best LWS for GWS=262144
Testing LWS=32 GWS=262144 ... 116.914ms+
Testing LWS=64 GWS=262144 ... 117.040ms
Testing LWS=128 GWS=262144 ... 117.322ms
Testing LWS=256 GWS=262144 ... 116.933ms
Testing LWS=512 GWS=262144 ... 118.911ms
Calculating best GWS for LWS=32; max. 200ms single kernel invocation.
Raw speed figures including buffer transfers:
xfer: 19.840us, crypt: 119x414.528us, xfer back: 21.664us, prep: 1.270ms, pp: 20.416us, final: 41.024us, var: 408.448us/406.272us
gws: 2048         40834c/s204170000 rounds/s  50.153ms per crypt_all()!
xfer: 35.360us, crypt: 119x471.840us, xfer back: 41.536us, prep: 1.328ms, pp: 24.864us, final: 49.408us, var: 470.880us/466.592us
gws: 4096         71353c/s356765000 rounds/s  57.404ms per crypt_all()+
xfer: 64.640us, crypt: 119x800.256us, xfer back: 86.656us, prep: 1.769ms, pp: 38.400us, final: 72.832us, var: 780.992us/787.776us
gws: 8192         85297c/s426485000 rounds/s  96.040ms per crypt_all()+
xfer: 99.712us, crypt: 119x1.755ms, xfer back: 165.184us, prep: 3.364ms, pp: 92.448us, final: 125.888us, var: 1.850ms/1.761ms
gws: 16384        75567c/s377835000 rounds/s 216.813ms per crypt_all()
xfer: 181.600us, crypt: 119x3.421ms, xfer back: 322.048us, prep: 6.744ms, pp: 193.056us, final: 205.472us, var: 3.422ms/3.416ms
gws: 32768        78992c/s394960000 rounds/s 414.825ms per crypt_all()
xfer: 394.912us, crypt: 119x6.168ms, xfer back: 633.632us, prep: 12.879ms, pp: 380us, final: 360.896us, var: 6.DONE
Speed for cost 1 (iteration count) of 5000
Raw:    81379 c/s

079ms/6.148ms
gws: 65536        88008c/s440040000 rounds/s 744.655ms per crypt_all()+
xfer: 758.336us, crypt: 119x11.966ms, xfer back: 1.267ms, prep: 23.737ms, pp: 802.752us, final: 666.272us, var: 12.017ms/11.965ms
gws: 131072       90154c/s450770000 rounds/s    1.453s per crypt_all()+
xfer: 1.501ms, crypt: 119x23.459ms, xfer back: 2.541ms, prep: 46.241ms, pp: 1.591ms, final: 1.274ms, var: 23.551ms/23.462ms
gws: 262144       91990c/s459950000 rounds/s    2.849s per crypt_all()+
xfer: 2.972ms, crypt: 119x46.544ms, xfer back: 5.061ms, prep: 91.040ms, pp: 3.191ms, final: 2.483ms, var: 46.465ms/46.445ms
gws: 524288       92980c/s464900000 rounds/s    5.638s per crypt_all()+
xfer: 5.941ms, crypt: 119x92.490ms, xfer back: 15.918ms, prep: 179.931ms, pp: 6.498ms, final: 4.973ms, var: 92.605ms/92.595ms
gws: 1048576      93349c/s466745000 rounds/s   11.232s per crypt_all()
Hardware resources exhausted
Local worksize (LWS) 32, global worksize (GWS) 524288
<!-- gh-comment-id:240175407 --> @crioux commented on GitHub (Aug 16, 2016): GTX 980 Test, sha512crypt-opencl: ``` ./jtrexe --verb=5 --device=1 --format=sha512crypt-opencl --test=5 Benchmarking: sha512crypt-opencl, crypt(3) $6$ (rounds=5000) [SHA512 OpenCL]... Detected xop instruction set initUnicode(UNICODE, ASCII/ASCII) ASCII -> ASCII -> ASCII Device 1: GeForce GTX 980 Loaded 6 hashes with 4 different salts to test db from test vectors Options used: -I G:\l0phtcrack\lc7\build_win64\dist\Beta\lcplugins\lc7jtr{9846c8cf-1db1-467e-83c2-c5655aa81936}\kernels -cl-mad-enable -DSM_MAJOR=5 -DSM_MINOR=2 -cl-nv-verbose -D__GPU__ -DDEVICE_INFO=262162 -DSIZEOF_SIZE_T=8 -DDEV_VER_MAJOR=368 -DDEV_VER_MINOR=81 -D_OPENCL_COMPILER $JOHN/kernels/cryptsha512_kernel_GPU.cl Calculating best GWS for LWS=32; max. 100ms single kernel invocation. Raw speed figures including buffer transfers: xfer: 11.808us, crypt: 119x470.240us, xfer back: 11.520us, prep: 1.370ms, pp: 21.312us, final: 43.712us, var: 461.376us/463.808us gws: 1024 18017c/s90085000 rounds/s 56.833ms per crypt_all()! xfer: 18.912us, crypt: 119x456.192us, xfer back: 21.760us, prep: 1.389ms, pp: 21.888us, final: 46.400us, var: 447.584us/448.896us gws: 2048 37117c/s185585000 rounds/s 55.175ms per crypt_all()! xfer: 35.232us, crypt: 119x515.904us, xfer back: 41.312us, prep: 1.455ms, pp: 26.336us, final: 50.624us, var: 513.856us/512.512us gws: 4096 65211c/s326055000 rounds/s 62.810ms per crypt_all()+ xfer: 74.528us, crypt: 119x867.360us, xfer back: 80.352us, prep: 1.929ms, pp: 40.640us, final: 76.928us, var: 869.728us/862.432us gws: 8192 77753c/s388765000 rounds/s 105.357ms per crypt_all()+ xfer: 137.120us, crypt: 119x2.019ms, xfer back: 158.784us, prep: 3.690ms, pp: 92.704us, final: 135.712us, var: 1.926ms/1.920ms gws: 16384 69120c/s345600000 rounds/s 237.033ms per crypt_all() xfer: 179.936us, crypt: 119x3.772ms, xfer back: 315.424us, prep: 7.306ms, pp: 191.872us, final: 230.112us, var: 3.766ms/3.582ms gws: 32768 72892c/s364460000 rounds/s 449.536ms per crypt_all() xfer: 364us, crypt: 119x6.726ms, xfer back: 633.472us, prep: 13.724ms, pp: 379.968us, final: 390.496us, var: 6.701ms/6.633ms gws: 65536 80750c/s403750000 rounds/s 811.586ms per crypt_all()+ xfer: 756.672us, crypt: 119x12.018ms, xfer back: 1.268ms, prep: 23.897ms, pp: 785.408us, final: 670.688us, var: 11.927ms/11.877ms gws: 131072 90458c/s452290000 rounds/s 1.448s per crypt_all()+ xfer: 1.483ms, crypt: 119x23.371ms, xfer back: 2.536ms, prep: 45.890ms, pp: 1.589ms, final: 1.279ms, var: 23.483ms/23.440ms gws: 262144 92230c/s461150000 rounds/s 2.842s per crypt_all()+ xfer: 2.977ms, crypt: 119x46.380ms, xfer back: 6.688ms, prep: 90.774ms, pp: 3.209ms, final: 2.474ms, var: 46.484ms/46.528ms gws: 524288 92998c/s464990000 rounds/s 5.637s per crypt_all() xfer: 5.927ms, crypt: 119x92.438ms, xfer back: 15.951ms, prep: 179.691ms (exceeds 100ms) Calculating best LWS for GWS=262144 Testing LWS=32 GWS=262144 ... 116.914ms+ Testing LWS=64 GWS=262144 ... 117.040ms Testing LWS=128 GWS=262144 ... 117.322ms Testing LWS=256 GWS=262144 ... 116.933ms Testing LWS=512 GWS=262144 ... 118.911ms Calculating best GWS for LWS=32; max. 200ms single kernel invocation. Raw speed figures including buffer transfers: xfer: 19.840us, crypt: 119x414.528us, xfer back: 21.664us, prep: 1.270ms, pp: 20.416us, final: 41.024us, var: 408.448us/406.272us gws: 2048 40834c/s204170000 rounds/s 50.153ms per crypt_all()! xfer: 35.360us, crypt: 119x471.840us, xfer back: 41.536us, prep: 1.328ms, pp: 24.864us, final: 49.408us, var: 470.880us/466.592us gws: 4096 71353c/s356765000 rounds/s 57.404ms per crypt_all()+ xfer: 64.640us, crypt: 119x800.256us, xfer back: 86.656us, prep: 1.769ms, pp: 38.400us, final: 72.832us, var: 780.992us/787.776us gws: 8192 85297c/s426485000 rounds/s 96.040ms per crypt_all()+ xfer: 99.712us, crypt: 119x1.755ms, xfer back: 165.184us, prep: 3.364ms, pp: 92.448us, final: 125.888us, var: 1.850ms/1.761ms gws: 16384 75567c/s377835000 rounds/s 216.813ms per crypt_all() xfer: 181.600us, crypt: 119x3.421ms, xfer back: 322.048us, prep: 6.744ms, pp: 193.056us, final: 205.472us, var: 3.422ms/3.416ms gws: 32768 78992c/s394960000 rounds/s 414.825ms per crypt_all() xfer: 394.912us, crypt: 119x6.168ms, xfer back: 633.632us, prep: 12.879ms, pp: 380us, final: 360.896us, var: 6.DONE Speed for cost 1 (iteration count) of 5000 Raw: 81379 c/s 079ms/6.148ms gws: 65536 88008c/s440040000 rounds/s 744.655ms per crypt_all()+ xfer: 758.336us, crypt: 119x11.966ms, xfer back: 1.267ms, prep: 23.737ms, pp: 802.752us, final: 666.272us, var: 12.017ms/11.965ms gws: 131072 90154c/s450770000 rounds/s 1.453s per crypt_all()+ xfer: 1.501ms, crypt: 119x23.459ms, xfer back: 2.541ms, prep: 46.241ms, pp: 1.591ms, final: 1.274ms, var: 23.551ms/23.462ms gws: 262144 91990c/s459950000 rounds/s 2.849s per crypt_all()+ xfer: 2.972ms, crypt: 119x46.544ms, xfer back: 5.061ms, prep: 91.040ms, pp: 3.191ms, final: 2.483ms, var: 46.465ms/46.445ms gws: 524288 92980c/s464900000 rounds/s 5.638s per crypt_all()+ xfer: 5.941ms, crypt: 119x92.490ms, xfer back: 15.918ms, prep: 179.931ms, pp: 6.498ms, final: 4.973ms, var: 92.605ms/92.595ms gws: 1048576 93349c/s466745000 rounds/s 11.232s per crypt_all() Hardware resources exhausted Local worksize (LWS) 32, global worksize (GWS) 524288 ```
Author
Owner

@ghost commented on GitHub (Aug 16, 2016):

Thank you. I'll look at the source code.

<!-- gh-comment-id:240177571 --> @ghost commented on GitHub (Aug 16, 2016): Thank you. I'll look at the source code.
Author
Owner

@ghost commented on GitHub (Aug 16, 2016):

The problems I've seen in -list=opencl-devices seems related to a different OpenCL initialization path used inside jtrdll. One/a few variables seems not initialized.
Anyway, this is not important or related to the errors seen in formats. Inside a format, everything seems ok.


Side note:
After a fast search, I've found that CUDA 8.0 RC version is "8.0.27. Maybe 8.0.0 could be too 'aggressive' in terms of quality.


I haven't looked at your patch, but I did compare sha256 and sha512 sources. Well, I removed some 'unrolling' because they did harm (some board and/or driver).
Can we merge it with an ifdef, for example, so you can keep it enable all the time?

Without a target (drivers and boards), we might (re) introduce a bug.

<!-- gh-comment-id:240213748 --> @ghost commented on GitHub (Aug 16, 2016): The problems I've seen in -list=opencl-devices seems related to a different OpenCL initialization path used inside jtrdll. One/a few variables seems not initialized. **Anyway, this is not important or related to the errors seen in formats.** Inside a format, everything seems ok. --- Side note: After a fast search, I've found that CUDA 8.0 RC version is "8.0.27. Maybe 8.0.0 could be too 'aggressive' in terms of quality. --- I haven't looked at your patch, but I did compare sha256 and sha512 sources. Well, I removed some 'unrolling' because they did harm (some board and/or driver). Can we merge it with an ifdef, for example, so you can keep it enable all the time? Without a target (drivers and boards), we might (re) introduce a bug.
Author
Owner

@magnumripper commented on GitHub (Aug 17, 2016):

After a fast search, I've found that CUDA 8.0 RC version is "8.0.27. Maybe 8.0.0 could be too 'aggressive' in terms of quality.

As mentioned elsewhere, the CUDA version reported by an OpenCL driver doesn't correlate with a normal "CUDA version" (the latter is shown as "CUDA runtime version" when using --list=cuda-devices).

<!-- gh-comment-id:240557371 --> @magnumripper commented on GitHub (Aug 17, 2016): > After a fast search, I've found that CUDA 8.0 RC version is "8.0.27. Maybe 8.0.0 could be too 'aggressive' in terms of quality. As mentioned elsewhere, the CUDA version reported by an OpenCL driver doesn't correlate with a normal "CUDA version" (the latter is shown as "CUDA runtime version" when using --list=cuda-devices).
Author
Owner

@magnumripper commented on GitHub (Aug 17, 2016):

@crioux unless the missing multiplier (cores per MP) is only missing in --list output and not in a real run, you really should fix that problem in your fork. Your "speed index" ends up being 128x too small or so, and that may lead to significant performance regression with eg. GPU side mask.

But like Claudio said, it's irrelevant for this issue.

<!-- gh-comment-id:240560166 --> @magnumripper commented on GitHub (Aug 17, 2016): @crioux unless the missing multiplier (cores per MP) is only missing in --list output and not in a real run, you really should fix that problem in your fork. Your "speed index" ends up being 128x too small or so, and that may lead to significant performance regression with eg. GPU side mask. But like Claudio said, it's irrelevant for this issue.
Author
Owner

@magnumripper commented on GitHub (Aug 23, 2016):

Fixed by #2221

<!-- gh-comment-id:241795798 --> @magnumripper commented on GitHub (Aug 23, 2016): Fixed by #2221
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#1474
No description provided.