[PyOpenCL] Invalid context for GL
galaxygen at gmail.com
Thu May 27 05:35:11 PDT 2010
On 05/27/10 05:04, Andreas Kloeckner wrote:
> On Tue, 25 May 2010 22:35:20 +0300, mt <galaxygen at gmail.com> wrote:
>> I thought that the problem might be in pyopencl's context creation,
>> which doesn't take the GL context into account. I tried to fix it by
>> adding appropriate CL_GL_CONTEXT_KHR, CL_GLX_DISPLAY_KHR and
>> CL_CONTEXT_PLATFORM props to the context, but then I got another error
>> "pyopencl.LogicError: clCreateFromGLTexture2D failed: invalid value". I
>> can run kernels just fine with my setup, but this GL stuff won't work.
>> What am I doing wrong?
> PyOpenCL refuses to use any context property it doesn't know about (with
> "invalid value"), so this is PyOpenCL's fault.
Actually I added these properties directly in wrap_cl.hpp's context
creation, since the interface didn't support them. "Invalid value"
really came from function clCreateFromGLTexture2D. Docs say some
parameter to it is wrong, but I can't see how, exactly. Any ideas?
> I've just added support for the cl_khr_gl_sharing CL extension to
> PyOpenCL. This support should include that the above properties don't cause
> errors any more.
> These here are the most visible parts of this support:
> I hope this helps you move forward. Please let me (and the list) how
> things go.
Thanks, but I can't pass the properties with this interface.
parse_context_properties parses all values as platform-types, which
can't be created in python. I'd need to somehow pass
glXGetCurrentDisplay() and glXGetCurrentContext() pointers cast to
unsigned int's as the property values.
More information about the PyOpenCL