Hi,

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).

Thanks,
Jonny


import pytest
import logging
import os
import imp
import sys

import pyopencl as cl

#cl = pytest.importorskip("pyopencl")



def test_create_some_context():
    ctx = cl.create_some_context(interactive = False)
    if os.fork() == 0:
        ctx = cl.create_some_context(interactive = False)
        print('Ctx created was %s' % str(ctx))

test_create_some_context()

_______________________________________________
PyOpenCL mailing list
[email protected]
http://lists.tiker.net/listinfo/pyopencl

Reply via email to