# PowerVR GM 9446: vkCmdDrawIndexed crash

**URL:** <https://forums.imgtec.com/t/powervr-gm-9446-vkcmddrawindexed-crash/3854>\
**Category:** Uncategorized\
**Created:** [December 7, 2023, 3:15pm UTC](https://forums.imgtec.com/t/powervr-gm-9446-vkcmddrawindexed-crash/3854 "2023-12-07T15:15:02Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![andreyogld3d](https://sea1.discourse-cdn.com/flex015/user_avatar/forums.imgtec.com/andreyogld3d/32/255_2.png) [@andreyogld3d](https://forums.imgtec.com/u/andreyogld3d)\
**Post date:** [December 7, 2023, 3:15pm UTC](https://forums.imgtec.com/t/powervr-gm-9446-vkcmddrawindexed-crash/3854/1 "2023-12-07T15:15:03Z")

</div>

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:

 ![image](https://us1.discourse-cdn.com/flex015/uploads/imagination1/original/1X/3ec289948cbaa89e6d75f0ebab9ddbb592172b46.jpeg)

Hardware Info:

 ![image](https://us1.discourse-cdn.com/flex015/uploads/imagination1/original/1X/fae69c0ed5ec548b5349d91bfe19c154779ccab3.png)

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](https://www.dropbox.com/scl/fi/mwjg6ondzblicrxyc00or/Vulkan-crash-PowerVR-GM-9446.7z?rlkey=olywfcq8w3xgvd6ykaoqjfi3x&dl=0)

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

---

<div class="post-metadata">

**Author:** ![AlejandroC](https://avatars.discourse-cdn.com/v4/letter/a/97f17d/32.png) [@AlejandroC](https://forums.imgtec.com/u/AlejandroC)\
**Post date:** [December 14, 2023, 6:12pm UTC](https://forums.imgtec.com/t/powervr-gm-9446-vkcmddrawindexed-crash/3854/2 "2023-12-14T18:12:11Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![andreyogld3d](https://sea1.discourse-cdn.com/flex015/user_avatar/forums.imgtec.com/andreyogld3d/32/255_2.png) [@andreyogld3d](https://forums.imgtec.com/u/andreyogld3d)\
**Post date:** [December 15, 2023, 6:01am UTC](https://forums.imgtec.com/t/powervr-gm-9446-vkcmddrawindexed-crash/3854/3 "2023-12-15T06:01:26Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![andreyogld3d](https://sea1.discourse-cdn.com/flex015/user_avatar/forums.imgtec.com/andreyogld3d/32/255_2.png) [@andreyogld3d](https://forums.imgtec.com/u/andreyogld3d)\
**Post date:** [December 15, 2023, 7:26am UTC](https://forums.imgtec.com/t/powervr-gm-9446-vkcmddrawindexed-crash/3854/4 "2023-12-15T07:26:07Z")

</div>

Also I have PowerVRCarbon traces for PowerVR GM9446 and Adreno 660  
[PVRCarbon\_traces.zip](https://forums.imgtec.com/uploads/short-url/3oOs7MMCxkP5CqdV5ckKA5muZxW.zip) (6.3 MB)

---

<div class="post-metadata">

**Author:** ![andreyogld3d](https://sea1.discourse-cdn.com/flex015/user_avatar/forums.imgtec.com/andreyogld3d/32/255_2.png) [@andreyogld3d](https://forums.imgtec.com/u/andreyogld3d)\
**Post date:** [December 26, 2023, 2:18pm UTC](https://forums.imgtec.com/t/powervr-gm-9446-vkcmddrawindexed-crash/3854/5 "2023-12-26T14:18:58Z")

</div>

Motorola G54 with PowerVR-BXM-8-256 - no problem  
RenderDoc Capture [Dropbox - vk\_PowerVR-BXM-8-256.rdc.zip - Simplify your life](https://www.dropbox.com/scl/fi/2bnw4dpulc3gop6noldv3/vk_PowerVR-BXM-8-256.rdc.zip?rlkey=mpdid8pd9vwe07b1rljsnm29t&dl=0)

---

<div class="post-metadata">

**Author:** ![AlejandroC](https://avatars.discourse-cdn.com/v4/letter/a/97f17d/32.png) [@AlejandroC](https://forums.imgtec.com/u/AlejandroC)\
**Post date:** [January 2, 2024, 2:55pm UTC](https://forums.imgtec.com/t/powervr-gm-9446-vkcmddrawindexed-crash/3854/6 "2024-01-02T14:55:53Z")

</div>

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.

```auto
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

---

<div class="post-metadata">

**Author:** ![andreyogld3d](https://sea1.discourse-cdn.com/flex015/user_avatar/forums.imgtec.com/andreyogld3d/32/255_2.png) [@andreyogld3d](https://forums.imgtec.com/u/andreyogld3d)\
**Post date:** [January 3, 2024, 2:22am UTC](https://forums.imgtec.com/t/powervr-gm-9446-vkcmddrawindexed-crash/3854/7 "2024-01-03T02:22:38Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![andreyogld3d](https://sea1.discourse-cdn.com/flex015/user_avatar/forums.imgtec.com/andreyogld3d/32/255_2.png) [@andreyogld3d](https://forums.imgtec.com/u/andreyogld3d)\
**Post date:** [January 3, 2024, 10:29am UTC](https://forums.imgtec.com/t/powervr-gm-9446-vkcmddrawindexed-crash/3854/8 "2024-01-03T10:29:50Z")

</div>

Hi @AlejandroC

> [@AlejandroC](#):
>
> I can see several _Invalid color format_ errors

I guess this problem on PowerVR’s driver side(IMGMapper ? ), this error also happens during calling [vkGetPhysicalDeviceSurfaceFormatsKHR](https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/vkGetPhysicalDeviceSurfaceFormatsKHR.html) 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](https://github.com/googlesamples/android-vulkan-tutorials/blob/master/tutorial05_triangle/app/src/main/cpp/VulkanMain.cpp#L210)

> [@AlejandroC](#):
>
> and one validation error _VkImageMemoryBarrier-newLayout-parameter_

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](https://www.dropbox.com/scl/fi/zc1hu5fq6vtayg2i28u4u/Vulkan_crash_PowerVR-GM-9446-debug_new.apk?rlkey=chkp536h51i83zvw6ac5xfrsa&dl=)

---

<div class="post-metadata">

**Author:** ![AlejandroC](https://avatars.discourse-cdn.com/v4/letter/a/97f17d/32.png) [@AlejandroC](https://forums.imgtec.com/u/AlejandroC)\
**Post date:** [January 3, 2024, 3:55pm UTC](https://forums.imgtec.com/t/powervr-gm-9446-vkcmddrawindexed-crash/3854/9 "2024-01-03T15:55:28Z")

</div>

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](https://developer.imaginationtech.com/downloads) ). 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

```auto
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

---

<div class="post-metadata">

**Author:** ![Juan](https://avatars.discourse-cdn.com/v4/letter/j/a698b9/32.png) [@Juan](https://forums.imgtec.com/u/Juan)\
**Post date:** [August 7, 2024, 2:10pm UTC](https://forums.imgtec.com/t/powervr-gm-9446-vkcmddrawindexed-crash/3854/10 "2024-08-07T14:10:32Z")

</div>

Continuing the discussion from [PowerVR GM 9446: vkCmdDrawIndexed crash](https://forums.imgtec.com/t/powervr-gm-9446-vkcmddrawindexed-crash/3854):

Hi, our Android application is experimenting a similar issue, **crashing** inside the vulkan driver when calling to **vkCmdDrawIndexed**. In this case the issue was found out on a **Motorola G73** with GPU **IMG BXM-8-256** and **Android version 13 and 14**. Here is the top part of the callstack with vulkan validations layer enabled:

```plaintext
 	libart.so!art_sigsegv_fault()	unknown
 	libart.so!art::FaultManager::HandleSigsegvFault()	unknown
 	libsigchain.so!art::SignalChain::Handler()	unknown
 	[vdso]!__kernel_rt_sigreturn()	unknown
 	vulkan.mtk.so!___lldb_unnamed_symbol623()	unknown
 	vulkan.mtk.so!___lldb_unnamed_symbol456()	unknown
 	vulkan.mtk.so!___lldb_unnamed_symbol458()	unknown
 	libVkLayer_khronos_validation.so!___lldb_unnamed_symbol7302()	unknown
 	libVkLayer_khronos_validation.so!___lldb_unnamed_symbol6074()	unknown
 	libApp.so!vk::CommandBuffer::drawIndexed<vk::DispatchLoaderDynamic>()

```

As you can see the validations Layer were enabled as well but they didn’t report any error.

The application has been tested on several Android devices with different GPU vendors but this issue is only happens on devices with this GPU.

Maybe from the callstack you can inferred where-and-why exactly the crash happens and give us a hint how to workaround it.

Juan

---

<div class="post-metadata">

**Author:** ![andreyogld3d](https://sea1.discourse-cdn.com/flex015/user_avatar/forums.imgtec.com/andreyogld3d/32/255_2.png) [@andreyogld3d](https://forums.imgtec.com/u/andreyogld3d)\
**Post date:** [August 7, 2024, 5:27pm UTC](https://forums.imgtec.com/t/powervr-gm-9446-vkcmddrawindexed-crash/3854/11 "2024-08-07T17:27:12Z")

</div>

@Juan, I have no this problem with new Power VR gpu. I have problem with PowerVR Rogue gpu

---

<div class="post-metadata">

**Author:** ![AlejandroC](https://avatars.discourse-cdn.com/v4/letter/a/97f17d/32.png) [@AlejandroC](https://forums.imgtec.com/u/AlejandroC)\
**Post date:** [August 8, 2024, 1:27pm UTC](https://forums.imgtec.com/t/powervr-gm-9446-vkcmddrawindexed-crash/3854/12 "2024-08-08T13:27:59Z")

</div>

Hi Juan,

Thanks for your message and welcome to the PowerVR Developer Forum!

I would suggest following the steps below:

- Review the Vulkan validation layer error implementation in your engine in case it is not outputting any information to the logcat which could indicate the source of the issue you are experiencing.
- Review the logcat, looking for any graphics / compute pipeline creation failure errors from the driver and any other errors which could be related.
- Does your engine verify the result of each Vulkan operation returning a `VkRresult` value? In that case you could add extra logging information to the logcat so you can see any possible errors reported.
- Try to use our offline shader compilers to verify all shaders used can be compiled. You have an example in this same thread in message [PowerVR GM 9446: vkCmdDrawIndexed crash - #9 by AlejandroC](https://forums.imgtec.com/t/powervr-gm-9446-vkcmddrawindexed-crash/3854/9) (you can download the offline shader compilers in our Developer Portal, in [Login - Imagination Developers](https://developer.imaginationtech.com/downloads/) in the section _Profiling Compilers_. Please note you will need to make a new account in our Portal to access this downloads section.
- Are you using parameter values in the call to `vkCmdDrawIndexed` for `indexCount` or `instanceCount` beyond what the device supports? please check device limits for those values (also I would verify the values of the other three parameters `firstIndex`, `vertexOffset` and `firstInstance`).

Best regards,  
Alejandro
