1
\$\begingroup\$

The GPU's primary purpose, obviously, is to render the scene.

However, if we use compute capabilities on the very same GPU, how do we partitition and control these calls such that they do not interfere with render throughput, i.e. manage load balancing? Is there standard practice in this regard?

\$\endgroup\$
2
  • \$\begingroup\$ I'm not an expert or professional programmer, so I can't give a detailed answer. Also it really depends on what API is used or better which features are present. Generally synchronization that would block for a potentially long time should be avoided, so that outputs of your compute operation won't be used right after invoking it. That means you can dispatch your compute shaders, then do other stuff that does not depend on them and only synchronize just before you need the output. That way even blocking synchronization might return immediately because some time has already passed. \$\endgroup\$
    – cozmic
    Commented Apr 5, 2018 at 18:17
  • \$\begingroup\$ Regarding load balance, I'm not really sure that there is something more high-level than explicitly managing your synchronization in an intelligent way. \$\endgroup\$
    – cozmic
    Commented Apr 5, 2018 at 18:23

1 Answer 1

1
\$\begingroup\$

I will have a stab at answering part of this, but like all devs. There are many aspects and considerations and its all opinion.

In short, there is no one answer. But I can give you only my tips based upon my experience and there are some wonderful GPU profiling tools out there, even VS 2017 community edition allows you to at least see how your GPU is performing under load. But I digress.

One of the main goals for your pipeline is to keep your GPU fed, now this in itself is fraught with danger. Because an occupied GPU does not necessarily mean a efficiently used GPU. To address your question on how to partition, it might not necessarily be best to try and control this tightly, submitting your jobs in a timely manner is one thing, submitting at exactly the right time every frame may be impossible.

When I mentioned before profiling, one of the most important this it will reveal is when your GPU is not being used. This should allow you to consider how to either utilise that down time or restructure your renderer to use that time.

I will be honest here, you will get varying levels of success based upon various things such as technical know how, rendering goals, complexity and load and blah blah blah (tech term for numerous other considerations). If your question is more about the best general strategy to approach, then I could go no further than recommending one of the numerous job queue type rendering architectures to get the best utilisation of what hardware you are rendering to.

Personally in all my work with GPUs, have I come across a specific practices around load balancing between rendering and compute. This also due to different compute characteristics of AMD and Nvidia (Even threading settings are different on compute and subject to huge performance differences).

All this is my experience and opinion. So you can take it with a grain of salt, no offence taken. But my final thought would be, find a technique you feel comfortable with and grow with it. Experience is your best tool. GPU architecture is continually changing, and I feel alot of stuff is going to be flipped upside down when Ray casting comes to hardware also.

\$\endgroup\$
2
  • \$\begingroup\$ Thanks Ernie, this is moderately useful although not necessarily the sort of answer hoped for. Let's see what else comes in, or I will offer the checkmark to you. \$\endgroup\$
    – Engineer
    Commented Apr 6, 2018 at 6:10
  • \$\begingroup\$ Yeah. Sorry that I can't offer more. It's definitely a trial an error at times. Good luck. \$\endgroup\$
    – ErnieDingo
    Commented Apr 6, 2018 at 10:25

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .