[GH-ISSUE #2295] OpenCL multiple platform behavior #1539

Closed
opened 2026-10-15 04:19:35 +07:00 by bsakaguchi · 6 comments
Owner

Originally created by @magnumripper on GitHub (Oct 3, 2016).
Original GitHub issue: https://github.com/openwall/john/issues/2295

http://www.openwall.com/lists/john-users/2016/10/03/1

Apparently there's platform #0 (Mesa) with no devices and platform #1 (nvidia) with two devices. We don't seem to handle that very well.

The following (from OP on ML) might be a problem with Mesa (I'm not quite sure):

NULL platform behavior
  clGetPlatformInfo(NULL, CL_PLATFORM_NAME, ...)  No platform
  clGetDeviceIDs(NULL, CL_DEVICE_TYPE_ALL, ...)   No platform
  clCreateContext(NULL, ...) [default]            No platform
  clCreateContext(NULL, ...) [other]              <checkNullCtx:2241: create context with device from non-default platform : error 209>
  clCreateContextFromType(NULL, CL_DEVICE_TYPE_CPU)  No platform
  clCreateContextFromType(NULL, CL_DEVICE_TYPE_GPU)  No platform
  clCreateContextFromType(NULL, CL_DEVICE_TYPE_ACCELERATOR)  No platform
  clCreateContextFromType(NULL, CL_DEVICE_TYPE_CUSTOM)  No platform
  clCreateContextFromType(NULL, CL_DEVICE_TYPE_ALL)  No platform

Originally created by @magnumripper on GitHub (Oct 3, 2016). Original GitHub issue: https://github.com/openwall/john/issues/2295 http://www.openwall.com/lists/john-users/2016/10/03/1 Apparently there's platform #0 (Mesa) with no devices and platform #1 (nvidia) with two devices. We don't seem to handle that very well. The following (from OP on ML) might be a problem with Mesa (I'm not quite sure): ``` NULL platform behavior clGetPlatformInfo(NULL, CL_PLATFORM_NAME, ...) No platform clGetDeviceIDs(NULL, CL_DEVICE_TYPE_ALL, ...) No platform clCreateContext(NULL, ...) [default] No platform clCreateContext(NULL, ...) [other] <checkNullCtx:2241: create context with device from non-default platform : error 209> clCreateContextFromType(NULL, CL_DEVICE_TYPE_CPU) No platform clCreateContextFromType(NULL, CL_DEVICE_TYPE_GPU) No platform clCreateContextFromType(NULL, CL_DEVICE_TYPE_ACCELERATOR) No platform clCreateContextFromType(NULL, CL_DEVICE_TYPE_CUSTOM) No platform clCreateContextFromType(NULL, CL_DEVICE_TYPE_ALL) No platform ```
bsakaguchi 2026-10-15 04:19:35 +07:00
Author
Owner

@magnumripper commented on GitHub (Oct 3, 2016):

BTW our --list=opencl-devices is supposed to iterate over platforms and list each device on them. Not sure why even that fails.

<!-- gh-comment-id:251176578 --> @magnumripper commented on GitHub (Oct 3, 2016): BTW our `--list=opencl-devices` is supposed to iterate over platforms and list each device on them. Not sure why even that fails.
Author
Owner

@ghost commented on GitHub (Oct 3, 2016):

We still need a crazy environment to improve the OpenCL detection robustness.

  • This particular case, I guess, I can solve easily.

BTW: --platform was removed on bleeding.

<!-- gh-comment-id:251178535 --> @ghost commented on GitHub (Oct 3, 2016): We still need a crazy environment to improve the OpenCL detection robustness. - This particular case, I guess, I can solve easily. BTW: --platform was removed on bleeding.
Author
Owner

@magnumripper commented on GitHub (Oct 6, 2016):

This should be history after #2298

<!-- gh-comment-id:252091904 --> @magnumripper commented on GitHub (Oct 6, 2016): This should be history after #2298
Author
Owner

@sadimanna commented on GitHub (Jan 28, 2019):

Has this problem been solved? I can't figure out the solution. Can anyone help?

Getting output ::

NULL platform behavior
  clGetPlatformInfo(NULL, CL_PLATFORM_NAME, ...)  No platform
  clGetDeviceIDs(NULL, CL_DEVICE_TYPE_ALL, ...)   No platform
  clCreateContext(NULL, ...) [default]            No platform
  clCreateContext(NULL, ...) [other]              Success [Intel]
  clCreateContextFromType(NULL, CL_DEVICE_TYPE_CPU)  No platform
  clCreateContextFromType(NULL, CL_DEVICE_TYPE_GPU)  No platform
  clCreateContextFromType(NULL, CL_DEVICE_TYPE_ACCELERATOR)  No platform
  clCreateContextFromType(NULL, CL_DEVICE_TYPE_CUSTOM)  No platform
  clCreateContextFromType(NULL, CL_DEVICE_TYPE_ALL)  No platform
<!-- gh-comment-id:457993174 --> @sadimanna commented on GitHub (Jan 28, 2019): Has this problem been solved? I can't figure out the solution. Can anyone help? Getting output :: ``` NULL platform behavior clGetPlatformInfo(NULL, CL_PLATFORM_NAME, ...) No platform clGetDeviceIDs(NULL, CL_DEVICE_TYPE_ALL, ...) No platform clCreateContext(NULL, ...) [default] No platform clCreateContext(NULL, ...) [other] Success [Intel] clCreateContextFromType(NULL, CL_DEVICE_TYPE_CPU) No platform clCreateContextFromType(NULL, CL_DEVICE_TYPE_GPU) No platform clCreateContextFromType(NULL, CL_DEVICE_TYPE_ACCELERATOR) No platform clCreateContextFromType(NULL, CL_DEVICE_TYPE_CUSTOM) No platform clCreateContextFromType(NULL, CL_DEVICE_TYPE_ALL) No platform ```
Author
Owner

@magnumripper commented on GitHub (Jan 28, 2019):

Are you using latest code from here?

<!-- gh-comment-id:458040848 --> @magnumripper commented on GitHub (Jan 28, 2019): Are you using latest code from here?
Author
Owner

@ghost commented on GitHub (Jan 28, 2019):

Has this problem been solved?

Could you please post the output?

  • _SKIP_OCL_INITIALIZATION=1 ./john --list=opencl-devices -verb=5

And try to filter devices (what is really failing):

  • ./john --list=opencl-devices -verb=5 -device=0
  • ./john --list=opencl-devices -verb=5 -device=1 #AND so on.
<!-- gh-comment-id:458119644 --> @ghost commented on GitHub (Jan 28, 2019): > Has this problem been solved? Could you please post the output? * `_SKIP_OCL_INITIALIZATION=1 ./john --list=opencl-devices -verb=5` And try to filter devices (what is really failing): * `./john --list=opencl-devices -verb=5 -device=0` * `./john --list=opencl-devices -verb=5 -device=1` #AND so on.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
openwall/john#1539
No description provided.