Dolphin, the GameCube and Wii emulator - Forums

Full Version: Dumping shaders to diagnose GPU kernel driver crashes?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
Is there a way to dump a shader, preferably in textual and / or compiled form? Maybe it's not the right solution for debugging this annoying situation...? Are they related to the "objects" that can be dumped, because that might mean I can use the software renderer for the task. It might even be a texture-related issue... just the annoyed ramblings of someone who doesn't know where to start with resolving the issue... :|

This bug is related to many "ring gfx timeout"-related bug/s in the AMDGPU kernel driver, but I can't do anything to help without being able to dump the shaders somehow. This seems impossible, because I don't know how to dump the shaders without them also crashing the driver... maybe I'm overthinking this, due to not having much understanding of shaders...?

The bug occurs with both the OpenGL and Vulkan backends, with both normal Synchronous shaders and Synchronous Ubershaders.

Anyways, the issues specifically begin at the end of Chapter 18 of Fire Emblem: Path of Radiance, after the end of the second scene with Ike, the soldier, and Nasir. when the scene fades to black, and before the scene with Naesala, whatever shader/s run at that moment cause the AMDGPU kernel driver to crash. I managed to skip past this bit with the software renderer, make a state save, and then discovered that it will crash again after the new chapter movie cutscene plays, before moving to the worldmap scene. Using the same method to skip to the Base, I discovered it will again happen after exiting the base when selecting "End". Thankfully, I made a game save at the base, so I can test it again to see when the bug is fixed, because all three scenarios seem related somehow. To the same shader/s set, maybe? I don't know...
I've used apitrace for this kind of dumps. Just run with the OGL backend:
apitrace trace dolphin-emu
apitrace replay dolphin-emu.trace
And see if it catches the crash. If so, upload the dolphin-emu.trace file (compress it!).
(09-19-2018, 11:13 PM)degasus Wrote: [ -> ]I've used apitrace for this kind of dumps. Just run with the OGL backend:
apitrace trace dolphin-emu
apitrace replay dolphin-emu.trace
And see if it catches the crash. If so, upload the dolphin-emu.trace file (compress it!).

Thanks! I'll give it a shot. Smile
(09-19-2018, 11:13 PM)degasus Wrote: [ -> ]I've used apitrace for this kind of dumps. Just run with the OGL backend:
apitrace trace dolphin-emu
apitrace replay dolphin-emu.trace
And see if it catches the crash. If so, upload the dolphin-emu.trace file (compress it!).

I'm not sure why, but apitrace is only capturing the OSD output, and not any of the actual game itself.

What dolphin-emu and apitrace settings do you use?

"apitrace replay" also spews a bunch of errors at me, which may or may not be related: https://paste.kde.org/pww2omep8
This warnings are related:
1164 @0 glBufferData(target = GL_EXTERNAL_VIRTUAL_MEMORY_BUFFER_AMD, size = 33554432, data = blob(33554432), usage = GL_STREAM_COPY)
1164: warning: glGetError(glBufferData) = GL_INVALID_OPERATION

apitrace does not support AMD_pinned_memory.

May you try to disable this if() clause here: https://github.com/dolphin-emu/dolphin/b...r.cpp#L363 so that MapAndOrphan will be used?
(09-20-2018, 01:28 AM)degasus Wrote: [ -> ]This warnings are related:
1164 @0 glBufferData(target = GL_EXTERNAL_VIRTUAL_MEMORY_BUFFER_AMD, size = 33554432, data = blob(33554432), usage = GL_STREAM_COPY)
1164: warning: glGetError(glBufferData) = GL_INVALID_OPERATION

apitrace does not support AMD_pinned_memory.

May you try to disable this if() clause here: https://github.com/dolphin-emu/dolphin/b...r.cpp#L363 so that MapAndOrphan will be used?

Thanks! Does it require a full recompilation of Dolphin, or can I disable this extension temporarily elsewhere?
(09-20-2018, 01:41 AM)Valmar Wrote: [ -> ]Thanks! Does it require a full recompilation of Dolphin, or can I disable this extension temporarily elsewhere?

Nevermind. I can do this with a Mesa environment variable, apparently.
Okay, disable that code makes no difference.

apitrace replay output: https://paste.kde.org/pljjhcxom

Are there any tools similar to apitrace?
Try to disable both: GL_AMD_pinned_memory and GL_ARB_buffer_storage
That works! Thanks. Smile
Pages: 1 2