[windows platform] Priodically drop frames in an empty scene

Hi,
When I ran the builded scenes on Windows, I noticed that the game would periodically drop frames.
In that frame, Gfx.WaitForGfxCommandsFromMainTread spend a lot of time(about 70ms or more). And I notice that in that frame, “calls” of Gfx.WaitForGfxCommandsFromMainTread is 2 but in other normal frame it is 1. This seems to happen every few seconds.
I wondered if there was something wrong with the setup because I was testing in an empty project without any code.
I find this problem in Unity 2019.4.33 and 2020.3.34.

7712431--966784--2021-12-05 214805.png


7712431--966790--2021-12-06 165501.png

Is there a reason you’re using Vulkan on Windows? Does this happen in the player with D3D11 or D3D12?

I’ve tried all the Graphics APIs, and I’ve gotten the same results.

Can you show the profiler result from D3D11?

7718203--968245--1.PNG
7718203--968248--2.PNG
7718203--968251--3.PNG
7718203--968254--4.PNG

The profiler suggests that Unity was waiting on the GPU to finish rendering the frame. These stalls can be pretty hard to track down (usually you’d use tools like GPUView) and most of the time it’s caused by something else running on the machine at the same time using the GPU or the driver decides to delay your frames for whatever reason.