RenderHeads / UnityPlugin-AVProVideo

AVPro Video is a multi-platform Unity plugin for advanced video playback
https://www.renderheads.com/products/avpro-video/
239 stars 29 forks source link

GPU Address fault error on some iOS 17 devices #1671

Closed iisakovAG closed 1 year ago

iisakovAG commented 1 year ago

We are noticing that on some iOS 17 devices that when we go into our video scene the app will break but not crash out, and our logs are filled with errors.

To Reproduce

  1. Open app
  2. Navigate to a scene with a AVProVideo media player
  3. Errors

Logs We get one of these errors 2023-10-25 15:39:31.435995-0400 APP_NAME[880:97513] Execution of the command buffer was aborted due to an error during execution. Caused GPU Address Fault Error (0000000b:kIOGPUCommandBufferCallbackErrorPageFault) 2023-10-25 15:39:31.436231-0400 APP_NAME[880:97513] MTLCommandBuffer Encoder state summary: Error Domain=MTLCommandBufferErrorDomain Code=3 "Caused GPU Address Fault Error (0000000b:kIOGPUCommandBufferCallbackErrorPageFault)" UserInfo={MTLCommandBufferEncoderInfoErrorKey=( "<errorState: MTLCommandEncoderErrorStateCompleted, label: (null), debugSignposts: (null)>", "<errorState: MTLCommandEncoderErrorStateCompleted, label: [R] Render Unlit, debugSignposts: (null)>", "<errorState: MTLCommandEncoderErrorStateFaulted, label: [R] FinalBlit, debugSignposts: (null)>" ), NSLocalizedDescription=Caused GPU Address Fault Error (0000000b:kIOGPUCommandBufferCallbackErrorPageFault), NSUnderlyingError=0x28147be10 {Error Domain=IOGPUCommandQueueErrorDomain Code=11 "(null)"}}

After the initial error above we get spammed with these errors 2023-10-25 15:39:31.785293-0400 APP_NAME[880:97513] Execution of the command buffer was aborted due to an error during execution. Ignored (for causing prior/excessive GPU errors) (00000004:kIOGPUCommandBufferCallbackErrorSubmissionsIgnored)

(APP_NAME is just our applications name)

Please DO NOT LINK / ATTACH YOUR PROJECT FILES HERE

Instead email the link to us unitysupport@renderheads.com

Chris-RH commented 1 year ago
  1. Can this be reproduced in a fresh project running just the AVPro demo scenes?
  2. Are those the full error logs?
  3. Have you tried different types (resolutions, codecs etc) of videos?
iisakovAG commented 1 year ago

We created a fresh project with just the AVProVideo package, and built out the Media Player scene to iOS and are still getting the same errors. I've attached the full error log.

avpro-fulllog.txt

Also after some more looking into the issue, right now it seems as the A12 and A13 processors are the ones giving us issues.

Chris-RH commented 1 year ago
  1. What sort of videos have you tested? codec/container/resolution/fps/bitrate etc
  2. Streaming or playing locally?
  3. Have you tested with A14+ processors and are they are working as expected?
  4. Which version of iOS 17 is it?
iisakovAG commented 1 year ago

So we tested your demo video which I believe is h.264 mp4 1080p 3632kbps 30fps. Our videos are streamed at h.264 mp4 1080p 5941kbps 12fps.

After some more testing it looks like it doesn't work on A14 too but it does on A15+. We've tested on 17.0.1, 17.0.3, 17.1, and the 17.2 beta

MorrisRH commented 1 year ago

This appears to be a Unity issue. Using Unity 2021.3.30f1 with an iPhone 12 running iOS 17.0.1 I was unable to reproduce your issue. Using Unity 2021.3.16f1 as you listed in the initial report I can reproduce this issue. I recommend you update your Unity to the latest LTS version.

iisakovAG commented 1 year ago

Unfortunately even after updating to 2021.3.30f1 and building out the demo scene to an iPhone 10S Max we are still seeing the exact same errors as shown above. We tried 2021.3.31f1 as well but that also did not work. We tried building it with Xcode 14.2, 14.3, and 15.0.1

iisakovAG commented 1 year ago

I want to add that you can hear the video's audio, you just can't see the video itself

MorrisRH commented 1 year ago

This appears to be tied to something in the MediaPlayer demo scene UI. The DisplayUGUI, ApplyToMesh and ApplyToMaterial components work fine. It would be great if you could confirm this on the iPhone 10s or XR.

I'm currently trying to narrow down which aspect of the media player demo scene is triggering the issue.

MorrisRH commented 1 year ago

It looks like the audio spectrum visualisation is the culprit.

Disable the game object in the Demo_MediaPlayer scene as shown here:

Screenshot 2023-11-01 at 12 41 51

and comment out line 739 of MediaPlayerUI.cs so it looks like this:

            // UpdateAudioSpectrum();
MorrisRH commented 1 year ago

We've disabled the spectrum visualiser on iOS for the time being. This will make it into the next release.

iisakovAG commented 1 year ago

That fixed the issue for us! Thank you for the quick responses and help!

aryansaurav commented 8 months ago

I am facing a similar issue on iOS 17.2 (iPhone 12) with Unity 2023.2.3f1 and Xcode 15.3. But, it's not just about the audio. In fact as soon as the scene with AVProVideo player loads, it starts flickering non-stop.

The Xcode console shows this error: Execution of the command buffer was aborted due to an error during execution. Ignored (for causing prior/excessive GPU errors) (00000004:kIOGPUCommandBufferCallbackErrorSubmissionsIgnored)

I saw this error on different forums and tried disabling Metal API validation among other things but to no help. Please let me know if you have any suggestions or need more information.

Chris-RH commented 8 months ago

Hi @aryansaurav,

Please could you start a new issue for this with more details about your issue.

aryansaurav commented 8 months ago

Thanks.. I managed to fix in exactly the same way as your suggestion on this thread by disabling the game object and one line in the script.

I had updated the package to the latest release and assumed that the fix for this bug would have been patched.. Just for your information!

Thank you again for your help

On Wed, Feb 28, 2024, 10:40 Chris-RH @.***> wrote:

Hi @aryansaurav https://github.com/aryansaurav,

Please could you start a new issue for this with more details about your issue.

— Reply to this email directly, view it on GitHub https://github.com/RenderHeads/UnityPlugin-AVProVideo/issues/1671#issuecomment-1968589698, or unsubscribe https://github.com/notifications/unsubscribe-auth/AKVC2DBOYT2JLADIRSNMX33YV33RBAVCNFSM6AAAAAA6P5PYZSVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSNRYGU4DSNRZHA . You are receiving this because you were mentioned.Message ID: @.***>