GPGPU physics synchronization

Please don't post Bullet support questions here, use the above forums instead.
Post Reply
bitshit
Posts: 3
Joined: Thu Nov 25, 2010 11:14 am

GPGPU physics synchronization

Post 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
User avatar
Erwin Coumans
Site Admin
Posts: 4221
Joined: Sun Jun 26, 2005 6:43 pm
Location: California, USA
Contact:

Re: GPGPU physics synchronization

Post 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.
bitshit
Posts: 3
Joined: Thu Nov 25, 2010 11:14 am

Re: GPGPU physics synchronization

Post 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
Post Reply