Mixing OpenCL and OpenGL results with -48 error code

I wrote an OpenCL application which solves Poison Equation with finite difference method and it works just fine.
Know I want to add opengl displaying feature for demonstration purposes and I’m a little bit stuck because running kernel returns -48 error code, even when it’s completely empty.
So basically mistake must be somewhere else, for my convenience I used SimpleGL sample from Nvidia SDK.

Any help would be appriciated because after few hours I didn’t make any progress.


PS It uses all sort of weird libraries like oclUtiles, if you don’t want to mess with linking just put it into NVIDIASDK/OpenCL/src/oclSimpleGL folder and run make and it will be compiled into bin folder with other examples.

The error code -48 means CL_INVALID_KERNEL. Could you double-check that the kernel you are passing is correct? What line of code is returning that error?