I want to create an application that uses OpenCL to caluculate the color value of every pixel in a texture and OpenGL to display that texture. The problem is that when I try to create a context with GL sharing properties the program freezes. Using the function get_gl_sharing_context_properties() I get a list [(8200, 65538), (8203, 18446744072971422270)]. The last number in the list is too big to convert to a 64 bit int and I get an overflow error.
The code I use to create the CL context:
def cl_init():
platform = cl.get_platforms()[1]
device = platform.get_devices(cl.device_type.GPU)
from pyopencl.tools import get_gl_sharing_context_properties
print(cl.have_gl())
print(get_gl_sharing_context_properties())
print(sys.platform)
context = cl.Context(properties=[
(cl.context_properties.PLATFORM, platform)] +
get_gl_sharing_context_properties())
print("Context creation done")
queue = cl.CommandQueue(context)
The code never reaches print("Context creation done"). I use QtPy4 and the QGLWidget to create the OpenGL context and display the texture.
get_gl_sharing_context_properties()returns a valid 64bit value, but other times, it will randomly fail... - CodeSurgeon