iOS GPU hang/crash on devices with A7 and A8 chipsets

Hi,

We’re seeing a crash the second time we run our app. This is the error in the log:

May 30 10:34:06 Ryan-Lancasters-iPhone Submerged[5582] <Warning>: Fatal error: [File:/Users/UG_iMac/Perforce/Submerged_Moblie/Engine/Source/Runtime/Apple/MetalRHI/Private/MetalCommandList.cpp] [Line: 51] 
	Command Buffer Frame2 Failure! Error Domain: MTLCommandBufferErrorDomain Code: 2 Description Caused GPU Hang Error (IOAF code 3) Unknown Unknown

Googling “IOAF code 3” I found this page: IOAF code 3 when using threadgroup… | Apple Developer Forums

It basically says that the hang/crash is caused by the threadgroup_barrier function not being encountered by all threads in the thread group.

I found the code in the engine that puts this function into the Metal shader and there was this comment above the code (MetalBackend.cpp line 1901):

//@todo-rco: Fix this properly

Any chance this has been “fixed properly” yet?

Log with GPU state

Regards,

Ryan.

LuaChunk,

This issue has already been reported as: UE-30847. It’s a priority 2, major bug and it’s on our to do list. Please feel free to ask for updates as various versions of the engine come out.

Thanks!

If anyone else has this issue here’s our workaround:
The bug was caused by us loading a small empty map, checking if the player had a save game file and changing the way we loaded our main map based on the save data. We were triggering the level load from the Begin Play event in the empty level’s blueprint. To fix the crash we changed it to run the code on the first Tick of the empty level blueprint instead of the Begin Play.