I’ve been tracking down a large pause (6-12 seconds depending on hardware) during shutdown. It appears it’s related to the Nvidia Overlay being active, and PSO deletion being intercepted by the overlay. When there are lots of PSOs being deleted, it takes a long time to shut down (due to the overlay interception).
I was wondering if there was a known workaround to solve this. I’d like to avoid the nuclear option of just forcing shutdown is possible. I was looking into skipping PSO deletion at shutdown on shipping, and just letting the OS clean it up, but before making an engine change like that, I wanted to see if there was already a preferred solution to solve this.
Hi there, we haven’t heard of any issues with the Nvidia Overlay at the moment. Could you provide more details on how the Nvidia Overlay intercepts the deletion of PSOs? Can you provide us with an Unreal Insights trace with PSO validation (r.PSOPrecache.Validation=2) and the context switch trace channel enabled?
Here are two traces. One is with the Nvidia overlay enabled, one is with it disabled.
I have tried a test build where I empty the LowLevelGraphicsPipelineStateCache and ComputePipelineStateCache if we are shutting down,and it does not exibit the long pause at shutdown, which leads me to believe the overlays interaction with PSOs are the culprit.
Hey, I just took a look at the traces, and as it turns out, that part of the PSO cache code isn’t very well instrumented in Insights, so it’s hard to tell what is going on. Could you take another set of traces, but this time with a sampling profiler (Superluminal or whatever you have available)?
Ok, I’ve attached a Superluminal trace. I’m not super familiar with the profiler, so please let me know if there are any configuration settings you need me to tweak.
No worries, the traces were useful already. You are right, there is an awful lot of time being spent deleting PSOs during shutdown (~6 seconds), but most of the time is spent in OS/driver calls, so we will need to investigate that a bit further. I will be out after today for Unreal Fest, but I have already reached out to the subject-matter expert on the PSO system, and he will look into this as soon as he can to provide you with an update. If you have any questions or findings in the meantime, please let us know.