I’ve seen a couple of threads on this (Desync between the Render and Game Threads?) but still no comment on why it happens or how to fix it. Basically the RHIT and Game Thread run simultaneously in editor, but as soon as the game is packaged, RHIT waits for game thread completion before starting.
The result is massive performance drop (13ms frame time to 17.5ms!).
You can see RHIT does nothing until Game Thread is complete, and Game Thread also spends a ton of time (7.5ms!!!) idling with WaitForTask while RHIT runs. So once packaged, RHIT and Game Thread run sequentially instead of simultaneously. And again, this performance issue does not appear in editor but only shows up in packaged shipping build.
Hi, what is the GPU time? Cause if the GPU time is longer than game thread and rhit in shipping build (e.g. maybe you render at higher resolution there?) then those threads will be bound by the GPU time and both have waits in them. Also do you have something like Nvidia reflex enabled? Cause that will stall all threads and simply show up as wait in unreal insight (showed up meaningfully in unreal frontend though, or maybe I just missed something in unreal insights back then )
It is not GPU bound. Actually GPU time is lower than game thread. NVIDIA Reflex is disabled, and same with other NVIDIA settings that could apply here as I’ve seen other say similarly to you that these can be a cause.
Although I suspect you are right and there is some driver issue at play as it seems to happen only on some hardware and not others.
Same issue is again reported here by others also:
They find the same, that is shows up on NVDA but not AMD GPUs.
@skfabby Just to note, this is confirmed on 5.4.4 as well. It seems pretty inconsistent. I’ve converted the same project from 5.3.2 to 5.4.4 three times now, and the threading issue appears in 2/3 occurrences. Game thread is running sequentially with RHIT instead of in parallel, causing ~35% performance loss for no good reason.
You can see a pretty insane (25.8ms!) frame time here. 8ms is spent waiting for RHI. This is the same test scene that was running at 17.5ms in the screenshots above.
This is a new CPU thread process that I haven’t seen consuming time on 5.3.2 which appeared in 5.4. Basically 2.8ms of CPU time (that’s a lot!!!) is being spent on landscape grassmap “getActionalableUpdate.”
Secondly:
Slate in 5.3.2 consumed a lot of CPU time on the Game Thread, I believe to run the editor windows. When run in full-screen, this goes away because Slate is not being drawn. HOWEVER, in 5.4.4, this is very unreliable and quite often Slate continues to eat up 2-3ms of CPU time even when the game is played in fullscreen PIE or Standalone.
This can give the impression of poor game performance but is caused by the editor spending a lot of CPU cycles on slate unnecessarily. It’s not clear what causes this. in 5.4.4 sometimes it happens, sometimes it doesn’t. It happens more frequently than it doesn’t, though, and the result is a much worse FPS/longer Frame time.