I’m building Showdown VR demo on PS4. Everytime I took a new build it always take me half an hour to rebuild all shaders. My CPU is i7 4 cores, it seems Unreal only spawned 4 instances of Shader Compile Worker(which should be 8 for maxium efficiency). Is there a way to make Unreal spawn more compile workers? Thank you.
I would like to know this as well. I see 4 or 5 shader compiler workers on my 72 core rig. Most of unreal seems to be using up to 8 threads. My machine rarely uses more than 20% CPU with this engine regardless of what I’m working on. There must be a way to increase the cores utilized.
I found the solution.
In:
Engine\Config\BaseEngine.ini
Search for “NumUnusedShaderCompilingThreads=3”
and modify the integer.
I set it to 36. This is the number of physical cores. For some reason ATM if I set it higher it will default back to 3.
Glad I found this thread, I had this problem with a six core processor. The solution you found does the job. Except I set the “NumUnusedShaderCompilingThreads” to just 1, which gets me 5 compiler workers and leaving 1 core for everything else. Keeping the cpu busy at 98%.
So it seems odd that you raised the number to 36 to get more compiler workers. You may want to try disabling hyperthreading for more focus on physical cores to make it less idle.
well the name of the setting is quite explicit: NumUnusedShaderCompilingThreads
not NumUsedShaderCompilingThreads
so it is to keep some cpu threads for other stuff, so the less you set there the more cpu threads it should be using for compiling shaders
Also as for UE 5.0.2 i see that it has ShaderCompilerCoreCountThreshold=12 (Ryzen 5900 12 cores 24 threads). It uses only 12 logical theads (half from what i have). And has comment
; 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).
I think lowering this number from 12 (for me) to 1 or 2 may do the job.
I actually thought this too, but I noticed the “comments” in the BaseEngine.ini file are actually written ABOVE the entry they are referring to, so the following comments (and their corresponding default values) should be read as such:
; Make sure we don’t starve loading threads NumUnusedShaderCompilingThreads=3
; Make sure the game has enough cores available to maintain reasonable performance NumUnusedShaderCompilingThreadsDuringGame=4
; 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
; Batching multiple jobs to reduce file overhead, but not so many that latency of blocking compiles is hurt MaxShaderJobBatchSize=10
; Set process priority for ShaderCompileWorker (0 is normal) WorkerProcessPriority=-1
(Warning: Raising the WorkerProcessPriority from its default of below normal (-1) may cause your system to freeze if you have too many threads dedicated to shader compilation!)