This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

MGD changes behavior of my Vulkan app and crashes

Hello,

I am trying to get Mali Graphics Debugger v4.8 to trace my Vulkan application on a rooted Samsung Galaxy S7 (Exynos) but it is causing the application to crash. The application is running correctly without MGD, I have turned the Android validation layers on and no error or serious warning is displayed.

If I start it with MGD tracing, it causes the error:

ERROR: [IMAGE] Code 710936520 : vkGetImageSubresourceLayout():
Image must have tiling of VK_IMAGE_TILING_LINEAR. The spec valid usage text states
'image must have been created with tiling equal to VK_IMAGE_TILING_LINEAR'
(https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkGetImageSubresourceLayout-image-00996)

to appear, and the application to crash afterwards.

I had to include libMGD.so in my APK libs and also rename it to libVkLayer_MGD.so to make it work.

Are there limitations in the way MGD handles Vulkan images?

Here's the crash report:

8414-8414/? A/DEBUG: *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
8414-8414/? A/DEBUG: Build fingerprint: 'samsung/heroltexx/herolte:7.0/NRD90M/G930FXXU1DQCG:user/release-keys'
8414-8414/? A/DEBUG: Revision: '8'
8414-8414/? A/DEBUG: ABI: 'arm64'
8414-8414/? A/DEBUG: pid: 8296, tid: 8348, name: stscene.classic  >>> virtualarts.testscene.classic <<<
8414-8414/? A/DEBUG: signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x0
8414-8414/? A/DEBUG:     x0   0000000000000025  x1   00000075f9984088  x2   0000000000000000  x3   00000075f9984050
8414-8414/? A/DEBUG:     x4   00000075f9984050  x5   0000000000000000  x6   000000760976b000  x7   0000000000000000
8414-8414/? A/DEBUG:     x8   0000000000000006  x9   0000000000000000  x10  00000075e033f980  x11  0000000000000000
8414-8414/? A/DEBUG:     x12  00000075e0341820  x13  00000003e8000000  x14  0000000000000000  x15  00164aee3d780d3e
8414-8414/? A/DEBUG:     x16  00000075e07a3948  x17  00000076087fc01c  x18  0000000000000000  x19  00000075f9984088
8414-8414/? A/DEBUG:     x20  0000007604fa6800  x21  0000000000000001  x22  0000000000000001  x23  0000000000000000
8414-8414/? A/DEBUG:     x24  0000000000000037  x25  00000075f32760c0  x26  0000000000000025  x27  00000000094006d8
8414-8414/? A/DEBUG:     x28  00000076087fb124  x29  00000075f9983660  x30  00000075e050acc8
8414-8414/? A/DEBUG:     sp   00000075f9983540  pc   00000075e050ae68  pstate 0000000060000000
8414-8414/? A/DEBUG: backtrace:
8414-8414/? A/DEBUG:     #00 pc 00000000000d9e68  /data/app/virtualarts.testscene.classic-1/lib/arm64/libVkLayer_core_validation.so
8414-8414/? A/DEBUG:     #01 pc 0000000000017ea8  /data/app/virtualarts.testscene.classic-1/lib/arm64/libVkLayer_threading.so
8414-8414/? A/DEBUG:     #02 pc 00000000005717f4  /data/app/virtualarts.testscene.classic-1/lib/arm64/libVkLayer_MGD.so
8414-8414/? A/DEBUG:     #03 pc 00000000005593b4  /data/app/virtualarts.testscene.classic-1/lib/arm64/libVkLayer_MGD.so
8414-8414/? A/DEBUG:     #04 pc 0000000000544b2c  /data/app/virtualarts.testscene.classic-1/lib/arm64/libVkLayer_MGD.so (vkCreateFramebuffer+80)
8414-8414/? A/DEBUG:     #05 pc 0000000000013ce0  /system/lib64/libvulkan.so
8414-8414/? A/DEBUG:     #06 pc 000000000042b658  /data/app/virtualarts.testscene.classic-1/lib/arm64/libunivrs.so (_ZN3UVR18DeviceRenderTarget17setupFramebuffersERNS_13VulkanContextEiRKNS_16DeviceRenderPassERKSt8functionIFSt6vectorIN2vk9ImageViewESaIS9_EEiEE+420)
8414-8414/? A/DEBUG:     #07 pc 0000000000373114  /data/app/virtualarts.testscene.classic-1/lib/arm64/libunivrs.so (_ZN3UVR13VulkanContext22setupSceneFramebuffersEv+484)
8414-8414/? A/DEBUG:     #08 pc 000000000036d0ec  /data/app/virtualarts.testscene.classic-1/lib/arm64/libunivrs.so (_ZN3UVR13VulkanContext13platformSetupEv+124)
8414-8414/? A/DEBUG:     #09 pc 0000000000288204  /data/app/virtualarts.testscene.classic-1/lib/arm64/libunivrs.so (_ZN16AndroidLifeCycle13CreateContextEP11android_app+268)
8414-8414/? A/DEBUG:     #10 pc 0000000000287cd4  /data/app/virtualarts.testscene.classic-1/lib/arm64/libunivrs.so (_ZN16AndroidLifeCycle17engine_handle_cmdEP11android_appi+120)
8414-8414/? A/DEBUG:     #11 pc 000000000000fdc8  /data/app/virtualarts.testscene.classic-1/lib/arm64/libmain-native-activity.so
8414-8414/? A/DEBUG:     #12 pc 00000000002886f8  /data/app/virtualarts.testscene.classic-1/lib/arm64/libunivrs.so (_ZN16AndroidLifeCycle11AppMainLoopEP11android_app+104)
8414-8414/? A/DEBUG:     #13 pc 000000000000d9b0  /data/app/virtualarts.testscene.classic-1/lib/arm64/libmain-native-activity.so (android_main+64)
8414-8414/? A/DEBUG:     #14 pc 000000000000fd5c  /data/app/virtualarts.testscene.classic-1/lib/arm64/libmain-native-activity.so
8414-8414/? A/DEBUG:     #15 pc 00000000000696bc  /system/lib64/libc.so (_ZL15__pthread_startPv+196)
8414-8414/? A/DEBUG:     #16 pc 000000000001dbf0  /system/lib64/libc.so (__start_thread+16)