mirror of
https://github.com/hashcat/hashcat.git
synced 2025-02-26 22:33:00 +00:00
Do not error and exit if an OpenCL platform has no devices, just print a warning and continue with the next platform
This commit is contained in:
parent
f1cd53e335
commit
e2dbaa6efa
@ -14,6 +14,7 @@
|
|||||||
- Replace LINUX macro with compiler predefined macro __linux__
|
- Replace LINUX macro with compiler predefined macro __linux__
|
||||||
- Allow the use of enc_id == 0 in hash-mode 10600 and 10700 as it takes no part in the actual computation
|
- Allow the use of enc_id == 0 in hash-mode 10600 and 10700 as it takes no part in the actual computation
|
||||||
- Get rid of exit() calls in OpenCL wrapper library with the goal to have a better control which error can be ignored under special circumstances
|
- Get rid of exit() calls in OpenCL wrapper library with the goal to have a better control which error can be ignored under special circumstances
|
||||||
|
- Do not error and exit if an OpenCL platform has no devices, just print a warning and continue with the next platform
|
||||||
|
|
||||||
##
|
##
|
||||||
## Bugs
|
## Bugs
|
||||||
|
@ -14095,9 +14095,13 @@ int main (int argc, char **argv)
|
|||||||
|
|
||||||
if (CL_err != CL_SUCCESS)
|
if (CL_err != CL_SUCCESS)
|
||||||
{
|
{
|
||||||
log_error ("ERROR: clGetDeviceIDs(): %s\n", val2cstr_cl (CL_err));
|
//log_error ("ERROR: clGetDeviceIDs(): %s\n", val2cstr_cl (CL_err));
|
||||||
|
|
||||||
return -1;
|
//return -1;
|
||||||
|
|
||||||
|
// Silently ignore at this point, it will be reused later and create a note for the user at that point
|
||||||
|
|
||||||
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
for (uint platform_devices_id = 0; platform_devices_id < platform_devices_cnt; platform_devices_id++)
|
for (uint platform_devices_id = 0; platform_devices_id < platform_devices_cnt; platform_devices_id++)
|
||||||
@ -14161,15 +14165,6 @@ int main (int argc, char **argv)
|
|||||||
|
|
||||||
cl_platform_id platform = platforms[platform_id];
|
cl_platform_id platform = platforms[platform_id];
|
||||||
|
|
||||||
CL_err = hc_clGetDeviceIDs (data.ocl, platform, CL_DEVICE_TYPE_ALL, DEVICES_MAX, platform_devices, &platform_devices_cnt);
|
|
||||||
|
|
||||||
if (CL_err != CL_SUCCESS)
|
|
||||||
{
|
|
||||||
log_error ("ERROR: clGetDeviceIDs(): %s\n", val2cstr_cl (CL_err));
|
|
||||||
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
|
|
||||||
char platform_vendor[INFOSZ] = { 0 };
|
char platform_vendor[INFOSZ] = { 0 };
|
||||||
|
|
||||||
CL_err = hc_clGetPlatformInfo (data.ocl, platform, CL_PLATFORM_VENDOR, sizeof (platform_vendor), platform_vendor, NULL);
|
CL_err = hc_clGetPlatformInfo (data.ocl, platform, CL_PLATFORM_VENDOR, sizeof (platform_vendor), platform_vendor, NULL);
|
||||||
@ -14224,7 +14219,18 @@ int main (int argc, char **argv)
|
|||||||
platform_vendor_id = VENDOR_ID_GENERIC;
|
platform_vendor_id = VENDOR_ID_GENERIC;
|
||||||
}
|
}
|
||||||
|
|
||||||
const uint platform_skipped = ((opencl_platforms_filter & (1 << platform_id)) == 0);
|
uint platform_skipped = ((opencl_platforms_filter & (1 << platform_id)) == 0);
|
||||||
|
|
||||||
|
CL_err = hc_clGetDeviceIDs (data.ocl, platform, CL_DEVICE_TYPE_ALL, DEVICES_MAX, platform_devices, &platform_devices_cnt);
|
||||||
|
|
||||||
|
if (CL_err != CL_SUCCESS)
|
||||||
|
{
|
||||||
|
//log_error ("ERROR: clGetDeviceIDs(): %s\n", val2cstr_cl (CL_err));
|
||||||
|
|
||||||
|
//return -1;
|
||||||
|
|
||||||
|
platform_skipped = 2;
|
||||||
|
}
|
||||||
|
|
||||||
if ((benchmark == 1 || quiet == 0) && (algorithm_pos == 0))
|
if ((benchmark == 1 || quiet == 0) && (algorithm_pos == 0))
|
||||||
{
|
{
|
||||||
@ -14240,11 +14246,16 @@ int main (int argc, char **argv)
|
|||||||
|
|
||||||
log_info (line);
|
log_info (line);
|
||||||
}
|
}
|
||||||
else
|
else if (platform_skipped == 1)
|
||||||
{
|
{
|
||||||
log_info ("OpenCL Platform #%u: %s, skipped", platform_id + 1, platform_vendor);
|
log_info ("OpenCL Platform #%u: %s, skipped", platform_id + 1, platform_vendor);
|
||||||
log_info ("");
|
log_info ("");
|
||||||
}
|
}
|
||||||
|
else if (platform_skipped == 2)
|
||||||
|
{
|
||||||
|
log_info ("OpenCL Platform #%u: %s, skipped! No OpenCL compatible devices found", platform_id + 1, platform_vendor);
|
||||||
|
log_info ("");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user