PowerVR GM 9446: vkCmdDrawIndexed crash

Hi! I have crash on Oppo Reno 5 lite, Android 13

But on Mali G57 (Real Narzo 30 5G) and Motorola Egde S30 Adreno 660 it is working without problem:

Demo is drawing text using texture font and single landscape’s batch:

Hardware Info:

stack trace:

[libart.so] art_sigsegv_fault 0x0000007e37981f50
[libart.so] art::FaultManager::HandleSigsegvFault(int, siginfo *, void *) 0x0000007e379817e4
[libsigchain.so] art::SignalChain::Handler(int, siginfo *, void *) 0x0000007ec17dc2b8
[[vdso]] __kernel_rt_sigreturn 0x0000007ee98b05c0
[vulkan.mt6779.so] 0x0000007da3128ae8
[vulkan.mt6779.so] 0x0000007da3103e14
[vulkan.mt6779.so] 0x0000007da31051cc
[Inlined] [lib3DMoveEngine.so] VulkanCommandBuffer::DrawIndexedInstanced(unsigned int, unsigned int, unsigned int, int, unsigned int) const VulkanCommandBuffer.h:207

I attached apk with RenderDoc’s capture from Adreno 660(vk_adreno660.rdc), screenshot(Adreno660_RenderDoc.jpg), PowerVR Gm9446.logcat.txt, stack trace(stack.txt).
Also Vertex and pixel Shaders (Spirv) and source HLSL code

3D Demo

Also I have PowerVRCarbon traces for PowerVR GM9446 and Adreno 660 https://forums.imgtec.com/uploads/short-url/3oOs7MMCxkP5CqdV5ckKA5muZxW.zip

Hi andreyogld3d,

Thanks for reporting this issue, I will work on it and report once I have more information on the possible causes.

Best regards,
Alejandro

1 Like

Hi @AlejandroC, Thank you for your Answer, The result from PowerVR GE 8100 ZTEBlade (DDK 1.9)

… ZEUS androidvulkan.androidvulkan E < ERROR>: [zeus/core/pipeline.c:3362 PipelineCompileFragmentStage]
*******
… ZEUS androidvulkan.androidvulkan E PipelineCompileFragmentStage: Failed to compile UF to HW (UF_ERR_INTERNAL 0x8)
… ZEUS androidvulkan.androidvulkan E < ERROR>: [zeus/core/pipeline.c:4201 IMG_vkCreateGraphicsPipelines]
*******
… ZEUS androidvulkan.androidvulkan E Failed to create Graphics Pipeline 0
… 3DMove androidvulkan.androidvulkan D Error: Vulkan Error: Function vkCreateGraphicsPipelines has returned error VK_ERROR_OUT_OF_HOST_MEMORY
2023-12

Also I have PowerVRCarbon traces for PowerVR GM9446 and Adreno 660
PVRCarbon_traces.zip (6.3 MB)

Motorola G54 with PowerVR-BXM-8-256 - no problem
RenderDoc Capture Dropbox - vk_PowerVR-BXM-8-256.rdc.zip - Simplify your life

Hi andreyogld3d,

Thanks for all the material and information provided. I tried to reproduce the crash on several PowerVR GPUs with no luck, one of them with a driver version quite close to the one in the device reported having issues (1.13@5793700 vs 1.13@5776728).

Reviewing the logcat attached PowerVR Gm9446.logcat I can see several Invalid color format errors, which are also reported in the PVRCarbon recording trace_adreno_660.pvrcbn (tab Static Analysis on the lower part of the UI) and one validation error VkImageMemoryBarrier-newLayout-parameter. I would recommend to fix those errors first and then verify if the issue is still happening, as it could be related with them. Some GPU manufacturers have robustness implemented at driver level, which can explain why the same application with the same errors works on some platforms and fails on others.

2023-12-07 10:34:24.026 15964-18459 IMGSRV                  androidvulkan.androidvulkan          E  :1415: GrallocTestAlloc: Invalid color format (56)
2023-12-07 10:34:24.026 15964-18459 IMGMapper               androidvulkan.androidvulkan          E  isSupported:216 Invalid BufferDescriptorInfo
2023-12-07 10:34:24.026 15964-18459 IMGMapper               androidvulkan.androidvulkan          E  isSupported:217        width -> 1
2023-12-07 10:34:24.026 15964-18459 IMGMapper               androidvulkan.androidvulkan          E  isSupported:218       height -> 1
2023-12-07 10:34:24.026 15964-18459 IMGMapper               androidvulkan.androidvulkan          E  isSupported:219       format -> 56
2023-12-07 10:34:24.026 15964-18459 IMGMapper               androidvulkan.androidvulkan          E  isSupported:220        usage -> 0x0b00
2023-12-07 10:34:24.027 15964-18459 IMGSRV                  androidvulkan.androidvulkan          E  :1415: GrallocTestAlloc: Invalid color format (56)
2023-12-07 10:34:24.027 15964-18459 IMGMapper               androidvulkan.androidvulkan          E  isSupported:216 Invalid BufferDescriptorInfo
2023-12-07 10:34:24.027 15964-18459 IMGMapper               androidvulkan.androidvulkan          E  isSupported:217        width -> 1
2023-12-07 10:34:24.027 15964-18459 IMGMapper               androidvulkan.androidvulkan          E  isSupported:218       height -> 1
2023-12-07 10:34:24.027 15964-18459 IMGMapper               androidvulkan.androidvulkan          E  isSupported:219       format -> 56
2023-12-07 10:34:24.027 15964-18459 IMGMapper               androidvulkan.androidvulkan          E  isSupported:220        usage -> 0x0b00
2023-12-07 10:34:24.028 15964-18459 IMGSRV                  androidvulkan.androidvulkan          E  :1415: GrallocTestAlloc: Invalid color format (56)
2023-12-07 10:34:24.028 15964-18459 IMGMapper               androidvulkan.androidvulkan          E  isSupported:216 Invalid BufferDescriptorInfo
2023-12-07 10:34:24.028 15964-18459 IMGMapper               androidvulkan.androidvulkan          E  isSupported:217        width -> 1
2023-12-07 10:34:24.028 15964-18459 IMGMapper               androidvulkan.androidvulkan          E  isSupported:218       height -> 1
2023-12-07 10:34:24.029 15964-18459 IMGMapper               androidvulkan.androidvulkan          E  isSupported:219       format -> 56
2023-12-07 10:34:24.029 15964-18459 IMGMapper               androidvulkan.androidvulkan          E  isSupported:220        usage -> 0x0b00
2023-12-07 10:34:24.029 15964-18459 IMGSRV                  androidvulkan.androidvulkan          E  :1415: GrallocTestAlloc: Invalid color format (56)
2023-12-07 10:34:24.029 15964-18459 IMGMapper               androidvulkan.androidvulkan          E  isSupported:216 Invalid BufferDescriptorInfo
2023-12-07 10:34:24.029 15964-18459 IMGMapper               androidvulkan.androidvulkan          E  isSupported:217        width -> 1
2023-12-07 10:34:24.029 15964-18459 IMGMapper               androidvulkan.androidvulkan          E  isSupported:218       height -> 1
2023-12-07 10:34:24.029 15964-18459 IMGMapper               androidvulkan.androidvulkan          E  isSupported:219       format -> 56
2023-12-07 10:34:24.029 15964-18459 IMGMapper               androidvulkan.androidvulkan          E  isSupported:220        usage -> 0x0b00

2023-12-07 10:34:24.050 15964-18459 3DMove                  androidvulkan.androidvulkan          D  Vulkan Debug Ouput: Validation Error: [ VUID-VkImageMemoryBarrier-newLayout-parameter ] | MessageID = 0x43f5a56f | vkCmdPipelineBarrier(): pImageMemoryBarriers[0].newLayout (1000241000) does not fall within the begin..end range of the core VkImageLayout enumeration tokens and is not an extension added token. The Vulkan spec states: newLayout must be a valid VkImageLayout value (https://www.khronos.org/registry/vulkan/specs/1.3-extensions/html/vkspec.html#VUID-VkImageMemoryBarrier-newLayout-parameter) Code 1140172143

Best regards,
Alejandro

1 Like

Hi @AlejandroC , Thank you for your response, I will fix errors and report about new results.

1 Like

Hi @AlejandroC

I guess this problem on PowerVR’s driver side(IMGMapper ? ), this error also happens during calling vkGetPhysicalDeviceSurfaceFormatsKHR with correct parameters, we have no any Vulkan Validation errors, also the same problem on Google sample android-vulkan-tutorials/tutorial05_triangle/app/src/main/cpp/VulkanMain.cpp at master · googlesamples/android-vulkan-tutorials · GitHub

I Fixed this error, but crash is still happens, may be driver can’t compile big pixel shader with multiple texture sampling (PCSS Shadows) (my message about PowerVR GE 8100)
New Apk:
Vulkan_crash_PowerVR-GM-9446-debug_new.apk

Hi andreyogld3d,

Regarding a possible shader compilation failure, it would lead to a graphics pipeline creation error, unless the shader compilation fails silently which is unlikely.

Just in case I extracted the vertex and fragment shaders used in the only two draw calls in the app you are testing, vkCmdDrawIndexed(24576, 1) and vkCmdDrawIndexed(6, 570). I tested all four with our offline shader compilers (which are now public by the way, you can get them from the Profiling Compilers download in Downloads - Imagination Developers ). I was able to compile the shaders with no problem. I used glslangValidator.exe from Vulkan 1.3.211.0 and target environment Vulkan 1.1

glslangValidator.exe --target-env vulkan1.1 -V vertex_shader_0.vert -o vertex_shader_0.spv

# BVNC GPU HW indentificator 24.50.208.504 is Series 9 XM GM9445, MT6779 Helio P90
ProfilingCompilerCLIWrapper.exe -a spv -b 24.50.208.504 -i vertex_shader_0.spv . -x -t v

Since I cannot seem to reproduce the issue even with a quite close driver version, I would say something else is involved. One case could be numerical precission affecting the conditions to exit the while loop.

I would recommend to follow an incremental approach. For the vkCmdDrawIndexed(24576, 1) draw call I would follow the steps below, trying to identify at what point the issue happens so it can be related to the latest code fragments added:

  • Start with a plain color fragment shader.
  • Use just one of the two textures combined in the shader.
  • Use the two textures.
  • Add the shadow mapping part.

Please let me know if after those steps you still do not get the issue identified.

Best regards,
Alejandro

1 Like