1
0
mirror of https://github.com/hashcat/hashcat.git synced 2024-11-13 19:28:56 +00:00

Limit -T maximum on -m 3200 to what's possible based on device specific shared memory available

This commit is contained in:
Jens Steube 2019-04-27 16:15:18 +02:00
parent d67de66453
commit 200e72dba3

View File

@ -94,25 +94,32 @@ char *module_jit_build_options (MAYBE_UNUSED const hashconfig_t *hashconfig, MAY
}
else
{
u32 overhead = 0;
if (device_param->device_vendor_id == VENDOR_ID_NV)
{
// note we need to use device_param->device_local_mem_size - 4 because opencl jit returns with:
// Entry function '...' uses too much shared data (0xc004 bytes, 0xc000 max)
// on my development system. no clue where the 4 bytes are spent.
// I did some research on this and it seems to be related with the datatype.
// For example, if i used u8 instead, there's only 1 byte wasted.
overhead = 4;
}
if (user_options->kernel_threads_chgd == true)
{
fixed_local_size = user_options->kernel_threads;
// otherwise out-of-bound reads
if ((fixed_local_size * 4096) > (device_param->device_local_mem_size - overhead))
{
fixed_local_size = (device_param->device_local_mem_size - overhead) / 4096;
}
}
else
{
u32 overhead = 0;
if (device_param->device_vendor_id == VENDOR_ID_NV)
{
// note we need to use device_param->device_local_mem_size - 4 because opencl jit returns with:
// Entry function '...' uses too much shared data (0xc004 bytes, 0xc000 max)
// on my development system. no clue where the 4 bytes are spent.
// I did some research on this and it seems to be related with the datatype.
// For example, if i used u8 instead, there's only 1 byte wasted.
overhead = 4;
}
fixed_local_size = (device_param->device_local_mem_size - overhead) / 4096;
}
}