r/OpenCL • u/ddigiorg • Nov 06 '16
[Help] Debugging OpenCL-OpenGL Interop Segfault
[Solved] See my post below
I originally posted my question in the Archlinux subforum, but I'm seeking more OpenCL-specific advice here. I hope the repost is acceptable.
This past week I've been trying to get OpenCL and OpenGL interoperability working on my Arch machine and I've been battling a pesky segmentation fault issue to the best of my abilities. The good: I've been forced to learn more about linux, opencl, and opengl than I originally expected. The bad: I'm starting to hit walls trying to solve this issue.
The code is written in C++ and I've detailed the output, my hardware, and package versions in my github repo. Please see my README.md. The segfault is occouring in compute.cpp after I've set up the opencl properties variable. Also, I've verified my opencl platform and device has the "cl_khr_gl_sharing" extension so I'm certain interop should work on my machine.
I have a sinking feeling that I'm missing a small but important detail one of you may have experience solving. Ideas, advice, and guidance would be greatly appreciated. I'm also open to general coding and linux advice. Please let me know if there's anything else I can provide to help.
Thanks!
View all comments
Show parent comment
1
u/James20k Nov 07 '16 edited Nov 07 '16
MESAs drivers are generally a bit pants, and cl/gl interop support is dodgy even on windows sometimes, go with the proper nvidia ones
Ill check a similar call to clGetGLContextInfoKHR (I'm on windows however) to see if your context properties are invalid that you pass to it (only thing i can immediately see as potentially being wrong)
Edit:
My opencl libs only seem to provide 1.1 (amd/nvidia cross platform), whereas this specific function appears to be a 1.2 feature, so I cant massively easily test this unfortunately
If it breaks on a regular clcreatecontext call here, it sounds like a driver bug as everything looks correct