CL_DEVICE_NOT_AVAILABLE after 12 calls clCreateContextFromType fails

Heyho,

i got a OpenCL app running on a GTS250 (G92b) but i am only able to call it 12 times in a loop with the same parameters, then clCreateContextFromType fails with CL_DEVICE_NOT_AVAILABLE.

Is there a knwon limitation which could cause this or did i forget to release/free something?

Best Regards,
Srdja

Heyho,

i got a OpenCL app running on a GTS250 (G92b) but i am only able to call it 12 times in a loop with the same parameters, then clCreateContextFromType fails with CL_DEVICE_NOT_AVAILABLE.

Is there a knwon limitation which could cause this or did i forget to release/free something?

Best Regards,
Srdja

If you are using C (and not C++) bindings, you have to explicitly release OpenCL resources. If not, you would, in your case, end up with 12 contexts and creating a 13th one fails - which is not too much surprise for me.

If you are using C (and not C++) bindings, you have to explicitly release OpenCL resources. If not, you would, in your case, end up with 12 contexts and creating a 13th one fails - which is not too much surprise for me.

I do release the context manually…but i modified the code now so i create only one context for the hole program and reuse it…works fine now, thanks.

Srdja

I do release the context manually…but i modified the code now so i create only one context for the hole program and reuse it…works fine now, thanks.

Srdja

It could be that there are other resources dependent on the old context that you forget to release, which causes the old context to remain even after the release of the context.