1
mirror of https://github.com/hashcat/hashcat synced 2024-11-02 20:39:22 +01:00

OpenCL Runtime: Switched default OpenCL device type on macOS from GPU to CPU. Use -D 2 to enable GPU devices.

This commit is contained in:
Jens Steube 2020-09-05 23:20:59 +02:00
parent 343d3bc0aa
commit 111f39eeb2
2 changed files with 22 additions and 0 deletions

View File

@ -40,6 +40,7 @@
- Module Structure: Add 3rd party library hook management functions. This also requires an update to all existing module_init()
- Hash-Mode 13200 (AxCrypt): Changed the name to AxCrypt 1 to avoid confusion
- Hash-Mode 13300 (AxCrypt in-memory SHA1): Changed the name to AxCrypt 1 in-memory SHA1
- OpenCL Runtime: Switched default OpenCL device type on macOS from GPU to CPU. Use -D 2 to enable GPU devices.
- Unit tests: Added Python 3 support for all of the Python code in our test framework
- Unit tests: Fixed the packaging of test (-p) feature

View File

@ -317,8 +317,14 @@ static bool setup_opencl_device_types_filter (hashcat_ctx_t *hashcat_ctx, const
{
// Do not use CPU by default, this often reduces GPU performance because
// the CPU is too busy to handle GPU synchronization
// Except for apple, because GPU drivers are not reliable
// The user can explicitly enable it by setting -D
#if defined (__APPLE__)
opencl_device_types_filter = CL_DEVICE_TYPE_ALL & ~CL_DEVICE_TYPE_GPU;
#else
opencl_device_types_filter = CL_DEVICE_TYPE_ALL & ~CL_DEVICE_TYPE_CPU;
#endif
}
*out = opencl_device_types_filter;
@ -6147,6 +6153,21 @@ int backend_ctx_devices_init (hashcat_ctx_t *hashcat_ctx, const int comptime)
#endif // __APPLE__
*/
#if defined (__APPLE__)
if (opencl_device_type & CL_DEVICE_TYPE_GPU)
{
if (user_options->force == false)
{
if (user_options->quiet == false) event_log_warning (hashcat_ctx, "* Device #%u: Apple's OpenCL drivers (GPU) are known to be unreliable.", device_id + 1);
if (user_options->quiet == false) event_log_warning (hashcat_ctx, " There are many reports of false negatives and other issues.");
if (user_options->quiet == false) event_log_warning (hashcat_ctx, " This is not a hashcat specific issue. Many other projects suffer from the bad quality of these drivers.");
if (user_options->quiet == false) event_log_warning (hashcat_ctx, " You can use --force to override, but do not report related errors. You have been warned.");
device_param->skipped = true;
}
}
#endif // __APPLE__
// skipped
if ((backend_ctx->backend_devices_filter & (1ULL << device_id)) == 0)