Frame Time Swap Throttled

Started by
7 comments, last by wallacekcy 7 years, 7 months ago

Hi,

I have been having stuttering issues with DX11, I used PIX to take a look at the frames and found that there's something called Frame Time Swap Throttled / Swap Throttle causing spikes in my frame duration.

What exactly is this Swap Throttle that I am looking at? What could possibly be causing this throttling?

Thanks

Advertisement

Is VSYNC on in your app?

My guess would be that this is the time DXGI waits until the next VSYNC. I can't think of another reason why D3D would throttle the swap operation.

Hi,

I have switched off vsync with parameter 0 for my Present() call. That should be all I need to do right? I don't call WaitOn anything in my code.

I further narrowed down my events and found this WaitOnSwapChainSurface that takes about >100ms between frames.

What exactly is WaitOnSwapChainSurface? Google doesn't seem to have anything.

It seems like it has to do with CPU calling Present too many times before the GPU makes the actual draw call and swap the buffer.

I have tried using the DXGI_PRESENT_DO_NOT_WAIT flag, but it's giving me HRESULT with "GPU is busy" message when I call Present. By using this flag and avoid making further drawcall when HRESULT fails, the throttling is gone on the GPU and CPU is no longer waiting on anything. However, this is obviously not a solution because I'm just ignoring everything until my Present call succeeds, and only continue to Update/Render after that.

Still stumped on why the "Wait" takes so long considering in general my one frame generally takes like ~14ms to render. If anything, the "Draw" row in the attached picture suggests that my previous draw calls and Present have completed along the timeline, so I'm not sure what this "Wait" is for.

Any help would be appreciated.

Still stumped on why the "Wait" takes so long considering in general my one frame generally takes like ~14ms to render.
Is that on the CPU timeline or the GPU timeline?

Still stumped on why the "Wait" takes so long considering in general my one frame generally takes like ~14ms to render.
Is that on the CPU timeline or the GPU timeline?

Both.

On GPU it's WaitOnSwapChainSurface, it's the orange bar under "Draw", which is the GPU timeline.

On CPU it's BlockThread_OnSync (or something similar, I don't have the project in front of me). The BlockThread_OnSync happens slightly after WaitOnSwapChainSurface, it's the orange bar under CPU4.

What I think it's happening is the CPU is issuing Present call, and then the GPU returns the result saying it's blocked because the GPU is currently busy, and the CPU goes on halt with BlockThread_OnSync.

My question is what can I do to prevent this long halt? This halt is like >100ms and is causing stuttering issue every 600ms or so. I don't think this pause is normal.

Can you provide a GPUView trace?

If you install the WPT (Windows Performance Toolkit) as part of the Windows ADK, in the installation folder is a GPUView folder with log.cmd. From an admin command prompt, run log.cmd, run your app, then run log.cmd again (from the same prompt, otherwise it won't work properly). This will produce a Merged.etl file. It should zip pretty well.

If you can attach it or send it to me at jenatali@microsoft.com I can try to take a look and see what's going on.

Does this happen to be on an Xbone with the Remote Control window active? If so, try closing it.

Does this happen to be on an Xbone with the Remote Control window active? If so, try closing it.


This is unbelievable...and to think I spent a whole day on this......

Thanks!!!!

This topic is closed to new replies.

Advertisement