tinkerthinker wrote
Ok, I've solved the problem. I was writing a program that forked a process after having initialized the NVIDIA device in the parent process. Apparently Nvidia OpenCL doesn't like this.
I've modified my code to delay initializing the GPU until after the fork, this allows me to run multiple concurrent OpenCL forked processes for one program. I can now create the context without getting any errors. :)
Makes sense. OpenGL (and presumably OpenCL) can store context information in a thread information block that probably can't be shared between two processes :) If you init and then fork, the two duplicate processes are trying to share a single context, and maybe interfering with each other. Even sharing contexts across threads within a process can be problematic with some drivers, though it's supposed to be possible as long as the context is only active in one thread at a time.