diff --git a/docs/changes.txt b/docs/changes.txt index 436ea3027..c5e41e829 100644 --- a/docs/changes.txt +++ b/docs/changes.txt @@ -16,6 +16,7 @@ ## - CUDA Backend: Do not warn about missing CUDA SDK installation if --stdout is used +- OpenCL Backend: Use CL_DEVICE_BOARD_NAME_AMD instead of CL_DEVICE_NAME for device name in case OpenCL runtime supports this query - Performance Monitor: Add -S as a user suggestion to improve cracking performance in specific attack configurations - Status Screen: Show currently running kernel type (pure, optimized) and generator type (host, device) - UTF8-to-UTF16: Replaced naive UTF8 to UTF16 conversion with true conversion for RAR3, AES Crypt, MultiBit HD (scrypt) and Umbraco HMAC-SHA1 diff --git a/hashcat.hctune b/hashcat.hctune index 1f605db34..077e42e85 100644 --- a/hashcat.hctune +++ b/hashcat.hctune @@ -499,13 +499,13 @@ GeForce_RTX_2080_Ti * 15700 1 68 GeForce_RTX_2080_Ti * 22700 1 68 A ## 8GB -gfx900 * 8900 1 28 A -gfx900 * 9300 1 442 A -gfx900 * 15700 1 28 A -gfx900 * 22700 1 28 A +Vega_10_XL/XT_[Radeon_RX_Vega_56/64] * 8900 1 28 A +Vega_10_XL/XT_[Radeon_RX_Vega_56/64] * 9300 1 442 A +Vega_10_XL/XT_[Radeon_RX_Vega_56/64] * 15700 1 28 A +Vega_10_XL/XT_[Radeon_RX_Vega_56/64] * 22700 1 28 A ## 4GB -Ellesmere * 8900 1 14 A -Ellesmere * 9300 1 126 A -Ellesmere * 15700 1 14 A -Ellesmere * 22700 1 14 A +AMD_Radeon_(TM)_RX_480_Graphics * 8900 1 14 A +AMD_Radeon_(TM)_RX_480_Graphics * 9300 1 126 A +AMD_Radeon_(TM)_RX_480_Graphics * 15700 1 14 A +AMD_Radeon_(TM)_RX_480_Graphics * 22700 1 14 A diff --git a/include/ext_OpenCL.h b/include/ext_OpenCL.h index 8d29571f9..42e37deed 100644 --- a/include/ext_OpenCL.h +++ b/include/ext_OpenCL.h @@ -28,6 +28,7 @@ // AMD extras #define CL_DEVICE_TOPOLOGY_AMD 0x4037 +#define CL_DEVICE_BOARD_NAME_AMD 0x4038 typedef union { diff --git a/src/backend.c b/src/backend.c index 1cfee2a1d..cce9d70a3 100644 --- a/src/backend.c +++ b/src/backend.c @@ -6057,21 +6057,58 @@ int backend_ctx_devices_init (hashcat_ctx_t *hashcat_ctx, const int comptime) // device_name - if (hc_clGetDeviceInfo (hashcat_ctx, device_param->opencl_device, CL_DEVICE_NAME, 0, NULL, ¶m_value_size) == -1) + // try CL_DEVICE_BOARD_NAME_AMD first, if it fails fall back to CL_DEVICE_NAME + // since AMD ROCm does not identify itself at this stage we simply check for return code from clGetDeviceInfo() + + #define CHECK_BOARD_NAME_AMD 1 + + cl_int rc_board_name_amd = 0; + + if (CHECK_BOARD_NAME_AMD) { - device_param->skipped = true; - continue; - } + backend_ctx_t *backend_ctx = hashcat_ctx->backend_ctx; + + OCL_PTR *ocl = (OCL_PTR *) backend_ctx->ocl; - char *device_name = (char *) hcmalloc (param_value_size); + rc_board_name_amd = ocl->clGetDeviceInfo (device_param->opencl_device, CL_DEVICE_BOARD_NAME_AMD, 0, NULL, NULL); + } - if (hc_clGetDeviceInfo (hashcat_ctx, device_param->opencl_device, CL_DEVICE_NAME, param_value_size, device_name, NULL) == -1) + if (rc_board_name_amd == CL_SUCCESS) { - device_param->skipped = true; - continue; + if (hc_clGetDeviceInfo (hashcat_ctx, device_param->opencl_device, CL_DEVICE_BOARD_NAME_AMD, 0, NULL, ¶m_value_size) == -1) + { + device_param->skipped = true; + continue; + } + + char *device_name = (char *) hcmalloc (param_value_size); + + if (hc_clGetDeviceInfo (hashcat_ctx, device_param->opencl_device, CL_DEVICE_BOARD_NAME_AMD, param_value_size, device_name, NULL) == -1) + { + device_param->skipped = true; + continue; + } + + device_param->device_name = device_name; } + else + { + if (hc_clGetDeviceInfo (hashcat_ctx, device_param->opencl_device, CL_DEVICE_NAME, 0, NULL, ¶m_value_size) == -1) + { + device_param->skipped = true; + continue; + } + + char *device_name = (char *) hcmalloc (param_value_size); - device_param->device_name = device_name; + if (hc_clGetDeviceInfo (hashcat_ctx, device_param->opencl_device, CL_DEVICE_NAME, param_value_size, device_name, NULL) == -1) + { + device_param->skipped = true; + continue; + } + + device_param->device_name = device_name; + } hc_string_trim_leading (device_param->device_name);