Editor stuck compiling shaders

Hi, I’ve noticed since 5.1 that after updating (to either 5.1 or 5.1.1) the initial launch of the editor gets stuck compiling shaders at about 45% and never continuing. I’ve left it running overnight, uninstalling and reinstalling, verifying the engine through the launcher. Is there a fix for this? The last time this happened I just scrapped my project and created a new one. This time I cannot even launch the engine to create a new project. I feel like my device isn’t the issue here.

Motherboard: ASUS Crosshair VIII Hero
CPU: Ryzen 9 3900X
RAM: 2x 32gb Corsair Vengeance Pro DDR 4
Storage: Samsung 970 EVO Plus 2TB
Graphics: EVGA Geforce RTX 3090TI

Hey there @cloudstrife0707! Welcome to the community! So usually when shaders are recompiling for the first time this can take quite a bit of time even on good hardware. Usually after a bit, it tells you how many shaders are left, does it ever make it to that portion? How long have you let it sit during this?

If not, could you try and launch it with the command line argument -log? This will pull a full log window of what’s going on during the launch and you can see where it’s hanging at any given time.

Yeah I can see the count down of shaders left, and it varies. If I’m just launching the engine I get stuck around 5,412 shaders left. I ran this over night yesterday I would say from about 4pm PST to about 12 pm PST the following day with no change. I’ve done similar when launching my project which gets stuck somewhere around 6500 shaders left. I’ll try with the log and get back to you.

UE5_Log.txt (69.0 KB)
I’m attaching the log, left it to run overnight I do see a few errors. And the progress never changed from 0%

Hmmm… that’s a weird one. Usually in these situations there’s a caching error but it doesn’t seem to be tripping up on that here. That said, let’s try a couple of things.

Head over to AppData/Local/UnrealEngine/Common/DerivedDataCache and wipe the cache entirely and let it regenerate next launch.

Another error that causes this is if the shaderbuilder process that’s running breaks down. You can check that out in your task manager if it’s still running and if it has any priority or not.

Sorry for the late reply, I tried clearing the cache and that did not work. When I am in task manager it’s pretty much when it compiling shaders and gets to 45%, all the processes either just stop, like 0.1% - 0.05 activity in the CPU, and then 0% on Disk, Network, and GPU. The only one with activity is Memory, but there’s no change. They get to a certain MB of usage and just stay there.

Interesting, is your project setup for raytracing? if so let’s disable it:

For raytracing this will be located here:

[YourProjectFolder]->Config->DefaultEngine.ini

under [/Script/Engine.RendererSettings] you should find r.RayTracing=True , change that to False

Can you also try launching under DX11 or Vulkan by setting this variable? And try again with each and see if it stalls?

DefaultGraphicsRHI=DefaultGraphicsRHI_DX12
                 to
DefaultGraphicsRHI=DefaultGraphicsRHI_DX11
                 or
DefaultGraphicsRHI=DefaultGraphicsRHI_Vulkan

My project is, but this also happens just trying to open the launcher for the editor. So it stops me from even making new projects.

Hrm, this is a tough one. No usage, no access issues, no hard errors. There’s some environmental factor causing these issues, but narrowing it down between CPU and GPU is going to be hard.

Yeah, I’m wondering if I should just downgrade to 4.27 at this point, cause for me at least 5 is pretty much unusable. Is there anyway to get a support ticket going, or would I just have better luck waiting for the next update?

i’m not sure what the launcher runs at, but… you could try to clean the shader cache and edit the baseengine.ini (do make a backup ofc) to force it to compile only SM6 shaders. i had issues compiling SM5 shaders in engine too. it’s just a 3060 craptop, but have to run SM6 too. not sure what the issue is.

[/Script/WindowsTargetPlatform.WindowsTargetSettings]
+D3D12TargetedShaderFormats=PCD3D_SM6
-D3D11TargetedShaderFormats=PCD3D_SM5

you gotta remove dx11 cause it only supports SM5. should skip that compilation, whether or not those really fail to compile, which is my guess.

You could submit a bug report, but since the issue itself is likely environmental I’m not sure there’d be a response on this one. I’d recommend giving glitchered’s response a try and running it from the project’s launch. If that fails, try changing the engine’s defaults itself inside the engine’s hierarchy to launch only in DX11 and set it to SM5.

WhereverYourUnrealInstallIs\UE_5.1\Engine\Config\BaseEngine.ini