Skip to content

Commit 58b5d15

Browse files
committed
Remove artificial 64 processors for AMD iGPU, since we now use
a more accurate preferred thread size instead. Automatically set artificial processor count to 1 for Intel iGPU, since we now use a more accurate preferred thread size instead. Removed the module_unstable_warning() entry for Intel GPUs on non-Apple OpenCL platform for hash-mode 21800 Do not always ignore TMTO determination for iGPU's in scrypt_common.c. We must at least check the available memory size. Added preferred thread count and unified memory type to -I output Removed special characters in machine-readable format from -I output
1 parent 929af92 commit 58b5d15

4 files changed

Lines changed: 96 additions & 59 deletions

File tree

src/backend.c

Lines changed: 21 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6107,16 +6107,17 @@ static void backend_ctx_devices_init_hip (hashcat_ctx_t *hashcat_ctx, int *virth
61076107

61086108
device_param->device_processors = device_processors;
61096109

6110-
if ((device_param->device_processors == 1) && (device_param->device_host_unified_memory == 1))
6111-
{
6110+
// We have 32 threads now
6111+
//if ((device_param->device_processors == 1) && (device_param->device_host_unified_memory == 1))
6112+
//{
61126113
// APUs return some weird numbers. These values seem more appropriate (from rocminfo)
61136114
//Compute Unit: 2
61146115
//SIMDs per CU: 2
61156116
//Wavefront Size: 32(0x20)
61166117
//Max Waves Per CU: 32(0x20)
61176118

6118-
device_param->device_processors = 2 * 32;
6119-
}
6119+
// device_param->device_processors = 2 * 32;
6120+
//}
61206121

61216122
// device_global_mem, device_maxmem_alloc, device_available_mem
61226123

@@ -7278,16 +7279,29 @@ static void backend_ctx_devices_init_opencl (hashcat_ctx_t *hashcat_ctx, int *vi
72787279

72797280
device_param->device_processors = device_processors;
72807281

7281-
if ((device_param->device_processors == 1) && (device_param->device_host_unified_memory == 1))
7282+
// Intel iGPU need to be "corrected".
7283+
// From clinfo:
7284+
// Max compute units: 32
7285+
// Preferred work group size multiple (device): 64
7286+
// Preferred work group size multiple (kernel): 64
7287+
// This is misleading.
7288+
7289+
if ((device_param->opencl_device_type & CL_DEVICE_TYPE_GPU) && (device_param->device_host_unified_memory == 1) && (device_param->opencl_device_vendor_id == VENDOR_ID_INTEL_SDK))
72827290
{
7291+
device_param->device_processors = 1;
7292+
}
7293+
7294+
// We have 32 threads now
7295+
//if ((device_param->device_processors == 1) && (device_param->device_host_unified_memory == 1))
7296+
//{
72837297
// APUs return some weird numbers. These values seem more appropriate (from rocminfo)
72847298
//Compute Unit: 2
72857299
//SIMDs per CU: 2
72867300
//Wavefront Size: 32(0x20)
72877301
//Max Waves Per CU: 32(0x20)
72887302

7289-
device_param->device_processors = 2 * 32;
7290-
}
7303+
// device_param->device_processors = 2 * 32;
7304+
//}
72917305

72927306
#if defined (__APPLE__)
72937307
if (device_param->opencl_device_type & CL_DEVICE_TYPE_GPU)

src/modules/module_21800.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ bool module_unstable_warning (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE
8484
return true;
8585
}
8686

87-
if ((device_param->opencl_device_vendor_id == VENDOR_ID_INTEL_SDK) && (device_param->opencl_device_type & CL_DEVICE_TYPE_GPU))
87+
if ((device_param->opencl_platform_vendor_id == VENDOR_ID_APPLE) && (device_param->opencl_device_vendor_id == VENDOR_ID_INTEL_SDK) && (device_param->opencl_device_type & CL_DEVICE_TYPE_GPU))
8888
{
8989
return true;
9090
}

src/modules/scrypt_common.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -154,12 +154,13 @@ const char *scrypt_module_extra_tuningdb_block (MAYBE_UNUSED const hashconfig_t
154154
{
155155
for (tmto = 0; tmto < 2; tmto++) // results in tmto = 2
156156
{
157-
if (device_param->device_host_unified_memory == 1) break; // do not touch
158-
159157
if ((device_param->opencl_device_vendor_id == VENDOR_ID_AMD)
160158
|| (device_param->opencl_device_vendor_id == VENDOR_ID_AMD_USE_HIP))
161159
{
162-
if (tmto == 0) continue; // at least 1
160+
if (device_param->device_host_unified_memory == 0) // This special rule only affects dGPUs not iGPU
161+
{
162+
if (tmto == 0) continue; // at least 1
163+
}
163164
}
164165

165166
const u64 size_per_accel_tmto = size_per_accel >> tmto;

src/terminal.c

Lines changed: 70 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -1263,15 +1263,15 @@ void backend_info (hashcat_ctx_t *hashcat_ctx)
12631263
OSVERSIONINFO osvi;
12641264
char platform_buf[256] = "N/A";
12651265
char release_buf[256] = "N/A";
1266-
1266+
12671267
GetSystemInfo (&sysinfo);
1268-
1268+
12691269
// Initialize version info structure
12701270
ZeroMemory (&osvi, sizeof (OSVERSIONINFO));
12711271
osvi.dwOSVersionInfoSize = sizeof (OSVERSIONINFO);
1272-
1272+
12731273
bool rc_version = (GetVersionEx (&osvi) != 0);
1274-
1274+
12751275
// Get processor architecture string
12761276
switch (sysinfo.wProcessorArchitecture)
12771277
{
@@ -1290,14 +1290,14 @@ void backend_info (hashcat_ctx_t *hashcat_ctx)
12901290
default:
12911291
snprintf (platform_buf, sizeof (platform_buf), "Unknown");
12921292
}
1293-
1293+
12941294
// Get Windows version string
12951295
if (rc_version)
12961296
{
12971297
snprintf (release_buf, sizeof (release_buf), "%lu.%lu.%lu",
12981298
osvi.dwMajorVersion, osvi.dwMinorVersion, osvi.dwBuildNumber);
12991299
}
1300-
1300+
13011301
if (user_options->machine_readable == false)
13021302
{
13031303
event_log_info (hashcat_ctx, "OS.Name......: Windows");
@@ -1446,17 +1446,19 @@ void backend_info (hashcat_ctx_t *hashcat_ctx)
14461446

14471447
const hc_device_param_t *device_param = backend_ctx->devices_param + backend_devices_idx;
14481448

1449-
int device_id = device_param->device_id;
1450-
char *device_name = device_param->device_name;
1451-
u32 device_processors = device_param->device_processors;
1452-
u32 device_maxclock_frequency = device_param->device_maxclock_frequency;
1453-
u64 device_local_mem_size = device_param->device_local_mem_size;
1454-
u64 device_available_mem = device_param->device_available_mem;
1455-
u64 device_global_mem = device_param->device_global_mem;
1456-
u8 pcie_domain = device_param->pcie_domain;
1457-
u8 pcie_bus = device_param->pcie_bus;
1458-
u8 pcie_device = device_param->pcie_device;
1459-
u8 pcie_function = device_param->pcie_function;
1449+
int device_id = device_param->device_id;
1450+
char *device_name = device_param->device_name;
1451+
u32 device_processors = device_param->device_processors;
1452+
u32 device_maxclock_frequency = device_param->device_maxclock_frequency;
1453+
u64 device_local_mem_size = device_param->device_local_mem_size;
1454+
u64 device_available_mem = device_param->device_available_mem;
1455+
u64 device_global_mem = device_param->device_global_mem;
1456+
int device_host_unified_memory = device_param->device_host_unified_memory;
1457+
u32 kernel_preferred_wgs_multiple = device_param->kernel_preferred_wgs_multiple;
1458+
u8 pcie_domain = device_param->pcie_domain;
1459+
u8 pcie_bus = device_param->pcie_bus;
1460+
u8 pcie_device = device_param->pcie_device;
1461+
u8 pcie_function = device_param->pcie_function;
14601462

14611463
if (device_param->device_id_alias_cnt)
14621464
{
@@ -1486,22 +1488,26 @@ void backend_info (hashcat_ctx_t *hashcat_ctx)
14861488
{
14871489
event_log_info (hashcat_ctx, " Name...........: %s", device_name);
14881490
event_log_info (hashcat_ctx, " Processor(s)...: %u", device_processors);
1491+
event_log_info (hashcat_ctx, " Preferred.Thrd.: %u", kernel_preferred_wgs_multiple);
14891492
event_log_info (hashcat_ctx, " Clock..........: %u", device_maxclock_frequency);
14901493
event_log_info (hashcat_ctx, " Memory.Total...: %" PRIu64 " MB", device_global_mem / 1024 / 1024);
14911494
event_log_info (hashcat_ctx, " Memory.Free....: %" PRIu64 " MB", device_available_mem / 1024 / 1024);
1495+
event_log_info (hashcat_ctx, " Memory.Unified.: %d", device_host_unified_memory);
14921496
event_log_info (hashcat_ctx, " Local.Memory...: %" PRIu64 " KB", device_local_mem_size / 1024);
14931497
event_log_info (hashcat_ctx, " PCI.Addr.BDFe..: %04x:%02x:%02x.%u", (u16) pcie_domain, pcie_bus, pcie_device, pcie_function);
14941498
event_log_info (hashcat_ctx, NULL);
14951499
}
14961500
else
14971501
{
14981502
printf ("\"Name\": \"%s\", ", device_name);
1499-
printf ("\"Processor(s)\": \"%u\", ", device_processors);
1503+
printf ("\"Processors\": \"%u\", ", device_processors);
1504+
printf ("\"PreferredThreadSize\": \"%u\", ", kernel_preferred_wgs_multiple);
15001505
printf ("\"Clock\": \"%u\", ", device_maxclock_frequency);
15011506
printf ("\"MemoryTotal\": \"%" PRIu64 " MB\", ", device_global_mem / 1024 / 1024);
15021507
printf ("\"MemoryFree\": \"%" PRIu64 " MB\", ", device_available_mem / 1024 / 1024);
1508+
printf ("\"MemoryUnified\": \"%d\", ", device_host_unified_memory);
15031509
printf ("\"LocalMemory\": \"%" PRIu64 " MB\", ", device_local_mem_size / 1024);
1504-
printf ("\"PCI.Addr.BDFe\": \"%04x:%02x:%02x.%u\" ", (u16) pcie_domain, pcie_bus, pcie_device, pcie_function);
1510+
printf ("\"PCIAddrBDFe\": \"%04x:%02x:%02x.%u\" ", (u16) pcie_domain, pcie_bus, pcie_device, pcie_function);
15051511
}
15061512

15071513
if (user_options->machine_readable == true)
@@ -1591,17 +1597,19 @@ void backend_info (hashcat_ctx_t *hashcat_ctx)
15911597

15921598
const hc_device_param_t *device_param = backend_ctx->devices_param + backend_devices_idx;
15931599

1594-
int device_id = device_param->device_id;
1595-
char *device_name = device_param->device_name;
1596-
u32 device_processors = device_param->device_processors;
1597-
u32 device_maxclock_frequency = device_param->device_maxclock_frequency;
1598-
u64 device_local_mem_size = device_param->device_local_mem_size;
1599-
u64 device_available_mem = device_param->device_available_mem;
1600-
u64 device_global_mem = device_param->device_global_mem;
1601-
u8 pcie_domain = device_param->pcie_domain;
1602-
u8 pcie_bus = device_param->pcie_bus;
1603-
u8 pcie_device = device_param->pcie_device;
1604-
u8 pcie_function = device_param->pcie_function;
1600+
int device_id = device_param->device_id;
1601+
char *device_name = device_param->device_name;
1602+
u32 device_processors = device_param->device_processors;
1603+
u32 device_maxclock_frequency = device_param->device_maxclock_frequency;
1604+
u64 device_local_mem_size = device_param->device_local_mem_size;
1605+
u64 device_available_mem = device_param->device_available_mem;
1606+
u64 device_global_mem = device_param->device_global_mem;
1607+
int device_host_unified_memory = device_param->device_host_unified_memory;
1608+
u32 kernel_preferred_wgs_multiple = device_param->kernel_preferred_wgs_multiple;
1609+
u8 pcie_domain = device_param->pcie_domain;
1610+
u8 pcie_bus = device_param->pcie_bus;
1611+
u8 pcie_device = device_param->pcie_device;
1612+
u8 pcie_function = device_param->pcie_function;
16051613

16061614
if (device_param->device_id_alias_cnt)
16071615
{
@@ -1631,22 +1639,26 @@ void backend_info (hashcat_ctx_t *hashcat_ctx)
16311639
{
16321640
event_log_info (hashcat_ctx, " Name...........: %s", device_name);
16331641
event_log_info (hashcat_ctx, " Processor(s)...: %u", device_processors);
1642+
event_log_info (hashcat_ctx, " Preferred.Thrd.: %u", kernel_preferred_wgs_multiple);
16341643
event_log_info (hashcat_ctx, " Clock..........: %u", device_maxclock_frequency);
16351644
event_log_info (hashcat_ctx, " Memory.Total...: %" PRIu64 " MB", device_global_mem / 1024 / 1024);
16361645
event_log_info (hashcat_ctx, " Memory.Free....: %" PRIu64 " MB", device_available_mem / 1024 / 1024);
1646+
event_log_info (hashcat_ctx, " Memory.Unified.: %d", device_host_unified_memory);
16371647
event_log_info (hashcat_ctx, " Local.Memory...: %" PRIu64 " KB", device_local_mem_size / 1024);
16381648
event_log_info (hashcat_ctx, " PCI.Addr.BDFe..: %04x:%02x:%02x.%u", (u16) pcie_domain, pcie_bus, pcie_device, pcie_function);
16391649
event_log_info (hashcat_ctx, NULL);
16401650
}
16411651
else
16421652
{
16431653
printf ("\"Name\": \"%s\", ", device_name);
1644-
printf ("\"Processor(s)\": \"%u\", ", device_processors);
1654+
printf ("\"Processors\": \"%u\", ", device_processors);
1655+
printf ("\"PreferredThreadSize\": \"%u\", ", kernel_preferred_wgs_multiple);
16451656
printf ("\"Clock\": \"%u\", ", device_maxclock_frequency);
16461657
printf ("\"MemoryTotal\": \"%" PRIu64 " MB\", ", device_global_mem / 1024 / 1024);
16471658
printf ("\"MemoryFree\": \"%" PRIu64 " MB\", ", device_available_mem / 1024 / 1024);
1659+
printf ("\"MemoryUnified\": \"%d\", ", device_host_unified_memory);
16481660
printf ("\"LocalMemory\": \"%" PRIu64 " MB\", ", device_local_mem_size / 1024);
1649-
printf ("\"PCI.Addr.BDFe\": \"%04x:%02x:%02x.%u\" ", (u16) pcie_domain, pcie_bus, pcie_device, pcie_function);
1661+
printf ("\"PCIAddrBDFe\": \"%04x:%02x:%02x.%u\" ", (u16) pcie_domain, pcie_bus, pcie_device, pcie_function);
16501662
}
16511663

16521664
if (user_options->machine_readable == true)
@@ -1738,6 +1750,8 @@ void backend_info (hashcat_ctx_t *hashcat_ctx)
17381750
u64 device_maxmem_alloc = device_param->device_maxmem_alloc;
17391751
u64 device_available_mem = device_param->device_available_mem;
17401752
u64 device_local_mem_size = device_param->device_local_mem_size;
1753+
int device_host_unified_memory = device_param->device_host_unified_memory;
1754+
u32 kernel_preferred_wgs_multiple = device_param->kernel_preferred_wgs_multiple;
17411755

17421756
cl_device_type opencl_device_type = device_param->opencl_device_type;
17431757
cl_uint opencl_device_vendor_id = device_param->opencl_device_vendor_id;
@@ -1774,6 +1788,7 @@ void backend_info (hashcat_ctx_t *hashcat_ctx)
17741788
event_log_info (hashcat_ctx, " Vendor.........: %s", opencl_device_vendor);
17751789
event_log_info (hashcat_ctx, " Name...........: %s", device_name);
17761790
event_log_info (hashcat_ctx, " Processor(s)...: %u", device_processors);
1791+
event_log_info (hashcat_ctx, " Preferred.Thrd.: %u", kernel_preferred_wgs_multiple);
17771792
event_log_info (hashcat_ctx, " Clock..........: N/A");
17781793
event_log_info (hashcat_ctx, " Memory.Total...: %" PRIu64 " MB (limited to %" PRIu64 " MB allocatable in one block)", device_global_mem / 1024 / 1024, device_maxmem_alloc / 1024 / 1024);
17791794
event_log_info (hashcat_ctx, " Memory.Free....: %" PRIu64 " MB", device_available_mem / 1024 / 1024);
@@ -1785,7 +1800,8 @@ void backend_info (hashcat_ctx_t *hashcat_ctx)
17851800
printf ("\"VendorID\": \"%u\", ", opencl_device_vendor_id);
17861801
printf ("\"Vendor\": \"%s\", ", opencl_device_vendor);
17871802
printf ("\"Name\": \"%s\", ", device_name);
1788-
printf ("\"Processor(s)\": \"%u\", ", device_processors);
1803+
printf ("\"Processors\": \"%u\", ", device_processors);
1804+
printf ("\"PreferredThreadSize\": \"%u\", ", kernel_preferred_wgs_multiple);
17891805
printf ("\"Clock\": \"%s\", ", "N/A");
17901806
printf ("\"MemoryTotal\": \"%" PRIu64 " MB\", ", device_global_mem / 1024 / 1024);
17911807
printf ("\"MemoryAllocPerBlock\": \"%" PRIu64 " MB\", ", device_maxmem_alloc / 1024 / 1024);
@@ -2000,20 +2016,22 @@ void backend_info (hashcat_ctx_t *hashcat_ctx)
20002016

20012017
const hc_device_param_t *device_param = backend_ctx->devices_param + backend_devices_idx;
20022018

2003-
int device_id = device_param->device_id;
2004-
char *device_name = device_param->device_name;
2005-
u32 device_processors = device_param->device_processors;
2006-
u32 device_maxclock_frequency = device_param->device_maxclock_frequency;
2007-
u64 device_maxmem_alloc = device_param->device_maxmem_alloc;
2008-
u64 device_local_mem_size = device_param->device_local_mem_size;
2009-
u64 device_available_mem = device_param->device_available_mem;
2010-
u64 device_global_mem = device_param->device_global_mem;
2011-
cl_device_type opencl_device_type = device_param->opencl_device_type;
2012-
cl_uint opencl_device_vendor_id = device_param->opencl_device_vendor_id;
2013-
char *opencl_device_vendor = device_param->opencl_device_vendor;
2014-
char *opencl_device_c_version = device_param->opencl_device_c_version;
2015-
char *opencl_device_version = device_param->opencl_device_version;
2016-
char *opencl_driver_version = device_param->opencl_driver_version;
2019+
int device_id = device_param->device_id;
2020+
char *device_name = device_param->device_name;
2021+
u32 device_processors = device_param->device_processors;
2022+
u32 device_maxclock_frequency = device_param->device_maxclock_frequency;
2023+
u64 device_maxmem_alloc = device_param->device_maxmem_alloc;
2024+
u64 device_local_mem_size = device_param->device_local_mem_size;
2025+
u64 device_available_mem = device_param->device_available_mem;
2026+
u64 device_global_mem = device_param->device_global_mem;
2027+
int device_host_unified_memory = device_param->device_host_unified_memory;
2028+
u32 kernel_preferred_wgs_multiple = device_param->kernel_preferred_wgs_multiple;
2029+
cl_device_type opencl_device_type = device_param->opencl_device_type;
2030+
cl_uint opencl_device_vendor_id = device_param->opencl_device_vendor_id;
2031+
char *opencl_device_vendor = device_param->opencl_device_vendor;
2032+
char *opencl_device_c_version = device_param->opencl_device_c_version;
2033+
char *opencl_device_version = device_param->opencl_device_version;
2034+
char *opencl_driver_version = device_param->opencl_driver_version;
20172035

20182036
if (device_param->device_id_alias_cnt)
20192037
{
@@ -2047,9 +2065,11 @@ void backend_info (hashcat_ctx_t *hashcat_ctx)
20472065
event_log_info (hashcat_ctx, " Name...........: %s", device_name);
20482066
event_log_info (hashcat_ctx, " Version........: %s", opencl_device_version);
20492067
event_log_info (hashcat_ctx, " Processor(s)...: %u", device_processors);
2068+
event_log_info (hashcat_ctx, " Preferred.Thrd.: %u", kernel_preferred_wgs_multiple);
20502069
event_log_info (hashcat_ctx, " Clock..........: %u", device_maxclock_frequency);
20512070
event_log_info (hashcat_ctx, " Memory.Total...: %" PRIu64 " MB (limited to %" PRIu64 " MB allocatable in one block)", device_global_mem / 1024 / 1024, device_maxmem_alloc / 1024 / 1024);
20522071
event_log_info (hashcat_ctx, " Memory.Free....: %" PRIu64 " MB", device_available_mem / 1024 / 1024);
2072+
event_log_info (hashcat_ctx, " Memory.Unified.: %d", device_host_unified_memory);
20532073
event_log_info (hashcat_ctx, " Local.Memory...: %" PRIu64 " KB", device_local_mem_size / 1024);
20542074
event_log_info (hashcat_ctx, " OpenCL.Version.: %s", opencl_device_c_version);
20552075
event_log_info (hashcat_ctx, " Driver.Version.: %s", opencl_driver_version);
@@ -2060,11 +2080,13 @@ void backend_info (hashcat_ctx_t *hashcat_ctx)
20602080
printf ("\"VendorID\": \"%u\", ", opencl_device_vendor_id);
20612081
printf ("\"Vendor\": \"%s\", ", opencl_device_vendor);
20622082
printf ("\"Name\": \"%s\", ", device_name);
2063-
printf ("\"Processor(s)\": \"%u\", ", device_processors);
2083+
printf ("\"Processors\": \"%u\", ", device_processors);
2084+
printf ("\"PreferredThreadSize\": \"%u\", ", kernel_preferred_wgs_multiple);
20642085
printf ("\"Clock\": \"%u\", ", device_maxclock_frequency);
20652086
printf ("\"MemoryTotal\": \"%" PRIu64 " MB\", ", device_global_mem / 1024 / 1024);
20662087
printf ("\"MemoryAllocPerBlock\": \"%" PRIu64 " MB\", ", device_maxmem_alloc / 1024 / 1024);
20672088
printf ("\"MemoryFree\": \"%" PRIu64 " MB\", ", device_available_mem / 1024 / 1024);
2089+
printf ("\"MemoryUnified\": \"%d\", ", device_host_unified_memory);
20682090
printf ("\"LocalMemory\": \"%" PRIu64 " MB\", ", device_local_mem_size / 1024);
20692091
printf ("\"OpenCLVersion\": \"%s\", ", opencl_device_c_version);
20702092
printf ("\"DriverVersion\": \"%s\" ", opencl_device_version);

0 commit comments

Comments
 (0)