# How to maximize shader compiling threads?

**URL:** <https://forums.unrealengine.com/t/how-to-maximize-shader-compiling-threads/614820>\
**Category:** Feedback & Requests\
**Tags:** unreal-engine, UE5-0, question\
**Created:** [July 26, 2022, 4:33pm UTC](https://forums.unrealengine.com/t/how-to-maximize-shader-compiling-threads/614820 "2022-07-26T16:33:41Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![JL\_GD](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@JL\_GD](https://forums.unrealengine.com/u/JL_GD)\
**Post date:** [July 26, 2022, 4:33pm UTC](https://forums.unrealengine.com/t/how-to-maximize-shader-compiling-threads/614820/1 "2022-07-26T16:33:41Z")

</div>

I am converting a small project to UE 5 and it has taken forever to compile all the shaders first opening the editor and then opening my level. I have a Threadripper with 32 cores and most of them are idle all the time, I can see the system spawning at most 3 treads for shader compilation. How should I configure my settings to optimize for my machine?

I have seen some suggestions online about changing the config values on the DevOptions.Shaders section, but I have tried different values and I haven’t found a good way to do it, and also I haven’t been able to find documentation about it…

```auto
[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=50
; 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=-1

; These values are for build machines only currently to reduce the number of SCWs spawned to reduce memory pressure
bUseVirtualCores = False
; CookerMemoryUsedInGB = 49
; MemoryToLeaveForTheOSInGB = 3
; MemoryUsedPerSCWProcessInGB = 0.4
; MinSCWsToSpawnBeforeWarning = 8

; Use SCW memory pressure calculations regardless of whether cooking is done on a build machine
; Note: CookerMemoryUsedInGB, MemoryToLeaveForTheOSInGB, MemoryUsedPerSCWProcessInGB must all be set to enable
bForceUseSCWMemoryPressureLimits = False

```

What can I do to accelerate this process (And make a more optimal use of the resources on my workstation?)

Thanks

---

<div class="post-metadata">

**Author:** ![alberto](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/alberto/32/1194695_2.png) [@alberto](https://forums.unrealengine.com/u/alberto)\
**Post date:** [July 26, 2022, 6:13pm UTC](https://forums.unrealengine.com/t/how-to-maximize-shader-compiling-threads/614820/2 "2022-07-26T18:13:16Z")

</div>

Well try…

NumUnusedShaderCompilingThreads=1  
PercentageUnusedShaderCompilingThreads=90  
WorkerProcessPriority=1

---

<div class="post-metadata">

**Author:** ![JL\_GD](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@JL\_GD](https://forums.unrealengine.com/u/JL_GD)\
**Post date:** [July 26, 2022, 9:31pm UTC](https://forums.unrealengine.com/t/how-to-maximize-shader-compiling-threads/614820/3 "2022-07-26T21:31:41Z")

</div>

Thanks for your answer Alberto  
When you do that, do you see lots of processes compiling shaders in the task manager? I have tried and I still see only 3.  
Also looking at the comments on this parameter:

```auto
; 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

```

it seems to indicate that the higher the number the less threads will be used, but I have also tried lowering it to 20 and I see the same results

Am I missing other settings to activate all of this?

Thanks

---

<div class="post-metadata">

**Author:** ![alberto](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/alberto/32/1194695_2.png) [@alberto](https://forums.unrealengine.com/u/alberto)\
**Post date:** [July 27, 2022, 1:07am UTC](https://forums.unrealengine.com/t/how-to-maximize-shader-compiling-threads/614820/4 "2022-07-27T01:07:14Z")

</div>

> [@JL\_GD](#):
>
> `100 means use none of your cores to compile shaders (it will still use 1 core).`

True, try:  
PercentageUnusedShaderCompilingThreads=10

---

<div class="post-metadata">

**Author:** ![sg7](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@sg7](https://forums.unrealengine.com/u/sg7)\
**Post date:** [November 4, 2022, 4:09am UTC](https://forums.unrealengine.com/t/how-to-maximize-shader-compiling-threads/614820/5 "2022-11-04T04:09:31Z")

</div>

I had a same issue.  
only 3 shadercompiling workers and  
only 1 worker works.

I found my solution and for now all cpu cores are working.  
I changed following values.

NumUnusedShaderCompilingThreads=1  
NumUnusedShaderCompilingThreads=2  
PercentageUnusedShaderCompilingThreads=10  
WorkerProcessPriority=0  
bUseVirtualCores = Ture  
and I killed all incredibuild processes.

I think incredibuild is the reason…

my env:  
cpu: ryzen 3600  
mem: 32gb  
gpu: rtx2070

---

<div class="post-metadata">

**Author:** ![DeisukeAramaki](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/deisukearamaki/32/595844_2.png) [@DeisukeAramaki](https://forums.unrealengine.com/u/DeisukeAramaki)\
**Post date:** [November 10, 2022, 2:43pm UTC](https://forums.unrealengine.com/t/how-to-maximize-shader-compiling-threads/614820/6 "2022-11-10T14:43:05Z")

</div>

I have the same situation + Threadripper Pro 16 core and onlz 4 cores are used for compilation.

Where is the config file located to change those values?

---

<div class="post-metadata">

**Author:** ![DeisukeAramaki](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/deisukearamaki/32/595844_2.png) [@DeisukeAramaki](https://forums.unrealengine.com/u/DeisukeAramaki)\
**Post date:** [November 10, 2022, 2:47pm UTC](https://forums.unrealengine.com/t/how-to-maximize-shader-compiling-threads/614820/7 "2022-11-10T14:47:16Z")

</div>

I think I found the solution - it was the INCREDIBUILD addon to Visual Studio.  
I removed it from Visual Studio extensions (complete uninstall) and now all 16 cores and 32 threads are used for compilation.  
Hope that helps somebody someday…

---

<div class="post-metadata">

**Author:** ![pedroamarocosta](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@pedroamarocosta](https://forums.unrealengine.com/u/pedroamarocosta)\
**Post date:** [November 14, 2022, 5:21pm UTC](https://forums.unrealengine.com/t/how-to-maximize-shader-compiling-threads/614820/8 "2022-11-14T17:21:17Z")

</div>

I found a different alternative. On opening old (just few months older actually) projects, I had the load up screen virtually stuck for hours at compiling shaders. Then I created a new project and compared all file contents between the two. Turns out the older project has these two lines in its _ **Unreal Projects\MyProject\Config\DefaultEngine.ini** _:

> r.SkinCache.CompileShaders=True  
> r.RayTracing=True

These lines are not automatically defined anymore for newer projects. Remove them (or just put them both to ‘False’). It should not get blocked again at compiling shaders now.

---

<div class="post-metadata">

**Author:** ![Buff\_Plankchest](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Buff\_Plankchest](https://forums.unrealengine.com/u/Buff_Plankchest)\
**Post date:** [November 19, 2022, 9:00pm UTC](https://forums.unrealengine.com/t/how-to-maximize-shader-compiling-threads/614820/9 "2022-11-19T21:00:50Z")

</div>

Thank you so much! I have been trying to wrap my head around what happened. Must have checked that by mistake during a recent re-install of Visual Studio. I have had issues when Incredibuild has been installed in the past with other development tools.
