When my program finishes, I try to release all command queues. But clReleaseCommandQueue hangs.
This is on windows 7, latest release Catalyst driver, and HD 7700 card.
What is the best way of troubleshooting this problem ? When I pause all threads in Visual Studio, I see
that there are many worker threads calling amdocl64.dll, so it looks like there are still items in the queue.
Solved! Go to Solution.
As per the clReleaseCommandQueue:
"After the command_queue reference count becomes zero and all commands queued to command_queue have finished (e.g., kernel executions, memory object updates, etc.), the command-queue is deleted.
clReleaseCommandQueue performs an implicit flush to issue any previously queued OpenCL commands in command_queue."
So, it seems that the problem is this:
If the queue has unexecuted kernels that are waiting on events to complete, then clReleaseCommandQueue
will hang.
In my opinion, this is a bug: releasing a command queue should remove all unexecuted kernels, even if
they are waiting on events.
As per the clReleaseCommandQueue:
"After the command_queue reference count becomes zero and all commands queued to command_queue have finished (e.g., kernel executions, memory object updates, etc.), the command-queue is deleted.
clReleaseCommandQueue performs an implicit flush to issue any previously queued OpenCL commands in command_queue."
Yes, that explains it. See here opencl - clReleaseCommandQueue hangs when queue contains unexecuted kernels that are waiting on comp... for
further discussion. It turns out that calling clSetUserEventStatus() with negative value causes waiting kernel to abort without executing.