Is this a performance bug?

In the screenshot below I’m compiling a shader. It seems like the Unreal editor is using a lot of CPU that I’d like to devote to the Shader compiler processes. Is this a bug? I’m finding shader compiling to be inexorably slow and I’m always waiting 10-15 minutes for simple shaders to compile.

Hey Antidamage -

I have a few questions for you as we begin to try to solve this issue for you:

Can you let us know what version of the engine you are using?

What other window did you have open along with the level viewport, was it the material editor?

What else was running when you were trying to compile shaders?

Thank You

Eric Ketchum

Version 4.3 of the engine.

I closed everything except UE in the end and still had the same problem, including things like Dropbox.

The material editor was probably open.

I think what I was expecting was that the child processes would use up to a single core each - instead they seem to be sharing a core.

The Shader Compiler should be a new thread and on a single core of the chip if the CPU has told the engine that the core is available. Why there are three Shader Compiler’s showing I am not certain? I am looping in one of my colleagues who has Windows 8.1 installed to see if this is typically behavior when compiling shaders. In the meantime, could you post your DXDIAG.txt?

Thank You

Eric Ketchum

I presume it’s showing three because different branches of the node graph are running in parallel. Is there any reason why they don’t run harder? I spend a lot of time sitting waiting on shaders to compile, so anything that could speed it up would be hugely welcome. :slight_smile:

Here’s my dxdiag file:

Hey Antidamage -

As a test can you bring up the task manager and watch the CPU usage percentage for the UE4 Editor as you do the following (try to use the same project you are using above):

1 - Have the Editor Maximized but not selected.
2 - Have the Editor Maximized and selected.
3 - Have the Editor Minimized completely but open.

Thank You

Eric Ketchum

Shader compiling is async so it happens without blocking the editor, which means the editor continues to render / update taking up CPU time. One thing you can do to speed up shader compiling is to set
NumUnusedShaderCompilingThreads=0
in Engine/Config/BaseEngine.ini. The default is 3 which leaves cores available for the main editor without hitching too much.

I’ll give it a go! Thanks!

  1. ~45%
  2. ~45%
  3. ~25%

I’ll try the suggestion by above as well tonight, as that sounds like it’s restricting the shaders to share a core with the engine. I only have four cores total, so reserving three for other things is probably what’s bottlenecking it.

So I followed the two main points of advice in this thread, yours and the one from Eric about minimising the UE window during compilation.

I’m able to get two shader processes with around 14% cpu each and a third one that bounces around 9%. UE idles at around 25%. I checked and all the cores are being fully utilised. The kernel and other really minor tasks are accounting for the remaining CPU, although they obviously add up to almost half the CPU usage.

It’s not a major improvement but it feels like things are compiling faster now, so I’ll see how that goes. Thanks :slight_smile: Is there a recommended hardware spec you guys like to use? Something with more cores, etc? Is there every going to be a plan to use the swarm to spread compiler load? That would make my day.