Merge branch 'master' into master

pull/2501/head
Jens Steube 4 years ago committed by GitHub
commit f358b641e0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -25,6 +25,7 @@
- Compile macOS: Fixed makefile target 'clean' to correctly remove *.dSYM folders
- Compile ZLIB: Fixed makefile include paths in case USE_SYSTEM_ZLIB is used
- Hash-Mode 21200 (md5(sha1($salt).md5($pass))): Improved speed by using pre-computed SHA1
- OpenCL Devices: Utilize PCI domain to improve alias device detection
- OpenCL Kernels: Added datatypes to literals of enum costants
- OpenCL Kernels: Added pure kernels for hash-mode 600 (BLAKE2b-512)
- OpenCL Runtime: Add some unstable warnings for some SHA512 based algorithms on AMD GPU on macOS

@ -1056,6 +1056,7 @@ typedef struct hc_device_param
int device_id_alias_cnt;
int device_id_alias_buf[DEVICES_MAX];
u8 pcie_domain;
u8 pcie_bus;
u8 pcie_device;
u8 pcie_function;
@ -1437,6 +1438,7 @@ typedef struct hc_device_param
cl_device_type opencl_device_type;
cl_uint opencl_device_vendor_id;
u32 opencl_platform_id;
cl_uint opencl_platform_vendor_id;
cl_device_id opencl_device;

@ -39,18 +39,34 @@ static double TARGET_MSEC_PROFILE[4] = { 2, 12, 96, 480 };
static bool is_same_device (const hc_device_param_t *src, const hc_device_param_t *dst)
{
// First check by PCI address
if (src->pcie_domain != dst->pcie_domain) return false; // PCI domain not available on OpenCL
if (src->pcie_bus != dst->pcie_bus) return false;
if (src->pcie_device != dst->pcie_device) return false;
if (src->pcie_function != dst->pcie_function) return false;
// Intel CPU and embedded GPU would survive up to here!
if (src->opencl_device_type != dst->opencl_device_type) return false;
// macOS still can't distinguish the devices by PCIe bus:
if (src->device_processors != dst->device_processors) return false;
// CUDA can't have aliases
if ((src->is_cuda == true) && (dst->is_cuda == true)) return false;
// But OpenCL can have aliases
if ((src->is_opencl == true) && (dst->is_opencl == true))
{
// Intel CPU and embedded GPU would survive up to here!
if (src->opencl_device_type != dst->opencl_device_type) return false;
// There should be no aliases on the same opencl platform
if (src->opencl_platform_id == dst->opencl_platform_id) return false;
}
return true;
}
@ -5473,13 +5489,17 @@ int backend_ctx_devices_init (hashcat_ctx_t *hashcat_ctx, const int comptime)
// pcie_bus, pcie_device, pcie_function
int pci_bus_id_nv = 0;
int pci_slot_id_nv = 0;
int pci_domain_id_nv = 0;
int pci_bus_id_nv = 0;
int pci_slot_id_nv = 0;
if (hc_cuDeviceGetAttribute (hashcat_ctx, &pci_domain_id_nv, CU_DEVICE_ATTRIBUTE_PCI_DOMAIN_ID, cuda_device) == -1) return -1;
if (hc_cuDeviceGetAttribute (hashcat_ctx, &pci_bus_id_nv, CU_DEVICE_ATTRIBUTE_PCI_BUS_ID, cuda_device) == -1) return -1;
if (hc_cuDeviceGetAttribute (hashcat_ctx, &pci_slot_id_nv, CU_DEVICE_ATTRIBUTE_PCI_DEVICE_ID, cuda_device) == -1) return -1;
device_param->pcie_domain = (u8) (pci_domain_id_nv);
device_param->pcie_bus = (u8) (pci_bus_id_nv);
device_param->pcie_device = (u8) (pci_slot_id_nv >> 3);
device_param->pcie_function = (u8) (pci_slot_id_nv & 7);
@ -5717,6 +5737,10 @@ int backend_ctx_devices_init (hashcat_ctx_t *hashcat_ctx, const int comptime)
device_param->is_opencl = true;
// store opencl platform i
device_param->opencl_platform_id = opencl_platforms_idx;
// check OpenCL version
device_param->use_opencl12 = false;
@ -6190,6 +6214,7 @@ int backend_ctx_devices_init (hashcat_ctx_t *hashcat_ctx, const int comptime)
if (hc_clGetDeviceInfo (hashcat_ctx, device_param->opencl_device, CL_DEVICE_TOPOLOGY_AMD, sizeof (amdtopo), &amdtopo, NULL) == -1) return -1;
device_param->pcie_domain = 0; // no attribute to query
device_param->pcie_bus = amdtopo.pcie.bus;
device_param->pcie_device = amdtopo.pcie.device;
device_param->pcie_function = amdtopo.pcie.function;
@ -6204,6 +6229,7 @@ int backend_ctx_devices_init (hashcat_ctx_t *hashcat_ctx, const int comptime)
if (hc_clGetDeviceInfo (hashcat_ctx, device_param->opencl_device, CL_DEVICE_PCI_SLOT_ID_NV, sizeof (pci_slot_id_nv), &pci_slot_id_nv, NULL) == -1) return -1;
device_param->pcie_domain = 0; // no attribute to query
device_param->pcie_bus = (u8) (pci_bus_id_nv);
device_param->pcie_device = (u8) (pci_slot_id_nv >> 3);
device_param->pcie_function = (u8) (pci_slot_id_nv & 7);

Loading…
Cancel
Save