Issue of Shader Symbol not being output in UE5.4

(This is a translation of a [Japanese [Content removed] by Lin Chia Jui.)

Due to our development circumstances, we have fixed the engine to UE5.4.

When we see a crash related to graphics, we output AfterMath. However, Shader Symbols are not output. So it’s very difficult to investigate the crash. For Shader Symbols to be output, we have edited the configuration file based on the page below, as follows:

https://dev.epicgames.com/documentation/ja\-jp/unreal\-engine/shader\-debugging\-workflows\-unreal\-engine

Config:

[ProjectDir]\Config\[Platform]\[Platform]Engine.ini

Console variables that have been added:

[ShaderCompiler]

r.InvalidateCachedShaders=1

r.Shaders.Symbols=1

r.Shaders.GenerateSymbols=1

r.Shaders.WriteSymbols=1

r.Shaders.SymbolsInfo=1

r.Shaders.WriteSymbols.Zip=1

r.Shaders.AllowUniqueSymbols=1

r.Shaders.ExtraData=1

r.Shaders.Optimize=0

r.Shaders.KeepDebugInfo=1

r.ShaderDevelopmentMode=1

r.DumpShaderDebugInfo=1

r.CompileShadersForDevelopment=1

When packaging the project, the files are generated, as shown on the reference page, in [ProjectDir]/Saved/ShaderSymbols/[Platform]/ShaderSymbols.zip, but the ShaderSymbols.zip is 0 KB and contains no files.

Questions:

(1) Did I set correctly?

(2) Does the following fix relate to the issue?

The above fix seems to depend on features in UE5.6. If this fix resolves the issue in UE5.6, is there a way to apply the fix to UE5.4, as well?

I looked over the fix. Shader Serialization, Shader Compiler, and Material Stats have been changed since UE5.4, and the fix seems to involve dependencies on these updates. That’s why I am asking this..

Thanks.

Hi Masahiro Yamakawa

you might need this CL if you are working with Vulkan -

https://github.com/EpicGames/UnrealEngine/commit/8cd18edb7220cabb31fcda78f2584cedd6b6f8a1

If you read this reddit post the debug markers for Vulkan were disabled in UE5.4 -

https://www.reddit.com/r/unrealengine/comments/1hlsmna/unusually\_high\_gpu\_time\_50ms\_on\_low\_end\_mobile/

Hope it helps

Best Regards

Rahul Gupta

(Not an Epic Games Employee)

[mention removed]​

(This is a translation of a Japanese post by Lin Chia Jui.)

Thank you very much for your reply.

Sorry for the insufficient information. We use DirectX.

If you have any related information, could you please share it with us?

Thanks.

Hi [mention removed]​

You can optionally set the Symbol Path in the ConsoleVaribales.ini using r.Shaders.SymbolPathOverride= and try that to see if you are getting any Shader symbol information and then link that Directory to the Tool you are using. Anecdotally I also set the r.DumpShaderDebugInfo=0 to get the complete debug shader info shaders rather than those that are just failing. I don’t recall any or know of any D3D12 specific switches that might have been added to the Engine itself in the Past recent versions of the API.

Also, I don’t think you can zip them and the project needs to exist as loose files to my knowledge and not a compressed archive. and it need to be a debug/development configuration build as well. The Consolevariable.ini also has a few additional comments that might be of worth taking a further look into for the variable values as well.

Hope it helps

Best Regards

Rahul Gupta

(Not an Epic Games Employee)

(This is a translation of a Japanese post by Lin Chia Jui.)

Thank you very much for your advice. I tried changing the ini file as shown below and tested it on my local machine. However, as before, no symbols are being output. The changes are highlighted in bold.

[ShaderCompiler]

r.Shaders.Symbols=1

r.Shaders.GenerateSymbols=1

r.Shaders.WriteSymbols=1

r.Shaders.SymbolsInfo=1

r.Shaders.WriteSymbols.Zip=0

r.Shaders.AllowUniqueSymbols=1

r.Shaders.ExtraData=1

r.Shaders.Optimize=0

r.ShaderDevelopmentMode=1

r.DumpShaderDebugInfo=0

r.CompileShadersForDevelopment=1

r.Shaders.SymbolPathOverride=“[ProjectPath]\Saved\TestShaderSymbols”

I tried another approach:

I incorporated the fix, which I had mentioned in my first post, into UE 5.4.4.

(Unreal Engine Issues and Bug Tracker (UE\-252263\))

In my environment, .pdb and .dxil files were output.

(*Please note that I have not confirmed if it works properly yet.)

It seems that the above fix also enables the use of r.Shaders.WriteSymbols.Zip.

However, there seems to be a restriction when using Windows:

Setting “r.Shaders.WriteSymbols.Zip=1” in [ShaderCompiler] causes the ZipWriter to retain write permissions for the Zip at the specified path when the Editor starts. When trying to cook the project via the project launcher in the Editor, a new ZipWriter tries to write the same files, but fails due to lack of write permissions.

To handle this restriction:

Before cooking, you need to set “r.Shaders.WriteSymbols.Zip=1” in [ShaderCompiler_BuildMachine], and “r.Shaders.WriteSymbols.Zip=0” in [ShaderCompiler], and then start the Editor.

I’ll try to see if .pdb and .dxil files can be used after packaging.

Thank you.