vkCreateFramebuffer crash on Adreno GPUs on app focus change

Hi! We’ve recently faced some crashes on Android devices using Vulkan, mostly on Adreno 710 and 650 GPUs, related to vkCreateFramebuffer and app gaining / loosing focus. I’ve made this conclusion mainly because I can see related logs right before the crash happens:

  • LogAndroid: SuspendApp_EventThread -> performing app backgrounding callback
  • LogCore: Display: AppLifetime: Application has reactivated
  • LogAndroid: Case APP_CMD_GAINED_FOCUS
  • LogAndroidEvents: Android resume audio

And other similar ones, also I’ve attached a callstack to this ticket, and an archive with several log examples.

We don’t have a stable local reproduction right now, so the data is from our crash reporting service.

I would like to ask if you have already encountered a similar issue and may know of a possible fix.

Thank you in advance for your time and support.

Best regards,

Daniil.

Steps to Reproduce

Hi Daniil,

Much of the systems surrounding Android window lifecycle have been significantly updated in 5.6, however in 5.5, setting r.Vulkan.DelayAcquireBackBuffer=2 may help resolve.

Best regards.

Hello, I have some updates regurding this problem.

We’ve tried both:

  • Setting r.Vulkan.DelayAcquireBackBuffer=2 helped - the crash has gone
  • After that we applied the Android window lifecycle changes and returned r.Vulkan.DelayAcquireBackBuffer=0, and the crash started occuring again

Hi Alexander,

Can you confirm that with r.Vulkan.DelayAcquireBackBuffer=2 the issue is currently not occurring or did the issue return under those conditions?

After applying the Window lifecycle changes, I am unsure if r.Vullan.DelayAquireBackBuffer=0 would be expected to work as its default is 1. Can you confirm if leaving it as default resolves under those conditions?

Best regards.

Hello Stephane, in total we tried 3 cases during our last public test:

  1. UE 5.5 + r.Vulkan.DelayAcquireBackBuffer=0 - crashes occur
  2. UE 5.5 + r.Vulkan.DelayAcquireBackBuffer=2 - no crashes
  3. UE 5.5 + window lifecycle changes + r.Vulkan.DelayAcquireBackBuffer=0 - crashes again

Since the public test has ended, it’s hard to check any other combinations (the crash is quite random). For now, we’re using the second option, as it’s the only one we’ve confirmed does not crash.

Thanks for confirming Alexander. From my conversations with the development team regarding r.Vulkan.DelayAcquireBackBuffer=0, the issue is the backbuffer goes away during backgrounding. and so the image that was captured before backgrounding (==0 case) is likely not getting cleaned up properly. However, that case was not tested extensively and only the default ==1 case is currently used internally against the new window lifecycle implementation.

Best regards.

Thank you for the clarification, it’s clear now. I think for now we should continue using the approach that definitely doesn’t crash, and consider alternatives when we move to a newer version of the engine with the new window lifecycle implementation.

Kind regards.