Hi Jonny, Jonathan Hunt <[email protected]> writes: > If I run the code below (using pyopencl after fork) I get an > LogicError: clGetContextInfo failed: invalid context. I guess what is > happening is that the CL library needs to be initialized again in a > new process. > > I have tried various combinations of reload(cl) reload(cl._cl) and > calling cl.__init__ etc to no avail. > > The reason I want to this is that I'm using pytest with --boxed option > (every test is run in a seperate process) (my tests don't call > os.fork() explicitly - that's just to recreate the error without > pytest). > > Any tips on how to workaround this appreciated. This is OS X 10.8.2 > (with Apple CL).
Uh, that's pretty dire. "import pyopencl" doesn't call a single OpenCL function. It just loads the OpenCL C library. If that alone destroys fork(), then there's little that it as a library can do. If you can, perhaps import pyopencl after you fork...? Andreas _______________________________________________ PyOpenCL mailing list [email protected] http://lists.tiker.net/listinfo/pyopencl
