> Am 25.11.2015 um 17:19 schrieb Henry Gomersall <[email protected]>: > > In my software I have computation being done with pyOpenCL and the > rendering being done with pyOpenGL and GLSL. > > The OpenGL context is created independently of the OpenCL context and > exists in a different thread. I'm currently making no attempt to share > data between OpenGL and OpenCL - all the data passes via the CPU. > > The OpenCL code is run very much more often than the OpenGL rendering > code (say 500 times per second versus 50 times per second for rendering). > > I'm finding that I'm getting substantial artifacts in the OpenGL > rendering. Specifically, I get a heavy flickering of the rendering - it > looks like e.g. certain line segments are not being drawn (it's a simple > line drawing program) for some frame. > > Am I missing something about using OpenCL and OpenGL from multiple > threads? Do I need to explicitly sync the objects in some way? > > Curiously, it doesn't break _every_ run. About 1 run in 10 works > perfectly, with no visual problems at all. I wonder if there is some > race condition causing a (setup?) problem.
Dear Henry, I have an application with a similar specs as you described, with PyQt4, pyOpenGL and pyopencl, but without issues. Even sucessfully tried sharing between OpenCL and OpenGL. One thing I learned about Qt, do all the OpenGL rendering in the main thread, and then ideally do everything within the paintGL() method of QGLWidgdet, or call makeCurrent (method of QGLWidget) to switch the OpenGL context. Having another threads keeping the GPU busy with OpenCL did not interfere with rendering. Gregor > > Thanks, > > Henry > > _______________________________________________ > PyOpenCL mailing list > [email protected] > http://lists.tiker.net/listinfo/pyopencl _______________________________________________ PyOpenCL mailing list [email protected] http://lists.tiker.net/listinfo/pyopencl
