While profiling my app using Pix, I noticed that the GPU is passing (in DX10 mode) most of its time in idle waiting for a resource not available. (and is always in row with the CPU (for example if the CPU is processing frame X, the GPU is also processing frame X) for this problem)
Some note :
1) The app is GPU limited (the CPU is basically idle (20% of CPU usage in the most heavy scene))
My questions are :
1) How do I have to interpret these results? In Pix every frame on the GPU side I see 2-3 little red bar (as far as i know means resource unavailable) and after them a medium/big gray bar (that means GPU idle). The CPU on another side has some operations, a big empty bar and then some other operations (is waiting for something?)
Another note, when the GPU is idle generally the CPU is working. (The contrary is not valid obviously)
2) What calls can make the resource become unavailable?
A MAP with DISCARD is considerated a blocking call?
A query to get the DESC of an object?
Sharing a Shader Effect is considered a contention?
What others?
My general frame is :
41 DrawPrimitives/DrawIndexedPrimitives (most object are instanced)
7/8 Locks on a vertex buffer with discard
9 change of pixel shader/vertex shader
1 setrendertarget
Thanks!
P.S. Screenshot of pix
http://img191.imageshack.us/img191/6800/42594100.jpg
If I use a single draw call (with the same gpu load (for example a particle engine with x particles or an instanced object)) instead of the full game I get a full blue bar and the GPU correctly 2-3 frame behind the CPU...
EDIT : I'm focusing more and more on the Effect Framework that probably is the reason of this problem. I share one effect between more objects to save memory and time to create them. Is this safe to assume without contention?
Resource contention happens when demand exceeds supply for a certain resource. When multiple processes require the same resource, one process reaches the resource first, and the other contenders are delayed until the first finishes using the resource.
[′mem·rē kən′ten·chən] (computer science) A situation in which two different programs, or two parts of a program, try to read items in the same block of memory at the same time.
To solve resource contention, you need to create a dashboard that collects and displays performance data curated from the various monitoring tools. This gives an indication of which resources are over-utilized and whether their over-utilization trend matches the workload trend of the tiers which access said resources.
What comes to mind with the provided information:
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With