When I try to create OpenCL context across multiple GPUs with OpenGL interop, it immediately fails. All these MGPU examples in SDKs don’t use OpenGL sharing and start crashing as well as soon as I add OGL inteop into them.
The problem appeared with the new GPU Computing SDK 4.0RC (previous versions of SDK don’t support new GPUs).
clCreateContext reports ‘invalid operation’ if I try to create a context for 4 GPUs with OGL interop (however it succeeds if I either remove OGL interop or create this context for any single GPU). According to documentation this error means that:
some of GPUs doesn’t support OGL sharing
driver implementation does not support sharing
However ogl sharing extension is reported for all GPUs and moreover I can successfully create a shared OGL context for each single GPU (even if this GPU is not the primary one).
Also when I use this code:
typedef CL_API_ENTRY cl_int (CL_API_CALL *P1)(const cl_context_properties *properties, cl_gl_context_info param_name, size_t param_value_size, void *param_value, size_t *param_value_size_ret); CL_API_ENTRY cl_int (CL_API_CALL *myclGetGLContextInfoKHR)(const cl_context_properties *properties, cl_gl_context_info param_name, size_t param_value_size, void *param_value, size_t *param_value_size_ret)=NULL; myclGetGLContextInfoKHR=(P1)clGetExtensionFunctionAddress("clGetGLContextInfoKHR"); cl_device_id cdDeviceID; size_t size; ciErrNum = myclGetGLContextInfoKHR(props, CL_DEVICES_FOR_GL_CONTEXT_KHR, sizeof(cdDeviceID), cdDeviceID, &size); oclCheckError(ciErrNum, CL_SUCCESS);
it reports that the number of such GPUs is 0. Does anyone have any success of using multiple GPUs with OGL sharing with GPU Computing SDK 4.0RC and dev drivers 270.32?