openwall / openwall/john

OpenCL: Common support for multiple devices

Open
#1,468 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement RFC / discussion
Dominant language
C
Stars
13.6k
Forks
2.6k
PR merge metrics
No merged PRs in 30d

Description

RFC @claudioandre @Sayantan2048

We should figure out a KISS way of supporting multi-device use for more formats, with as little effort as possible (I'm lazy).

Brainstorming:

  1. All common OpenCL variables/functions should work on arrays. Some already do. For example, local_work_size, global_work_size, crypt_kernel and so on should all be arrays of [MAX_GPU_DEVICES].
  2. A format calling opencl_init would init all devices specified (I think this already happens)
  3. Auto-tune should be made for all chosen devices, storing LWS/GWS results per device. Note: If we deem two or more devices identical, we should obviously just re-use the values and not test again.
  4. Auto-tune can (already) aim for a duration time, eg. 200ms.
  5. Say we end up with a global_work_size[0] of 1024 and global_work_size[1] of 2048. We'd simply set max_keys_per_crypt to 3072.
  6. set_salt would send same salt to each device.
  7. crypt_all() would iterate through the device list and send the number of keys to each device that corresponds with its global_work_size. Then launch each kernel, and so on.

That's about it, I think.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by tracing the OpenCL entry points named in the issue: opencl_init, set_salt, and crypt_all, along with shared variables such as local_work_size and global_work_size. Determine how device lists and auto-tuning currently work; done would mean a settled, tested design for distributing work and tuning across multiple devices.

Written by the indexing model from the issue text.

Assessment

Tech stack
c
Domain
performance
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
20/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.