OpenCL kernel crashes with -5 Error
I am developing OpenCL program using MultiGPU.
I have to launch very large number of threads. At a time i am launching only few threads for a kernel, based on number of resources(registers usage and local memory usage ) used to best utilize GPU resources. So i am launching my kernel total n times(n = N/M), where N is total number of threads that i have to launch, M is number of threads that i can be launched at a time and n is number of times needed to launch the kernel.
Launching of kernel for few iterations goes successfully but it fails for more iterations. Kernel crashes with -5 Error when i am launching my kernel for more iterations.
I am getting "CL_OUT_OF_RESOURCES" Error while while calling clEnqueueReadBuffer() function. It means that i am accessing GPU memory out of limit, but the same code is working fine for few iterations.
I am using Nvidia GPU device :: GeForce GTX 295
Platform Version :: OpenCL 1.1
Operating System :: Ubuntu 11.04
My Questions are ::
What could be reasons the for error messages and crashes?
What are the causes of getting "CL_OUT_OF_RESOURCES" Error?
Waiting for your quick reply.
Thanks in advance.