[UE5] Compiling Shaders On Every Startup

Regarding worker count, UE5 introduced some new settings in BaseEngine.ini: ShaderCompilerCoreCountThreshold and PercentageUnusedShaderCompilingThreads. The documentation is quite self-explanatory:

; Core count threshold.  Below this amount will use NumUnusedShaderCompilingThreads.  Above this threshold will use PercentageUnusedShaderCompilingThreads when determining the number of cores to reserve.
ShaderCompilerCoreCountThreshold=12
; Percentage of your available logical cores that will be reserved and NOT used for shader compilation
; 0 means use all your cores to compile Shaders
; 100 means use none of your cores to compile shaders (it will still use 1 core).
PercentageUnusedShaderCompilingThreads=50

From what I understand from ShaderCompiler.cpp:3427, for a machine with 24 threads, this new default has the side effect of changing worker count from 21 (24 - 3 unused defined by NumUnusedShaderCompilingThreads in BaseEngine.ini) in UE4 to 12 (24 * 50%) in UE5.
You can set PercentageUnusedShaderCompilingThreads=0 but that might starve your machine, or increase ShaderCompilerCoreCountThreshold to a value > to your thread count so you keep 3 threads for editor/game tasks.
Cheers!

2 Likes