To whom it may concern,
I am finding myself unable to create a pyopencl context which can interface
with OpenGL. Upon running the following code:
from OpenGL import GLX
import OpenGL.GL as gl
import OpenGL
import pyopencl as cl
from pyopencl.tools import get_gl_sharing_context_properties
platform = cl.get_platforms()[0]
props=[(cl.context_properties.PLATFORM,
platform)]+get_gl_sharing_context_properties()
print (props)
ctx = cl.Context(properties=props)
I get the following:
[(4228, <pyopencl.Platform 'NVIDIA CUDA' at 0x55fecb4a14b0>), (8200,
<OpenGL.raw.GLX._types.LP_struct___GLXcontextRec object at
0x7f37dcee91e0>), (8202, <OpenGL.raw.GLX._types.LP_struct__XDisplay object
at 0x7f378907de18>)]
Traceback (most recent call last):
File "/home/myname/Desktop/myprogram/main.py", line 9, in <module>
ctx = cl.Context(properties=props)
RuntimeError: Unable to cast Python instance to C++ type (compile in debug
mode for details)
I also don't know how to compile in debug mode (apologies), so I'm
struggling to diagnose the problem. Any help or advice would be appreciated.
Thanks!