Physics engine locks the OpenGL driver on Linux / NVidia GTX

Post Reply
fanfdesalpes
Posts: 1
Joined: Mon Dec 12, 2016 8:11 am

Physics engine locks the OpenGL driver on Linux / NVidia GTX

Post by fanfdesalpes »

Physics engine locks the OpenGL driver on Linux / NVidia GTX1080

Hello,

Our application relies on a stable *synchronized* 120Hz graphical update rate for various reasons (including "manual" stereo rendering). We are thus running the physics engine on its own thread, so that it does not slow down the graphical frame rate. The *synchronized* update means that we use a fence to know when the display refresh has actually happened:

glXSwapBuffers( ... );
glFenceSync(GL_SYNC_GPU_COMMANDS_COMPLETE, 0);
glClientWaitSync(sync, 0, 1000000000); // wait 1s max
glDeleteSync(sync);
// here, we know that the screen refresh has just been sent to the display

This works well on OS X 10.10, Radeon R9 M295X. But on a Linux NVidia GTX1080, it looks like the physics engine is blocking the OpenGL driver: when stepSimulation takes a lot of time (e.g. 50ms), the "glClientWaitSync" blocks until stepSimulation is done, even though they are running in different threads.

This is using bullet 2.83.

I'm assuming that bullet is executing things (OpenCL) on the GTX1080 and not on the Radeon R9. Is there a way to disable the use of the GPU in bullet?

Thanks,

François
Post Reply