cancel
Showing results for 
Search instead for 
Did you mean: 

Archives Discussions

boxerab
Challenger

clReleaseCommandQueue at program exit never returns

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.

0 Likes
1 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."


View solution in original post

0 Likes
3 Replies
boxerab
Challenger

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.

0 Likes

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."


0 Likes

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.

0 Likes