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.

clCreateFromGLTexture undef ref and kernel args

I have started to work with openCL and I have come across some weird stuff.

First of all, I am working on windows 7, 64bit, with netbeans 7.2, mingw, and the latest NVIDIA drivers for the GeForce GTX 680.

While developing with the most recent openCL in this driver (I am guessing openCL 1.2) I get an undefined reference to clCreateFromGLTexture().

So I decided to go back to 1.1 and work with clCreateFromGLTexture2D. Here I had no problem managing one texture on my openCL kernel. Now, I am trying to share 2 textures of the same size by passing the arguments as:
__kernel void mip( __read_only image2d_t front, __read_only image2d_t back, __write_only image2d_t final )

But I get an error -30 (CL_INVALID_VALUE) in clBuildProgram(program, 1, &device, NULL, NULL, NULL);

I thank you in advance for any help and, if this is a re-post, I apologize as I couldn't find anything here about this.

Re: clCreateFromGLTexture undef ref and kernel args

That's really strange. len should be the size of the build log. When I get errors the build log is a bit larger than the original kernel because it is interspersed with annotations from the NVIDIA compiler. Maybe it's some help, but CL_INVALID_VALUE is only possible in these cases:

1) if device_list is NULL and num_devices is greater than zero, or if device_list is not NULL and num_devices is zero.
2) if pfn_notify is NULL but user_data is not NULL.

However, from your example, I don't think the second case applies here.

Maybe, you can provide a minimal example that compiles and shows the problem?

edit: btw, I have seen in some other forums that sometimes NVIDIA doesnt send the log to the buffer, or sends it as empty.
Also, I still have no idea why the clCreateFromGLTexture() function is not recognized on the linking phase.

Re: clCreateFromGLTexture undef ref and kernel args

The setup looks fine, so I think this must be a driver and or OS issue. Also, I always receive the build log on Linux with GPUs ranging from 295 to 680 and some Teslas. Answering your last question: NVIDIA does not yet support OpenCL 1.2.

EDIT: Are you flushing all OpenGL commands via glFinish() as described in the notes to clEnqueueAcquireGLObjects?

Re: clCreateFromGLTexture undef ref and kernel args

I think you shouldn't prefer that. Texture and Buffer Memory are handeled different on gpu's so your first option would just hand over a memory pointer to texture memory while your second option would copy the whole data vom texture memory to buffer memory. Or in worst case even TexMem->HostMem->BuffMem.