Really slow shader compiling on linux

I’ve switched to linux recently and noticed that shaders compile much more slower than on windows. I have pentium2020m, nvidia gt 740m and 4 gb of RAM. Not the best hardware to run ue4, but it’s comfortable enough for me. I’m also using proprietary driver for the graphics. The problem is that when I opened the project browser it showed me a large amount of shaders to compile, which, I assume, the result of switching from directx to opengl. I wouldn’t mind that if compiling time was normal, but now, it proceeds with speed of 10 shaders per 5 minutes, and there is almost 5000 of shaders to compile. The priority of the compiling process seems to be really low, as it uses only 18-20% of one core and also doesnt affect perfomance in any way (so I assume it doesnt compiling at full possible speed), and also the editor completely stucks when I’m trying to save any material during the shader compilation process.

What do you exactly mean by you switched to linux?

Installed linux on my machine, and also installed unreal engine 4 (linux sources from the github).

The problem might be that the compiler is less specialized than that one used in windows and mac, since UE4 on Linux is in the Beta and Epic Games put a huge warning sign on the front page.
Furthermore Linux in general does use processing power less efficient than windows or mac. A CPU will always have a higher load on Linux than on Windows (nobody notices that with a fast computer, but the difference is there).

STOP! Linux UE4 Editor is NOT production ready yet. If your plan is to develop and publish games with it, try using Windows version instead. Otherwise, proceed with this notice in mind.

What you could try is: There is a file that controls the compiler, named BaseEngine.ini, inside is a block called “[DevOptions.Shaders]” set “NumUnusedShaderCompilingThreads” to 0.
I am not sure if this will help, or if this is even possible on Linux, but it’s worth a try.
Setting “bAllowCompilingThroughWorkers” to false supposedly speeds up the compilation as well, but I never tried this. I once read this activates the compiler used in UDK.

The default setting was 3 cores, but I have only 2 cores in my CPU, lol. Changing it to 0 didn’t make any difference though, the process still use 20% of one core. I also noticed that shader compiling starting always from the same value, I think they don’t save after closing the editor.

Threads unequal Cores :wink: Hm, it was just a try, because I already figured that that isn’t the problem. I recommand you switch back to windows … and set this thread as a bug report.

I think Linux category is good, also i don’t think it’ threading issues, it’s probably compiler on Linux is simply low

I am not sure, since a member of the staff would have answered by now in a bug report thread (but I guess Linux is ok). Anyway, since the compiler only uses one core and barely that one, “slow” is a bit too gernal to describe the problem.

There’s nothing wrong with the ShaderCompileWorker in Linux. It is an external program that gets spawned on-demand by the Editor. The number of workers spawned depends on how many Cores and CPUs the system has.

Therefore, if you have a dual core CPU you can’t really expect much - you are below the system requirements for UE4 anyway: Frequently Asked Questions - Unreal Engine

Upon first start, the Editor has to compile about 3,000 shaders for OpenGL3 and that takes a bit of time, depending on a system configuration.

If this process takes a very very long time it is possible that the Editor has reverted to a fallback built-in compiler. (which is also caused by setting bAllowCompilingThroughWorkers to False). SCWs should always be allowed to run as they are multi-threaded external programs that do their work behind the scenes.

Check with (h)top if the SCW process(es) are running to ensure that these workers are starting and doing their job.

I saw that epicgames presented ue4 for linux as “done” and “ready for early access” so I got my hands on linux version again. Engine launching and shader compiling became somewhat faster, though still considerably slower than windows version. But now i’m experiencing another nasty bug - shaders dont save after closing the ue4. When I opened engine for the first time it started to compile ue4 standart shaders (3307 of them). After closing the program and opening it again it started to compile shaders from the start (value was 3307 again). I tried to wait longer (in that time about 700 shaders was compiled) and then saving some basic project, but shader compilation started from same value (3307) again.
Sorry for my terrible english.

Also after checking the SCW processes I found out only 1 is working. Also disabling these workers at all (in BaseEngine.ini) doesnt affect compiling speed in any way (I believe it compiling even a bit faster now).

What are the hardware specs of your windows computer? Which ue4 branch did you use?