Page 1 of 1

GPGPU physics synchronization

Posted: Wed Aug 14, 2013 7:06 pm
by bitshit
Hi,

Sorry for the crosspost (http://gamedev.stackexchange.com/questi ... game-logic), but I thought this forum might be an appropiate place to ask.

With the advent of gpu accelerated physics (http://www.gdcvault.com/play/1018185/GP ... Rigid-Body) I was wondering how the synchronization between the CPU & GPU will affect the performance gains. In a game engine we'd need to synchronize game logic, A.I. etc with the results from a physics step, won't this requirement undermine the extra performance gained by simulating on the gpu? Is the current cpu-PCIe-gpu roundtrip efficient enough to synchronize a massive gpu physics sim with a 30hz gamelogic / ai loop?

I couldn't find too much info on this topic, but this "best practice" article seems to confirm some of my doubts: https://developer.nvidia.com/content/ma ... anetside-2
And this one too: http://gamedev.stackexchange.com/questi ... nd-the-gpu

Any thoughts or does anyone have some examples showcasing pure gpu physics in an interactive environment like a game?

Cheers,

Martijn

Re: GPGPU physics synchronization

Posted: Thu Aug 22, 2013 12:48 am
by Erwin Coumans
It depends on the GPU hardware. On Playstation 4, there are separate command queue for graphics and compute, so there is no issue. Also, the Playstation 4 has shared memory, so there is no 'sync' cost. The new upcoming Mac Pro also has two GPUs, so nice hardware

On a modern PC, the read-back of rigid body transforms and contact point information and overlap is fast enough, for up to half a million objects or so, as long as you do it only a few times per frame. If your graphics engine fully occupies the GPU, then there is not much use for GPGPU, obviously. Upcoming GPUs that are integrated int the CPU from AMD and Intel are becoming more powerful too, so they might become a target for compute.

Re: GPGPU physics synchronization

Posted: Tue Aug 27, 2013 9:17 am
by bitshit
Thanks for the info Erwin, I guess you're about the only authority on this subject right now :)

So currently we're in the situation where it's more or less becomming feasible, depending on the cpu/gpu architecture you're running on. So if you'd have a massive physics simulation with a tight lockstep requirement between the physics/game logic loop (like an RTS), a HSA architecture like the PS4 features is a must?

Thanks again!

Martijn