Sign in to follow this  
jakovo

GPU's Exection Units stalling and other performance issues

Recommended Posts

jakovo    476
Hi,

I took a trace from the project I'm working on and I saw that the GPU VERY under used, basically GPU's EUs are Active 50% of the time (21% VertexShader, 29% PxielShader), and it's stalled 38.2% of the time, and Idle 11.5%.

I'm taking a look into it, but I'm not sure what kind of things to look for... I asume that the GPU can be stalling because of texture loads, I also found that there are more than 70 render targets used in each frame, so I asume that there must be some overhead in that (though not sure exactly what the penalty is for, creating targets is costly?.. switching to it?)....

What other kind of things could be stalling the GPU?... and if the application is running so slow why it says that the 11.5% of the time the GPU is idle?...

I'd appreciate some light on this [img]http://public.gamedev.net//public/style_emoticons/default/smile.png[/img]

Thanks!

Share this post


Link to post
Share on other sites
ATEFred    1700
the most common reason for gpu stalling is readbacks to the CPU side. So if you are waiting for the result of a non latent occlusion query, or are trying to readback any data from gpu that frame in your app code, the cpu will stall until the gpu reaches that command and the data is copied back. This results in the gpu being starved for work until the cpu side moves forwards and starts resubmitting gpu work.

Share this post


Link to post
Share on other sites
GeniusPooh    161
hmmm

famous issue is lock.. Ms so many told us don't lock video memory

but In real life you may use too much CPU..

I think you use CPU too much how about check CPU side? if you use too much CPU , CPU can't send data fast enough to GPU...

but always tuning performance is too hard to work ..

good luck and give me more information about this

Share this post


Link to post
Share on other sites
jakovo    476
Hi [b]ATEFred[/b], [b]GeniousPooh[/b]...

weird enough, Intel's GPA Monitor is showing me that CPU load is about 30%... while GPU Busy % is around 93%, but with Exectution Units active only 50%...

so, if its not being stalled by the CPU, then something must be doing in the GPU that is stalling all EU's half of the time! :S

but I don't know how to look for that bottleneck.

Share this post


Link to post
Share on other sites
_the_phantom_    11250
I'm not familiar with GPA however there are often counters/ways of finding out what parts of the GPU active and why they are stalled at any given execution.

For example; While the GPU might be 'busy' fetching data for the shaders to use the ALU units are 'stalled' simply because the GPU can't find enough thread groups to throw at the EU to keep them active to cover the latency (be that due to lack of work load on that call or too many register resources in use meaning it can't launch extra threads) thus the EUs stall until the data is ready.

In theory a draw call level break down might give you that kind of detail... but as I said I'm not familar with GPA...

Share this post


Link to post
Share on other sites
C0lumbo    4411
On mobile/handheld graphics cards dependent texture reads can be an issue - that is where the UVs are modified in the pixel shader before they're used. It prevents the hardware from doing the texture lookup before the pixel shader is executed.

I have no idea if this is an issue on modern desktop graphic cards.

Share this post


Link to post
Share on other sites
MJP    19754
[quote name='C0lumbo' timestamp='1355932981' post='5012477']
I have no idea if this is an issue on modern desktop graphic cards.
[/quote]

Modern desktop GPU's no longer make a distinction between dependent and non-dependent texture fetches

Share this post


Link to post
Share on other sites
jakovo    476
Thanks [b]Phantom[/b],


So... are you using NVidia's Nsight?.... where would do you find these counters you're talking about on the one you are using?

Share this post


Link to post
Share on other sites
[quote name='ATEFred' timestamp='1355521250' post='5010746']the most common reason for gpu stalling is readbacks to the CPU side.[/quote]Very true. That, or other reasons of program-induced stalls (e.g. not provided buffers early enough, or with wrong usage flags, state changes, or a dozen other reasons).

Texture reads are normally not a reason for EUs going idle, except in very extreme worst-case scenarios. GPUs usually fire off ten thousands of threads even though they only have a few dozen (or maybe a few hundred) execution units. When a thread stalls on a memory access (such as a texture fetch), its place on the execution unit is immediately taken by another thread that is ready to run.

I don't know the details of Intel cards, but on nVidia and ATI, this swapping in and out of threads is something that the hardware does automatically on its own without you or the driver or anyone else knowing. Edited by samoth

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