KhronosGroup / KhronosGroup/OpenCL-ICD-Loader
clCreateContext return unknown error code when create gl sharing context.
- Dominant language
- C
- Stars
- 304
- Forks
- 171
- Avg merge
- 11h 30m
- Merged PRs (30d)
- 1
Description
When I switch code from intel opencl sdk to the icd loader, the clCreateContext fails, but intel sdk works fine when calling clCreateContext with a GPU type device.
If I call clCreateContext without gl sharing properties, icd loader works fine.
Sample code as below:
```
cl_int err = CL_SUCCESS;
//get nvidia platform and gpu type device omitted.
cl_context_properties properties[] = {
CL_GL_CONTEXT_KHR, (cl_context_properties)wglGetCurrentContext(),
CL_WGL_HDC_KHR, (cl_context_properties)wglGetCurrentDC(),
CL_CONTEXT_PLATFORM, (cl_context_properties)targetPlatform,
0
};
cl::g_ctx = clCreateContext(properties, 1, &device, NULL, NULL, &err);//if call clCreateContext(NULL, 1, &device, NULL, NULL, &err); no error occur.
CL_CHECK(err);//this err code is -9999.
```
My Environment is: **windows 10**, **NVIDIA gtx1050ti** with driver version **R398.36 (r398_35-2) / 22.20.16.4735 (7-7-2017)**
Contributor guide
No contributing guide indexed for this repository
Research direction
Start with the reported clCreateContext call and its OpenGL sharing properties, then reproduce the failure on the stated Windows 10 and NVIDIA GTX 1050 Ti environment. Compare the returned -9999 error with the same call without sharing properties; done means identifying whether the ICD loader or vendor implementation is responsible and documenting a confirmed resolution.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- c
- Domain
- tooling
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100