2 openCL applications running simultaneously


I have begun to learn openCL. I have done 2 openCL applications and I’m trying to run them simultaneously (on the same device).

There are no problems with applications running separatly, but when they run at the same time the results are incorrect.

Is there any way that I could check if other openCL application is running and in that case print an error message?

Any help will be sincerely appreciated.


Any time I’ve had problems like this is was bugs in my code. Each application gets private instances and correct code will not interfere with each other.

The bugs are most likely to be related to incorrectly initialised device memory from memory. And/or race conditions.

If OTOH you wanted to ensure serialised access for other reasons such as performance or resource requirements you’d probably have to write your own IPC solution and add it to all your code.


We finally found out what happened. It was a driver bug. The second simultaneous execution had silenty failed, giving us incorrect numerical results but no any CL error.

After installing the latest NV driver, the second execution returns us CL_MEM_OBJECT_ALLOCATION_FAILURE just after the clEnqueueNDRangeKernel. which is correct because we are using big data sets (and before updating the driver we started to think that this was a memory related problem)

Now we can handle the error correctly.

P.D: 4 days lost XD