EGL-OpenCL interoperability

I have created an EGL context for OpenGL rendering without an X server. I would like to create a shared OpenCL context for pre and post-processing.

I have tried creating the shared OpenCL context by specifying my EGL context and EGL display (paired with CL_GL_CONTEXT_KHR and CL_EGL_DISPLAY_KHR, respectively) in the cl_context_properties struct. I get a CL_INVALID_OPERATION error.

Is EGL-OpenCL interoperability supported? If not, will there be support in the future?

I am using Ubuntu 20.04, NVidia Driver 440.64, CUDA Toolkit 10.2, GeForce RTX 2070.


1 Like

Hello everyone.

I have a similar problem when I try to create an OpenCL context shared with an EGL context. I want to use this for post processing on headless machines. I get either a segfault or INVALID_GL_SHAREGROUP_REFERENCE_KHR depending on how I pass the egl context/egl display.

I have essentially the same questions: is this kind of interop supported, and if not, when could we expect headless opengl/opencl interop to finally arrive on linux ?

My configuration is very similar: Ubuntu 18.04, driver 440.82, cuda 10.2 and a GeForce RTX 2080Ti.