The Khronos Group - a non-profit industry consortium to develop, publish and promote open standard, royalty-free media authoring and acceleration standards for desktop and handheld devices, combined with conformance qualification programs for platform and device interoperability.

If this is your first visit, be sure to
check out the FAQ by clicking the
link above. You may have to register
before you can post: click the register link above to proceed. To start viewing messages,
select the forum that you want to visit from the selection below.

Re: clEnqueueNDRangeKernel : Error -38

Are you sure that it's your clEnqueueNDRangeKernel call that's returning that error code? I'm guessing you're also calling clSetKernelArg and some form of clEnqueue[Read/Write][Buffer/Image] - is it possible that any of these calls are the issue? It would be helpful if you could post your code or at least a snippet so we can see what else might be going on.

I glanced at the 1.2 spec, and here are all (I believe...) the calls that can return CL_INVALID_MEM_OBJECT:

Re: clEnqueueNDRangeKernel : Error -38

Unfortunately, I won't be allowed to post any code. I know it's not helping..

Each time I'm calling clEnqueueNDRangeKernel, I'm testing its return value and throwing an exception if something went wrong.
Except if the debugger is playing with me, I'm pretty sure the -38 comes from there...

I've been checking my kernel arguments for a while, and I found out that, for one of the buffers I pass on to the kernel, if I'm calling clSetKernelArg inside my rendering loop instead of before, I don't have anymore troubles...
So, I Believe my memory must be corrupt somewhere and that's why I'm getting this strange behavior. ^^

Re: clEnqueueNDRangeKernel : Error -38

Unfortunately, I won't be allowed to post any code. I know it's not helping..

Hm, yeah it's going to be hard to figure out what's going on - maybe you can pare down your code to a smallest-possible version that has the issue but is dissimilar enough from your original code to post? Even general info would be helpful.

Each time I'm calling clEnqueueNDRangeKernel, I'm testing its return value and throwing an exception if something went wrong.
Except if the debugger is playing with me, I'm pretty sure the -38 comes from there...

You've probably already done this, but try differentiating the clEnqueueNDRangeKernel's exception handling (either by making it the only one that prints an error code or by tacking on something else to print along with the error code). If clEnqueueNDRangeKernel's truly is returning that error code, then there's a much deeper, weirder issue here.

I've been checking my kernel arguments for a while, and I found out that, for one of the buffers I pass on to the kernel, if I'm calling clSetKernelArg inside my rendering loop instead of before, I don't have anymore troubles...
So, I Believe my memory must be corrupt somewhere and that's why I'm getting this strange behavior. ^^

You should only have to set a kernel's arguments once. In your kernel, are you modifying your inputs? or do you have separate input and output arguments?

Re: clEnqueueNDRangeKernel : Error -38

You should only have to set a kernel's arguments once. In your kernel, are you modifying your inputs? or do you have separate input and output arguments?

I tried to move the call to clSetKernelArg into the rendering loop only for debugging purposes ^^, because clEnqueueNDRangeKernel is called in there. The inputs and outputs are not mixed, I only have one output and a few inputs (37... ).
The inputs that aren't modified are set once ^^. Except when the data changes, it is unloaded from the GPU then reloaded with the new values before I set the arguments again.

My calls to clEnqueueNDRangeKernel are encapsulated, so they all have the same scheme. Basically :

Re: clEnqueueNDRangeKernel : Error -38

That really is strange... I can't think of anything, honestly. I suggest you start paring down your program until you get something small that replicates the issue (maybe use a dummy kernel with only 1 input?). If you can get something like that going and post it, then maybe I (or somebody else) could help debug further.