Changing the Number of PSO Compile Threads

Hello,

we have a question regarding changing the PSO precaching thread pool size. In the official documentation (https://dev.epicgames.com/documentation/en\-us/unreal\-engine/pso\-precaching\-for\-unreal\-engine\#performance) you write that “Increasing this value during loading time, and decreasing it again during gameplay can help”.

In our game we are using a PSO bundle in combination with a loading screen and Precaching at runtime for the PSOs we missed in the bundle. Therefore it makes sense to use a large threadpool during the loading screen and a smaller one after it.

When trying to implement this behavior, I noticed that changing r.pso.PrecompileThreadPoolPercentOfHardwareThreads at runtime has no effect. This seems to be obvious when looking at the code, because FPSOPrecacheThreadPool::PSOPrecompileCompileThreadPool is only initialized once and in PipelineStateCache::PreCompileComplete the pool is then explicitly re-used for pre-caching.

My question is therefore: Is re-sizing the PSOPrecompileCompileThreadPool at runtime possible or do we need to modify the engine?

Kind regards

Moritz Grunwald

Steps to Reproduce

  1. Implement a game with a PSO bundle and a loading screen to wait until the PSOs are compiled
  2. Change the value of r.pso.PrecompileThreadPoolPercentOfHardwareThreads after the loading screen has finished
  3. Check with Unreal Insights that when PSOs are precached still the default number of Threads is used and not the one set in step 2

Hello,

Unfortunately, we haven’t implemented the ability to change the thread pool size at runtime yet and we should mention that in the docs - I’ve requested the docs team update this, thanks for the reminder! It’s something we meant to implement when the doc was written but higher priority tasks came in. For now you’ll need to make a custom engine change.

Hello,

all right, thanks for the clarification.