Page 1 of 1

sharing memory between OpenGL and OpenMM

Posted: Wed Mar 03, 2010 7:06 pm
by gouthambs
Hey All,

How does openMM share memory with other libraries (such as OpenGL) that run on GPU? Lets say if OpenMM is in the backend of other GUI tools (the way Zephyr works), then should the trajectories (from OpenMM) be cleared to load for display. Is there a way to share memory between OpenGL and OpenMM on the GPU?

Thanks
Goutham

RE: sharing memory between OpenGL and OpenMM

Posted: Thu Mar 04, 2010 12:10 pm
by peastman
Hi Goutham,

All programs compete for the same video memory. If there isn't enough available, OpenMM will fail when you try to start the simulation.

Peter

RE: sharing memory between OpenGL and OpenMM

Posted: Fri Mar 05, 2010 11:56 am
by gouthambs
Hey Peter,
Thanks! Do you know how Zephyr works? I think it is hooked to VMD, and in my test runs worked well. So does it (zephyr) share the memory, or does it copy data every time VMD has to display?

Thanks
Goutham

RE: sharing memory between OpenGL and OpenMM

Posted: Fri Mar 05, 2010 12:00 pm
by peastman
They're independent programs. Zephyr connects to VMD over a network socket and sends across each structure to display.

Peter

RE: sharing memory between OpenGL and OpenMM

Posted: Fri Mar 05, 2010 12:21 pm
by sherm
To clarify, Goutham -- Zephyr does absolutely nothing to manage GPU memory. That's not something you have to deal with explicitly.

Sherm

RE: sharing memory between OpenGL and OpenMM

Posted: Fri Mar 05, 2010 12:38 pm
by gouthambs
Thanks Peter and Sherm. Does the performance get affected by the fact that OpenMM has to wait for a bit when OpenGL is displaying the trajectories? Are there any benchmarks available on this aspect at all?

Thanks
Goutham


RE: sharing memory between OpenGL and OpenMM

Posted: Fri Mar 05, 2010 12:41 pm
by peastman
It definitely can affect the performance. The easiest way to see this is to adjust the setting in Zephyr for how often to display frames of the trajectory. You'll see that if you make this too small, the execution time will start to increase.

Peter

RE: sharing memory between OpenGL and OpenMM

Posted: Fri Mar 05, 2010 12:53 pm
by sherm
Peter, is it clear that's a result of GPU memory contention? I would think it could instead result from other overhead associated with getting data over to VMD.

Sherm

RE: sharing memory between OpenGL and OpenMM

Posted: Fri Mar 05, 2010 1:00 pm
by peastman
There are lots of factors contributing. We can't really separate them out, since we don't know all of what VMD is doing.

Peter