[PyOpenCL] Whoa...shared contexts work now!

Ian Johnson enjalot at gmail.com
Fri Feb 25 07:27:36 PST 2011


Hey Keith,
I'm not sure exactly why it matters on Windows, but by specifying the device
you are using clCreateContext rather than clCreateContextFromType when
creating the context. When using a CPU that can share with GL it probably
matters, you can see some C API examples here:
http://sa10.idav.ucdavis.edu/docs/sa10-dg-opencl-gl-interop.pdf



On Fri, Feb 25, 2011 at 9:48 AM, Keith Brafford <keith.brafford at gmail.com>wrote:

> I also finally got the gl interop demo and Enjalot's "part2" demo working
> on my
> CPU context-only machine.  I used the newest code in the repo, but I don't
> know
> if that matters.  I ended up having to change the context acquisition code
> from
> this:
>
>    else:
>        ctx = cl.Context(properties=[
>            (cl.context_properties.PLATFORM, plats[0])]
>            + get_gl_sharing_context_properties())
>
> to this:
>
>    else:
>        ctx = cl.Context(properties=[
>            (cl.context_properties.PLATFORM, plats[0])]
>            + get_gl_sharing_context_properties(), devices =
>                                      [plats[0].get_devices()[0]])
>
> Now it works.
>
> Any idea why that matters for me?
>
> --Keith Brafford
>
>
> _______________________________________________
> PyOpenCL mailing list
> PyOpenCL at tiker.net
> http://lists.tiker.net/listinfo/pyopencl
>



-- 
Ian Johnson
http://enja.org
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.tiker.net/pipermail/pyopencl/attachments/20110225/c1a810a5/attachment-0001.html>


More information about the PyOpenCL mailing list