TL;DR / Just follow this post:
I found this link on the UnrealEngine forums Shader compilation is slow and do not use available ressources made a massive difference for my 2019 Intel MacBook.
For my 2023 M3 Pro Max MacBook this setting in a post titled Shader compilation is slow and do not use available ressources was helpful.
- Search your Mac with Spotlight for
PercentageUnusedShaderCompilingThreads
- for me its in a file at /Users/Shared/Epic Games/UE_5.3/Engine/Config/BaseEngine.ini
. I’ve edited mine to look like this:
[DevOptions.Shaders]
; See FShaderCompilingManager for documentation on what these do
bAllowCompilingThroughWorkers=True
bAllowAsynchronousShaderCompiling=True
; 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=10
; Batching multiple jobs to reduce file overhead, but not so many that latency of blocking compiles is hurt
MaxShaderJobBatchSize=10
bPromptToRetryFailedShaderCompiles=False
bLogJobCompletionTimes=False
; Only using 10ms of game thread time per frame to process async shader maps
ProcessGameThreadTargetTime=.01
; For regular machines, wait this many seconds before exiting an unused worker (float value)
WorkerTimeToLive=20
; For build machines, wait this many seconds before exiting an unused worker (float value)
BuildWorkerTimeToLive=1200
; Set process priority for ShaderCompileWorker (0 is normal)
WorkerProcessPriority=0
Note the weird interaction / logic with the ShaderCompilerCoreCountThreshold
. Its like it uses that value to decide if your machine is a high or low spec machine.
- Low spec machine - uses
NumUnusedShaderCompilingThreads
- High spec machine - uses
PercentageUnusedShaderCompilingThreads
If you have a high spec machine with numberOfCores
CPU cores, then it uses some percentage that you set of those cores. Eg my M3 Mac Pro Max has 16 CPU cores which is greater than the 12, so it will use PercentageUnusedShaderCompilingThreads
which I have changed from the 50
originally set to 10
so my actual shader thread count would be:
threadsToCreate = numberOfCores * (100 - PercentageUnusedShaderCompilingThreads)
If you have a low spec machine then it ignores the percentage and uses:
threadsToCreate = numberOfCores - NumUnusedShaderCompilingThreads