i have an application that uses OpenGl/Cl interop. I’m creating a OpenGL VBO, mapping it to an OpenCL buffer and later try to read the buffer data to the host using clEnqueueReadBuffer.
This fails with an error code -30 (CL_INVALID_VALUE).
clEnqueueWriteBuffer works fine if i do not use gl/cl interop (i.e. the buffer was created with clCreateBuffer).
And, the same code with cl/gl interop works on AMD and Intel GPUs.
So, could this be a limitation of the Nvidia driver? If so, is there a workaround?
Hardware is Quadro K4000, driver is NVIDIA-Linux-x86_64-352.55.run, OS is CentOS 7.
Code to create/map the buffer:
glBufferData(GL_ARRAY_BUFFER, hostDataSize, hostData, GL_DYNAMIC_DRAW);
b->clBuffer = clCreateFromGLBuffer (context, CL_MEM_READ_WRITE, b->vbo, &status);