[Beignet] johntheripper/OpenCL clGetEventProfilingInfo issue

Zhigang Gong zhigang.gong at gmail.com
Fri Oct 24 22:44:58 PDT 2014


This should be an application bug, according to OpenCL 1.2 spec:

  CL_PROFILING_INFO_NOT_AVAILABLE if the CL_QUEUE_PROFILING_ENABLE
  flag is not set for the command-queue, if the execution status of
the command identified
  by event is not CL_COMPLETE or if event is a user event object.

To make sure an event's state to be CL_COMPLETE, you need to call
clWaitForEvents()
rather than clFinish().

According to spec, clFinish() is used to :
  blocks until all previously queued OpenCL commands in command_queue are issued
  to the associated device and have completed.

It is not to update all the related event's state. And it is too
heavy, as it will wait for the command
to be completed. The event's CL_COMPLETE state means the command has
been flushed into
the GPU's command buffer and may haven't completed. It's used to do
GPU command queue
side synchronization. clFinish() is to synchronize with host CPU.

I would recommend you to call clWaitForEvents before you call the
clGetEventProfilingInfo().
If you still met problems with that change, please let us know.

Thanks,
Zhigang Gong.


On Sat, Oct 25, 2014 at 6:13 AM, Oleksii Shevchuk
<public.avatar at gmail.com> wrote:
> Hi list!
>
> I'm trying to use beignet (67650189c145a65addffdcd4d8ff452709bd4149)
> with johntheripper (ceb8aa1899817965afd26ffb651932e475a7bbc7 at
> https://github.com/magnumripper/JohnTheRipper) on i7/HD4000.
> Test suite reports that tests are passed:
>
> .....
>
> compiler_abs_diff_int()Instruction (#42) src too large pooloffset 11
> Instruction (#20) src too large pooloffset 11
>     [SUCCESS]
>
> .....
>
>
>     [SUCCESS]
> double_precision_check()
>   - WARN: GPU doesn't have correct double precision. Got 9.995699E-05, expected 0.0001000001
>
> summary:
> ----------
>   total: 421
>   run: 421
>   pass: 419
>   fail: 0
>   pass rate: 1.000000
>
> But with john I ran into the next problem:
>
>  john -format=rar-opencl -te
> Will run 4 OpenMP threads
> Device 0: Intel(R) HD Graphics IvyBridge M GT2
> OpenCL error (CL_PROFILING_INFO_NOT_AVAILABLE) in file (common-opencl.c) at line (1210) - (Failed in clGetEventProfilingInfo I)
>
> Here is this place:
> https://github.com/magnumripper/JohnTheRipper/blob/bleeding-jumbo/src/common-opencl.c#L1205
>
> According to the cl_api.c, in the clGetEventProfilingInfo, status is not
> equals to CL_COMPLETE, and all other conditions were ok.
>
> I add this to cl_api.c / clGetEventProfilingInfo
>     fprintf(stderr, "ER: %d? %d? %d?\n",.
>       event->type == CL_COMMAND_USER, !(event->queue->props & CL_QUEUE_PROFILING_ENABLE),.
>       event->status != CL_COMPLETE);
>
> And result was:
> LD_PRELOAD=/home/avatar/Software/beignet-build/src/libcl.so ../run/john -format=encfs-opencl -te
> Will run 4 OpenMP threads
> Device 0: Intel(R) HD Graphics IvyBridge M GT2
> ER: 0? 0? 1?
> OpenCL error (CL_PROFILING_INFO_NOT_AVAILABLE) in file (common-opencl.c) at line (1211) - (Failed in clGetEventProfilingInfo I)
>
> According to the documentation, before requesting
> clGetEventProfilingInfo, the queue should be created with
> CL_QUEUE_PROFILING_ENABLE. So I add clFinish after all queues creation
> with this flag. Result was the same.
>
> So, the question is, are there problems in the beignet implementation,
> or in their code?
>
> Thanks.
>
> // wbr
> // alxchk
> _______________________________________________
> Beignet mailing list
> Beignet at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/beignet


More information about the Beignet mailing list