Skip to content

Commit

Permalink
Backend types: The default filter for the device types is now set so …
Browse files Browse the repository at this point in the history
…that only the GPU is used, except for APPLE, where we set CPU
  • Loading branch information
jsteube committed Nov 1, 2021
1 parent 7f37a32 commit f84aca8
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 6 deletions.
1 change: 1 addition & 0 deletions docs/changes.txt
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
- AMD Driver: Updated requirements for AMD Linux drivers to ROCm 4.5 or later due to new HIP interface
- Backend devices: In -S mode, limit the number of workitems so that no more than 2GB of host memory is required per backend device
- Backend devices: In non -S mode, limit the number of workitems so that no more than 4GB of host memory is required per backend device
- Backend types: The default filter for the device types is now set so that only the GPU is used, except for APPLE, where we set CPU
- Makefile: Added wildcard include src/modules/module_*.mk directive so that plugin developers can add 3rd party libraries for their plugins
- Rejects: Disabled checking of the minimum and maximum length of the password candidate in attack-mode 9 because they are incompatible
- POCL: Added a workaround for an issue in POCL that uses a quote character as part of the path itself given to a path for the -I option
Expand Down
21 changes: 15 additions & 6 deletions src/backend.c
Original file line number Diff line number Diff line change
Expand Up @@ -339,15 +339,24 @@ static bool setup_opencl_device_types_filter (hashcat_ctx_t *hashcat_ctx, const
}
else
{
#if defined (__APPLE__)

// For apple use CPU only, because GPU drivers are not reliable
// The user can explicitly enable GPU by setting -D2

//opencl_device_types_filter = CL_DEVICE_TYPE_ALL & ~CL_DEVICE_TYPE_GPU;
opencl_device_types_filter = CL_DEVICE_TYPE_CPU;

#else

// 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
// Do not use FPGA/other by default, this is a rare case and we expect the users to enable this manually.
// this is needed since Intel One API started to add FPGA emulated OpenCL device by default and it's just annoying.

//opencl_device_types_filter = CL_DEVICE_TYPE_ALL & ~CL_DEVICE_TYPE_CPU;
opencl_device_types_filter = CL_DEVICE_TYPE_GPU;

#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
}

Expand Down

0 comments on commit f84aca8

Please sign in to comment.