Please note: We are aware of an issue affecting replies on the Arm Community forums, which may not be loading as expected.

We apologize for any inconvenience and appreciate your patience while we investigate and work to resolve the issue.

Thank you for your understanding.


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

[Vulkan] Mali-G76 possible spirv related crash

Hi we're encountering a crash in vulkan driver which possibly related to shader code.

: pid: 20915, tid: 23289, name: TaskGraphHP 4  >>> com.demo.demo <<<
: uid: 10411
: signal 11 (SIGSEGV), code -6 (SI_TKILL), fault addr --------
:     x0  0000000000000000  x1  0000000000005af9  x2  000000000000000b  x3  0000000000000000
:     x4  4008000000000000  x5  0000000000000000  x6  0000000000000000  x7  7f7f7f7f7f7f7f7f
:     x8  0000000000000083  x9  4321f071e901995e  x10 0000007efc61205c  x11 000000000000003b
:     x12 0000000000000018  x13 ffffffffffffffff  x14 ffffffffff000000  x15 ffffffffffffffff
:     x16 0000007dfb527430  x17 0000007eff035ba0  x18 0000000000001ca4  x19 000000000000000b
:     x20 0000007da38352d0  x21 00000000000051b3  x22 00000000000028ab  x23 0000000000005af9
:     x24 0000000000000000  x25 0000000000000070  x26 0000000000000064  x27 0000007d45f5d020
:     x28 0000007dfb52c1e0  x29 0000007e04cf6d00
:     sp  0000007e04cf6a60  lr  0000007dfb42b440  pc  0000007eff035bc0
:
: backtrace:
:       #00 pc 000000000006cbc0  /apex/com.android.runtime/lib64/bionic/libc.so (syscall+32) (BuildId: b91c775ccc9b0556e91bc575a2511cd0)
:       #01 pc 000000000001b43c  /data/app/com.demo.demo-tRgmyU9_u7D-1Q9a9OfoMQ==/lib/arm64/libCrashSight.so (BuildId: 5fef3bf82a535d91909c996e46141b41588f1549)
:       #02 pc 0000000000004cb8  /system/bin/app_process64 (art::SignalChain::Handler(int, siginfo*, void*)+352) (BuildId: e844be217eb39b34490d3798328d1f12)
:       #03 pc 0000000000000638  [vdso] (__kernel_rt_sigreturn)
:       #04 pc 0000000000cec578  /vendor/lib64/egl/libGLES_mali.so (BuildId: b4caf7da709ad611a374b5d7d59fd88f)
:       #05 pc 0000000000ce9564  /vendor/lib64/egl/libGLES_mali.so (BuildId: b4caf7da709ad611a374b5d7d59fd88f)
:       #06 pc 0000000000ce42d8  /vendor/lib64/egl/libGLES_mali.so (BuildId: b4caf7da709ad611a374b5d7d59fd88f)
:       #07 pc 0000000000ca01c4  /vendor/lib64/egl/libGLES_mali.so (BuildId: b4caf7da709ad611a374b5d7d59fd88f)
:       #08 pc 0000000000c9e7c0  /vendor/lib64/egl/libGLES_mali.so (BuildId: b4caf7da709ad611a374b5d7d59fd88f)
:       #09 pc 0000000000c9c824  /vendor/lib64/egl/libGLES_mali.so (BuildId: b4caf7da709ad611a374b5d7d59fd88f)
:       #10 pc 00000000024864e4  /vendor/lib64/egl/libGLES_mali.so (BuildId: b4caf7da709ad611a374b5d7d59fd88f)
:       #11 pc 00000000024889c4  /vendor/lib64/egl/libGLES_mali.so (BuildId: b4caf7da709ad611a374b5d7d59fd88f)
:       #12 pc 00000000024cf1a0  /vendor/lib64/egl/libGLES_mali.so (BuildId: b4caf7da709ad611a374b5d7d59fd88f)
:       #13 pc 00000000000cf7c0  /apex/com.android.runtime/lib64/bionic/libc.so (__pthread_start(void*)+36) (BuildId: b91c775ccc9b0556e91bc575a2511cd0)
:       #14 pc 00000000000721a8  /apex/com.android.runtime/lib64/bionic/libc.so (__start_thread+64) (BuildId: b91c775ccc9b0556e91bc575a2511cd0)

Device & driver info:

GpuFamily: Mali-G76

GlVersion: OpenGL ES 3.2 v1.r18p0-01rel0.e098644a2658b0905d91d87153032847

Hardware: vendor Kirin990

DeviceBuildNumber: TAS-AN00 2.0.0.280(C00E230R7P6)

VulkanVersion: 1.1.97

AndroidVersion: 10

The last PSO bound to render state is:

; SPIR-V
; Version: 1.0
; Generator: Google spiregg; 0
; Bound: 59
; Schema: 0
               OpCapability Shader
               OpMemoryModel Logical GLSL450
               OpEntryPoint Vertex %main_00000644_044c1d09 "main_00000644_044c1d09" %in_var_ATTRIBUTE0 %in_var_ATTRIBUTE1 %out_var_TEXCOORD0 %gl_Position
               OpName %type_DrawRectangleParameters "type.DrawRectangleParameters"
               OpName %DrawRectangleParameters "DrawRectangleParameters"
               OpName %in_var_ATTRIBUTE0 "in.var.ATTRIBUTE0"
               OpName %in_var_ATTRIBUTE1 "in.var.ATTRIBUTE1"
               OpName %out_var_TEXCOORD0 "out.var.TEXCOORD0"
               OpName %main_00000644_044c1d09 "main_00000644_044c1d09"
               OpDecorate %out_var_TEXCOORD0 NoPerspective
               OpDecorate %gl_Position BuiltIn Position
               OpDecorate %gl_Position Invariant
               OpDecorate %in_var_ATTRIBUTE0 Location 0
               OpDecorate %in_var_ATTRIBUTE1 Location 1
               OpDecorate %out_var_TEXCOORD0 Location 0
               OpDecorate %DrawRectangleParameters DescriptorSet 0
               OpDecorate %DrawRectangleParameters Binding 0
               OpMemberDecorate %type_DrawRectangleParameters 0 Offset 0
               OpMemberDecorate %type_DrawRectangleParameters 1 Offset 16
               OpMemberDecorate %type_DrawRectangleParameters 2 Offset 32
               OpDecorate %type_DrawRectangleParameters Block
      %float = OpTypeFloat 32
    %v4float = OpTypeVector %float 4
    %v2float = OpTypeVector %float 2
        %int = OpTypeInt 32 1
    %float_0 = OpConstant %float 0
    %float_1 = OpConstant %float 1
      %int_1 = OpConstant %int 1
      %int_0 = OpConstant %int 0
   %float_n1 = OpConstant %float -1
         %17 = OpConstantComposite %v2float %float_n1 %float_n1
    %float_2 = OpConstant %float 2
      %int_2 = OpConstant %int 2
         %20 = OpConstantComposite %v2float %float_1 %float_n1
%type_DrawRectangleParameters = OpTypeStruct %v4float %v4float %v4float
%_ptr_Uniform_type_DrawRectangleParameters = OpTypePointer Uniform %type_DrawRectangleParameters
%_ptr_Input_v2float = OpTypePointer Input %v2float
%_ptr_Output_v2float = OpTypePointer Output %v2float
%_ptr_Output_v4float = OpTypePointer Output %v4float
       %void = OpTypeVoid
         %26 = OpTypeFunction %void
%_ptr_Uniform_v4float = OpTypePointer Uniform %v4float
%DrawRectangleParameters = OpVariable %_ptr_Uniform_type_DrawRectangleParameters Uniform
%in_var_ATTRIBUTE0 = OpVariable %_ptr_Input_v2float Input
%in_var_ATTRIBUTE1 = OpVariable %_ptr_Input_v2float Input
%out_var_TEXCOORD0 = OpVariable %_ptr_Output_v2float Output
%gl_Position = OpVariable %_ptr_Output_v4float Output
         %28 = OpConstantNull %v4float
%main_00000644_044c1d09 = OpFunction %void None %26
         %29 = OpLabel
         %30 = OpLoad %v2float %in_var_ATTRIBUTE0
         %31 = OpLoad %v2float %in_var_ATTRIBUTE1
         %32 = OpCompositeExtract %float %30 0
         %33 = OpCompositeExtract %float %30 1
         %34 = OpCompositeConstruct %v4float %32 %33 %float_0 %float_1
         %35 = OpAccessChain %_ptr_Uniform_v4float %DrawRectangleParameters %int_0
         %36 = OpLoad %v4float %35
         %37 = OpVectorShuffle %v2float %36 %36 2 3
         %38 = OpVectorShuffle %v2float %34 %34 0 1
         %39 = OpVectorShuffle %v2float %36 %36 0 1
         %40 = OpFMul %v2float %38 %39
         %41 = OpFAdd %v2float %37 %40
         %42 = OpVectorTimesScalar %v2float %41 %float_2
         %43 = OpAccessChain %_ptr_Uniform_v4float %DrawRectangleParameters %int_2
         %44 = OpLoad %v4float %43
         %45 = OpVectorShuffle %v2float %44 %44 0 1
         %46 = OpFMul %v2float %42 %45
         %47 = OpFAdd %v2float %17 %46
         %48 = OpVectorShuffle %v2float %47 %28 0 1
         %49 = OpFMul %v2float %48 %20
         %50 = OpVectorShuffle %v4float %34 %49 4 5 2 3
         %51 = OpAccessChain %_ptr_Uniform_v4float %DrawRectangleParameters %int_1
         %52 = OpLoad %v4float %51
         %53 = OpVectorShuffle %v2float %52 %52 2 3
         %54 = OpVectorShuffle %v2float %52 %52 0 1
         %55 = OpFMul %v2float %31 %54
         %56 = OpFAdd %v2float %53 %55
         %57 = OpVectorShuffle %v2float %44 %44 2 3
         %58 = OpFMul %v2float %56 %57
               OpStore %out_var_TEXCOORD0 %58
               OpStore %gl_Position %50
               OpReturn
               OpFunctionEnd

; SPIR-V
; Version: 1.0
; Generator: Google spiregg; 0
; Bound: 193
; Schema: 0
               OpCapability Shader
          %1 = OpExtInstImport "GLSL.std.450"
               OpMemoryModel Logical GLSL450
               OpEntryPoint Fragment %main_000011b8_b2799476 "main_000011b8_b2799476" %in_var_TEXCOORD0 %out_var_SV_Target0
               OpExecutionMode %main_000011b8_b2799476 OriginUpperLeft
               OpName %type_2d_image "type.2d.image"
               OpName %InTexture "InTexture"
               OpName %type_sampler "type.sampler"
               OpName %InTextureBilinearSampler "InTextureBilinearSampler"
               OpName %type__Globals "type.$Globals"
               OpName %_Globals "$Globals"
               OpName %in_var_TEXCOORD0 "in.var.TEXCOORD0"
               OpName %out_var_SV_Target0 "out.var.SV_Target0"
               OpName %main_000011b8_b2799476 "main_000011b8_b2799476"
               OpName %type_sampled_image "type.sampled.image"
               OpDecorate %in_var_TEXCOORD0 NoPerspective
               OpDecorate %in_var_TEXCOORD0 Location 0
               OpDecorate %out_var_SV_Target0 Location 0
               OpDecorate %InTexture DescriptorSet 1
               OpDecorate %InTexture Binding 2
               OpDecorate %InTextureBilinearSampler DescriptorSet 1
               OpDecorate %InTextureBilinearSampler Binding 1
               OpDecorate %_Globals DescriptorSet 1
               OpDecorate %_Globals Binding 0
               OpMemberDecorate %type__Globals 0 Offset 0
               OpMemberDecorate %type__Globals 1 Offset 8
               OpDecorate %type__Globals Block
               OpDecorate %in_var_TEXCOORD0 RelaxedPrecision
               OpDecorate %12 RelaxedPrecision
               OpDecorate %13 RelaxedPrecision
               OpDecorate %14 RelaxedPrecision
               OpDecorate %15 RelaxedPrecision
               OpDecorate %16 RelaxedPrecision
               OpDecorate %17 RelaxedPrecision
               OpDecorate %18 RelaxedPrecision
               OpDecorate %19 RelaxedPrecision
      %float = OpTypeFloat 32
    %v4float = OpTypeVector %float 4
    %v2float = OpTypeVector %float 2
        %int = OpTypeInt 32 1
    %float_0 = OpConstant %float 0
    %float_1 = OpConstant %float 1
 %float_n0_5 = OpConstant %float -0.5
  %float_0_5 = OpConstant %float 0.5
%float_0_125 = OpConstant %float 0.125
 %float_0_25 = OpConstant %float 0.25
      %int_0 = OpConstant %int 0
    %float_2 = OpConstant %float 2
   %float_n2 = OpConstant %float -2
      %int_1 = OpConstant %int 1
         %34 = OpConstantComposite %v2float %float_1 %float_1
         %35 = OpConstantComposite %v4float %float_0 %float_0 %float_0 %float_1
%type_2d_image = OpTypeImage %float 2D 2 0 0 1 Unknown
%_ptr_UniformConstant_type_2d_image = OpTypePointer UniformConstant %type_2d_image
%type_sampler = OpTypeSampler
%_ptr_UniformConstant_type_sampler = OpTypePointer UniformConstant %type_sampler
%type__Globals = OpTypeStruct %v2float %float
%_ptr_Uniform_type__Globals = OpTypePointer Uniform %type__Globals
%_ptr_Input_v2float = OpTypePointer Input %v2float
%_ptr_Output_v4float = OpTypePointer Output %v4float
       %void = OpTypeVoid
         %42 = OpTypeFunction %void
       %bool = OpTypeBool
%_ptr_Uniform_v2float = OpTypePointer Uniform %v2float
%_ptr_Uniform_float = OpTypePointer Uniform %float
%type_sampled_image = OpTypeSampledImage %type_2d_image
     %v4bool = OpTypeVector %bool 4
  %InTexture = OpVariable %_ptr_UniformConstant_type_2d_image UniformConstant
%InTextureBilinearSampler = OpVariable %_ptr_UniformConstant_type_sampler UniformConstant
   %_Globals = OpVariable %_ptr_Uniform_type__Globals Uniform
%in_var_TEXCOORD0 = OpVariable %_ptr_Input_v2float Input
%out_var_SV_Target0 = OpVariable %_ptr_Output_v4float Output
         %47 = OpConstantComposite %v2float %float_n0_5 %float_n0_5
         %48 = OpConstantComposite %v2float %float_0_5 %float_n0_5
         %49 = OpConstantComposite %v2float %float_n0_5 %float_0_5
         %50 = OpConstantComposite %v2float %float_0_5 %float_0_5
         %51 = OpConstantComposite %v2float %float_0 %float_n0_5
         %52 = OpConstantComposite %v2float %float_n0_5 %float_0
         %53 = OpConstantComposite %v2float %float_0_5 %float_0
         %54 = OpConstantComposite %v2float %float_0 %float_0_5
%float_2_23606801 = OpConstant %float 2.23606801
%float_0_400000006 = OpConstant %float 0.400000006
         %57 = OpConstantComposite %v4float %float_0_400000006 %float_0_400000006 %float_0_400000006 %float_0_400000006
         %58 = OpUndef %v2float
%main_000011b8_b2799476 = OpFunction %void None %42
         %59 = OpLabel
         %12 = OpLoad %v2float %in_var_TEXCOORD0
         %13 = OpCompositeExtract %float %12 0
         %14 = OpFOrdLessThanEqual %bool %13 %float_0_5
         %15 = OpFMul %float %13 %float_2
         %16 = OpFMul %float %float_n2 %13
         %17 = OpFAdd %float %16 %float_2
         %18 = OpSelect %float %14 %15 %17
         %60 = OpCompositeInsert %v2float %18 %58 0
         %19 = OpCompositeExtract %float %12 1
         %61 = OpCompositeInsert %v2float %19 %60 1
         %62 = OpVectorTimesScalar %v2float %61 %float_2
         %63 = OpFSub %v2float %62 %34
         %64 = OpDot %float %63 %63
         %65 = OpAccessChain %_ptr_Uniform_v2float %_Globals %int_0
         %66 = OpAccessChain %_ptr_Uniform_float %_Globals %int_0 %int_1
         %67 = OpLoad %float %66
         %68 = OpFMul %float %float_2_23606801 %67
         %69 = OpFSub %float %float_1 %68
         %70 = OpExtInst %float %1 FClamp %69 %float_0 %float_1
         %71 = OpFOrdGreaterThan %bool %64 %70
               OpSelectionMerge %72 None
               OpBranchConditional %71 %73 %74
         %73 = OpLabel
         %75 = OpFMul %float %18 %float_0_5
         %76 = OpCompositeInsert %v2float %75 %61 0
         %77 = OpLoad %type_2d_image %InTexture
         %78 = OpLoad %type_sampler %InTextureBilinearSampler
         %79 = OpSampledImage %type_sampled_image %77 %78
         %80 = OpImageSampleExplicitLod %v4float %79 %76 Lod %float_0
         %81 = OpLoad %v2float %65
         %82 = OpFMul %v2float %47 %81
         %83 = OpFAdd %v2float %76 %82
         %84 = OpSampledImage %type_sampled_image %77 %78
         %85 = OpImageSampleExplicitLod %v4float %84 %83 Lod %float_0
         %86 = OpVectorTimesScalar %v4float %85 %float_0_125
         %87 = OpFAdd %v4float %80 %86
         %88 = OpFMul %v2float %48 %81
         %89 = OpFAdd %v2float %76 %88
         %90 = OpSampledImage %type_sampled_image %77 %78
         %91 = OpImageSampleExplicitLod %v4float %90 %89 Lod %float_0
         %92 = OpVectorTimesScalar %v4float %91 %float_0_125
         %93 = OpFAdd %v4float %87 %92
         %94 = OpFMul %v2float %49 %81
         %95 = OpFAdd %v2float %76 %94
         %96 = OpSampledImage %type_sampled_image %77 %78
         %97 = OpImageSampleExplicitLod %v4float %96 %95 Lod %float_0
         %98 = OpVectorTimesScalar %v4float %97 %float_0_125
         %99 = OpFAdd %v4float %93 %98
        %100 = OpFMul %v2float %50 %81
        %101 = OpFAdd %v2float %76 %100
        %102 = OpSampledImage %type_sampled_image %77 %78
        %103 = OpImageSampleExplicitLod %v4float %102 %101 Lod %float_0
        %104 = OpVectorTimesScalar %v4float %103 %float_0_125
        %105 = OpFAdd %v4float %99 %104
        %106 = OpFMul %v2float %51 %81
        %107 = OpFAdd %v2float %76 %106
        %108 = OpSampledImage %type_sampled_image %77 %78
        %109 = OpImageSampleExplicitLod %v4float %108 %107 Lod %float_0
        %110 = OpVectorTimesScalar %v4float %109 %float_0_25
        %111 = OpFAdd %v4float %105 %110
        %112 = OpFMul %v2float %52 %81
        %113 = OpFAdd %v2float %76 %112
        %114 = OpSampledImage %type_sampled_image %77 %78
        %115 = OpImageSampleExplicitLod %v4float %114 %113 Lod %float_0
        %116 = OpVectorTimesScalar %v4float %115 %float_0_25
        %117 = OpFAdd %v4float %111 %116
        %118 = OpFMul %v2float %53 %81
        %119 = OpFAdd %v2float %76 %118
        %120 = OpSampledImage %type_sampled_image %77 %78
        %121 = OpImageSampleExplicitLod %v4float %120 %119 Lod %float_0
        %122 = OpVectorTimesScalar %v4float %121 %float_0_25
        %123 = OpFAdd %v4float %117 %122
        %124 = OpFMul %v2float %54 %81
        %125 = OpFAdd %v2float %76 %124
        %126 = OpSampledImage %type_sampled_image %77 %78
        %127 = OpImageSampleExplicitLod %v4float %126 %125 Lod %float_0
        %128 = OpVectorTimesScalar %v4float %127 %float_0_25
        %129 = OpFAdd %v4float %123 %128
               OpBranch %72
         %74 = OpLabel
        %130 = OpLoad %type_2d_image %InTexture
        %131 = OpLoad %type_sampler %InTextureBilinearSampler
        %132 = OpSampledImage %type_sampled_image %130 %131
        %133 = OpImageSampleExplicitLod %v4float %132 %12 Lod %float_0
        %134 = OpLoad %v2float %65
        %135 = OpFMul %v2float %47 %134
        %136 = OpFAdd %v2float %12 %135
        %137 = OpSampledImage %type_sampled_image %130 %131
        %138 = OpImageSampleExplicitLod %v4float %137 %136 Lod %float_0
        %139 = OpVectorTimesScalar %v4float %138 %float_0_125
        %140 = OpFAdd %v4float %133 %139
        %141 = OpFMul %v2float %48 %134
        %142 = OpFAdd %v2float %12 %141
        %143 = OpSampledImage %type_sampled_image %130 %131
        %144 = OpImageSampleExplicitLod %v4float %143 %142 Lod %float_0
        %145 = OpVectorTimesScalar %v4float %144 %float_0_125
        %146 = OpFAdd %v4float %140 %145
        %147 = OpFMul %v2float %49 %134
        %148 = OpFAdd %v2float %12 %147
        %149 = OpSampledImage %type_sampled_image %130 %131
        %150 = OpImageSampleExplicitLod %v4float %149 %148 Lod %float_0
        %151 = OpVectorTimesScalar %v4float %150 %float_0_125
        %152 = OpFAdd %v4float %146 %151
        %153 = OpFMul %v2float %50 %134
        %154 = OpFAdd %v2float %12 %153
        %155 = OpSampledImage %type_sampled_image %130 %131
        %156 = OpImageSampleExplicitLod %v4float %155 %154 Lod %float_0
        %157 = OpVectorTimesScalar %v4float %156 %float_0_125
        %158 = OpFAdd %v4float %152 %157
        %159 = OpFMul %v2float %51 %134
        %160 = OpFAdd %v2float %12 %159
        %161 = OpSampledImage %type_sampled_image %130 %131
        %162 = OpImageSampleExplicitLod %v4float %161 %160 Lod %float_0
        %163 = OpVectorTimesScalar %v4float %162 %float_0_25
        %164 = OpFAdd %v4float %158 %163
        %165 = OpFMul %v2float %52 %134
        %166 = OpFAdd %v2float %12 %165
        %167 = OpSampledImage %type_sampled_image %130 %131
        %168 = OpImageSampleExplicitLod %v4float %167 %166 Lod %float_0
        %169 = OpVectorTimesScalar %v4float %168 %float_0_25
        %170 = OpFAdd %v4float %164 %169
        %171 = OpFMul %v2float %53 %134
        %172 = OpFAdd %v2float %12 %171
        %173 = OpSampledImage %type_sampled_image %130 %131
        %174 = OpImageSampleExplicitLod %v4float %173 %172 Lod %float_0
        %175 = OpVectorTimesScalar %v4float %174 %float_0_25
        %176 = OpFAdd %v4float %170 %175
        %177 = OpFMul %v2float %54 %134
        %178 = OpFAdd %v2float %12 %177
        %179 = OpSampledImage %type_sampled_image %130 %131
        %180 = OpImageSampleExplicitLod %v4float %179 %178 Lod %float_0
        %181 = OpVectorTimesScalar %v4float %180 %float_0_25
        %182 = OpFAdd %v4float %176 %181
               OpBranch %72
         %72 = OpLabel
        %183 = OpPhi %v4float %129 %73 %182 %74
        %184 = OpFMul %v4float %183 %57
        %185 = OpAccessChain %_ptr_Uniform_float %_Globals %int_1
        %186 = OpLoad %float %185
        %187 = OpCompositeConstruct %v4float %186 %186 %186 %float_1
        %188 = OpExtInst %v4float %1 FMin %187 %184
        %189 = OpIsNan %v4bool %188
        %190 = OpAny %bool %189
        %191 = OpCompositeConstruct %v4bool %190 %190 %190 %190
        %192 = OpSelect %v4float %191 %35 %188
               OpStore %out_var_SV_Target0 %192
               OpReturn
               OpFunctionEnd

The only suspicious part is that this vertex pixel shader pair's interface variable type is missmatching(float vs half).

We'll fix this issue and re-check again. But the same PSO works on other mali devices. The G76 is by far the only device that crashes.