iOS 11 GPU hang error

I have problem of rendering on latest iOS 11. screen hanging on last frame which was succesfully rendered before errors:


2017-09-30 21:22:18.174062+0100 AppName[7500:1748760] Execution of the command buffer was aborted due to an error during execution. Caused GPU Hang Error (IOAF code 3)

2017-09-30 21:22:18.174223+0100 AppName[7500:1748760] G-buffer commandBuffer Error Domain=MTLCommandBufferErrorDomain Code=2 "Caused GPU Hang Error (IOAF code 3)" UserInfo={NSLocalizedDescription=Caused GPU Hang Error (IOAF code 3)}

2017-09-30 21:22:18.174611+0100 AppName[7500:1748760] Execution of the command buffer was aborted due to an error during execution. Discarded (victim of GPU error/recovery) (IOAF code 5)

2017-09-30 21:22:18.174688+0100 AppName[7500:1748760] Post Processing commandBuffer Error Domain=MTLCommandBufferErrorDomain Code=1 "Discarded (victim of GPU error/recovery) (IOAF code 5)" UserInfo={NSLocalizedDescription=Discarded (victim of GPU error/recovery) (IOAF code 5)}

2017-09-30 21:22:18.174749+0100 AppName[7500:1748760] Execution of the command buffer was aborted due to an error during execution. Discarded (victim of GPU error/recovery) (IOAF code 5)

2017-09-30 21:22:18.174816+0100 AppName[7500:1748760] result commandBuffer Error Domain=MTLCommandBufferErrorDomain Code=1 "Discarded (victim of GPU error/recovery) (IOAF code 5)" UserInfo={NSLocalizedDescription=Discarded (victim of GPU error/recovery) (IOAF code 5)}


App was doing some calculations and changes to metal buffers before re render.

One thing, in debug mode evereting works just fine, but in release getting those messages.


How to profile more or any sugestion what to check? Documentation about those errors very poor..

Replies

We also have seen errors like this. Before these messages, we also saw 'garbage frames' appearing (seemingly random texture memory instead of the intended ferame). This all happened under heavy load on an iPad Pro 10.5".


2017-09-29 14:16:19.246969+0200 Phoenix2[453:90143] Execution of the command buffer was aborted due to an error during execution. Caused GPU Timeout Error (IOAF code 2)
2017-09-29 14:16:19.247338+0200 Phoenix2[453:90143] Execution of the command buffer was aborted due to an error during execution. Discarded (victim of GPU error/recovery) (IOAF code 5)
2017-09-29 14:16:19.248683+0200 Phoenix2[453:90143] Execution of the command buffer was aborted due to an error during execution. Discarded (victim of GPU error/recovery) (IOAF code 5)
2017-09-29 14:16:19.248898+0200 Phoenix2[453:90143] Execution of the command buffer was aborted due to an error during execution. Discarded (victim of GPU error/recovery) (IOAF code 5)

This error can be the result of A) a driver bug or B) a shader reading our writing outside the bounds of a buffer.


Try to confirm you're always accessing withing the bounds of your buffers. If you know exactly what shader crashes the GPU you can just try accessing only index 0 of buffers in your shaders. This, of course, won't render or do the right thing, but it can give you a clue as to where you might be accessing out-of-bounds memory.

Well, we haven't changed our shaders or rendering code, but we are now getting these GPU crashes in iOS 11. Never had reports of them in iOS 9 & 10.


I can't find a way to reproduce them though, but I have experienced them myself and we get regular reports from users about them.

We have been experiencing this issue on our application with the release of iOS11. However, we have only been able to reproduce the issue using various iPhones and not any iPads. Could you let me know if you are experiencing the same thing?


It has been fairly random where sometimes the application runs for 5 minutes without issue and other times, the frames freeze twice within 30 seconds.

Did you ever fix this? I am running into similar issues.

I was running into this issue while changing anti-aliasing amount multiple times in a relatively short amount of time. The solution is not to do that.