Sign in to follow this  
iYossi

Powerful GPU - Send more do less, send less do more?

Recommended Posts

iYossi    137
What is better( performance-wise ) for a powerful GPU - send more data to the GPU and do more work on it, or do more calculations on the CPU and send the final result to the shaders?

Share this post


Link to post
Share on other sites
mhagain    13430
I'd say neither. Your first option is part-way there (the "do more work on the GPU" part) but you want to be able to do this without sending data (or at worst with having to send as little data as possible). Sending data to the GPU is a performance killer; this isn't so much on account of bandwidth (although that too is a finite resource) but more on account of pipeline stalls, synchronization and resource contention. The more you send the more likely it is that one piece of data is going to trip you up on this, but note that this also applies to your second option (which also involves bottlenecking on your slower processor - not good) as you still need to send the results to the GPU. Note also that even as little as 1 byte can be enough to incur a pipeline stall unless you're careful about what you send and how you send it - resource contention kills.

Ideally you want all data that your GPU is going to work with to be contained in static buffers which are initialized at load time and from then on never touched by the CPU. This lets your GPU operate completely isolated from your CPU and run as fast as it can without ever having to wait for the CPU or for data to be ready. Like all other idealized scenarios this isn't really obtainable in the real world, so instead you look at keeping communication between the two processors as low as possible. So your GPU stores the data in static buffers, your CPU tells it what to do with that data, but wherever possible that's the limit of communication - the CPU sends commands, not data, the GPU stores data, the GPU works on data according to the commands it's been given.

Share this post


Link to post
Share on other sites
kauna    2922
Of course, when ever somebody tells that "sending data to GPU is bad" one has to keep in mind that a you can copy every frame few megabytes worth of data to dynamic buffers for the GPU to use in rendering and maintain excellent interactive frame rates, without stalling your pipeline. As told before, it depends how you do it.

Of course, if you do more than copying (ie. recalculating some data) then you are using the resources of your weaker processing unit which may reduce the performance.

Best regards!

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this