[Beignet] clEnqueueNDRangeKernel and kernel completion

Edward Ching edward.k.ching at gmail.com
Wed Jun 5 17:02:32 PDT 2013


I hope this is the right forum to post comments/questions on Beignet OpenCL
API behaviour. If not, please ignore and excuse the disruption.

I'm running Beignet on an Ivy Bridge machine and noticed that clFinish
would return before the GPU has complete processing of previously submitted
commands.

e.g:
I submitted an OpenCL kernel via clEnqueueNDRangeKernel, followed by
clFinish, and expected the GPU to have finished all processing when
clFinish returns.

But clFinish returned right away, and when I then call clEnqueueMapBuffer
to access data, the call blocks, so I traced the logic all the way into the
Ivy Bridge GPU device driver (~/drivers/gpu/drm/i915/*), and it looks like
every IvyBr GPU batchbuffer used to submit an OpenCL kernel has an
associated sequence number which the GPU would write to a special location
which has to be monitored in order to tell if the GPU has finished
processing the submtted kernel (details in Intel HD graphics PRM and
i915/GEM design notes).  Neither clFinish nor clEnqueueNDRangeKernel does
this monitoring, and clEnqueueMapBuffer happened to do it when it tried to
transfer the buffer objects from GPU to CPU domain.

Does this make sense? It seems to me that clFinish should instead be
monitoring and blocking if the GPU is still busy executing an OpenCL kernel.

/Ed
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/beignet/attachments/20130605/06413340/attachment.html>


More information about the Beignet mailing list