Forums - Vulkan crash when creating a compute pipelines

8 posts / 0 new
Last post
Vulkan crash when creating a compute pipelines
vshcherbakov
Join Date: 15 Aug 18
Posts: 2
Posted: Mon, 2018-08-20 13:16

Hi,

on Google Pixel (both on android 7.1 and 9.0) with Adreno (TM) 530 Vendor 5143 Device 5030004 Driver 512.313.0 the attempt to create even a simplest compute pipeline crashes in driver.  the error is

SIGSEGV (signal SIGSEGV: invalid address (fault address: 0x4))

and the callstack is

<unknown function> 0x00000000e6337b56

<unknown function> 0x00000000e6337206

<unknown function> 0x00000000e5f4f526

<unknown function> 0x00000000e5f4ff40

<unknown function> 0x00000000e65220fe

<unknown function> 0x00000000e6529e8e

QGLCCompileToIRShader(void*, QGLC_SRCSHADER*, QGLC_COMPILETOIR_RESULT*) 0x00000000e65d109a

QglShaderCompiler::CompileToIrShader(QglProgram const*, QglShaderStage, char const*, unsigned int, char const*, QGLC_COMPILETOIR_RESULT*) 0x00000000d5921852

QglProgram::Compile(QglPipelineLayout const*) 0x00000000d59153d4

QglProgram::Create(QglProgramCreateData*) 0x00000000d591505e

QglPipeline::CreateProgram() 0x00000000d5913060

QglPipeline::Compile() 0x00000000d5912f04

QglPipeline::Init(QglPipelineCreateData*) 0x00000000d59122aa

QglPipeline::Create(QglPipelineCreateData*) 0x00000000d591220e

qglinternal::vkCreateComputePipelines(VkDevice_T*, unsigned long long, unsigned int, VkComputePipelineCreateInfo const*, VkAllocationCallbacks const*, unsigned long long*) 0x00000000d58e9174

So basically upgrading android didn't change anything. Would appreciate any hints. Thanks!

  • Up0
  • Down0
vshcherbakov
Join Date: 15 Aug 18
Posts: 2
Posted: Mon, 2018-08-20 13:32

here's the source for the shader

OpCapability Shader

%1 = OpExtInstImport "GLSL.std.450"

OpMemoryModel Logical GLSL450

OpEntryPoint GLCompute %2 "main" %gl_GlobalInvocationID

OpExecutionMode %2 LocalSize 8 8 1

OpDecorate %4 DescriptorSet 1

OpDecorate %4 Binding 0

OpDecorate %gl_GlobalInvocationID BuiltIn GlobalInvocationId

%void = OpTypeVoid

%6 = OpTypeFunction %void

%uint = OpTypeInt 32 0

%v3uint = OpTypeVector %uint 3

%int = OpTypeInt 32 1

%int_0 = OpConstant %int 0

%11 = OpTypeImage %int 3D 0 0 0 2 R32i

%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11

%4 = OpVariable %_ptr_UniformConstant_11 UniformConstant

%_ptr_Input_v3uint = OpTypePointer Input %v3uint

%gl_GlobalInvocationID = OpVariable %_ptr_Input_v3uint Input

%2 = OpFunction %void None %6

%14 = OpLabel

%15 = OpLoad %v3uint %gl_GlobalInvocationID

%16 = OpLoad %11 %4

OpImageWrite %16 %15 %int_0

OpReturn

 

OpFunctionEnd

  • Up0
  • Down0
seyedmorteza
Join Date: 27 Sep 18
Posts: 2
Posted: Tue, 2018-12-04 03:14

Were you able to fix the problem? I am having the same problem when using compute shader.

  • Up0
  • Down0
seyedmorteza
Join Date: 27 Sep 18
Posts: 2
Posted: Tue, 2018-12-04 03:45

Are you using DXC compiler or GlslangValidator? I am using DXC.

  • Up0
  • Down0
GilesGoat
Join Date: 15 Jul 14
Posts: 5
Posted: Wed, 2020-12-02 09:52

Hi,

I am currently working since about 6 months on a graphics engine done in Vulkan for PC/Oculus Quest, so far we did not touch much compute shaders .. until a couple of weeks ago ..

The code base is very similar, let' say "80% identical" between PC and Quest version, in fact that's the whole idea of the thing.

Anyway let's say I have something that works totally perfect on the PC but the moment I try to call :

result = vkCreateComputePipelines(DeviceParams.device, VK_NULL_HANDLE, 1,
        &computePipelineCreateInfo, nullptr, the_pipeline);

 

With a set of descriptors/layouts/etc. that seem OK on PC all I get is :

Signal = SIGSEGV ( signal SIGSEVG : invalid address ( fault address 0x3df8e9be534709) )

The "fault address" seems to be "always the same" no matter what "parameters" are passed.

Now I can't run the samples "as they are" from the Adreno SDK, because that won't run on Quest, but I did take the same compute shader in the sample and re-compiled in my envirronement .. again .. calling VkCreateComputePipelines() seems ALWAYS to fall "no matter what".

I did post this same thing today on the Oculus Quest forums but I doubt I'll get any reply.

I so far made " a lot of tries " simplifying at max the compute shader, at the point to have a compute shader that just made something like :

/*
 * Compute shader
 */
 
 
layout (local_size_x =4, local_size_y = 4) in;
 
struct vertex_layout {
        vec4 pos;
        vec4 color;
        vec4 uv;
    };
 
layout(std140, binding = 0) buffer data 
                                    {
                                       vertex_layout vertices[];
                                    };
                                    
void main()
{  
  // 64x64 grid
  uint loc = gl_GlobalInvocationID.y * 64 + gl_GlobalInvocationID.x;
  
  float time = 0;
  float pi = 3.14f;
  float factor = time + gl_GlobalInvocationID.x*pi*4.0f;
  float offset = sin(factor*0.02f);
  
  vertices[loc].pos.y =  offset*0.5f;
}
 
I tried "everything I can think of" it just would appear that "no matter what you pass as input to that call it always crashes".
 
Any help/suggestion would be appreciated.
 
Cheers.
 

 

  • Up0
  • Down0
GilesGoat
Join Date: 15 Jul 14
Posts: 5
Posted: Wed, 2020-12-02 09:54

Hi,

to reply you "in case of my crashses" I am always using GLslangValidator, the one found/supplied in the Lunarg SDK.

  • Up0
  • Down0
GilesGoat
Join Date: 15 Jul 14
Posts: 5
Posted: Mon, 2020-12-07 03:17

Hi,

I wish to add some more info, this is the kind of GPU/situation I am working with :

 --------------------------------
 Device Name          : Adreno (TM) 540
 Device Type          : integrated GPU
 Vendor ID            : 0x5143
 Device ID            : 0x5040001
 Driver Version       : 512.513.0
 API Version          : 1.1.128
 Queue Families       : 0 = graphics (3 queues, 3 priorities)
 Work Queue Family    : 0
 Present Queue Family : 0
 --------------------------------
 
I think it's Vulkan version 1.01 or such not a super recent one.
 
Again the kind of error I keep getting is like this :
 
2020-12-07 11:07:32.658 15289-15580/com.oculus.sdk.VrGiles6 A/libc: Fatal signal 11 (SIGSEGV), code 1, fault addr 0x3c6516be177655 in tid 15580 (OVR::Main)
2020-12-07 11:07:33.510 15289-15580/com.oculus.sdk.VrGiles6 E/crash-reporter-support: native-crash64 client received a negative request status from the crash server
2020-12-07 11:07:33.510 15289-15580/com.oculus.sdk.VrGiles6 I/crash-reporter: failed to capture minidump crash
 
Any suggestions about what to try to do/look for will be appreciated :)
 
 

 

  • Up0
  • Down0
AndreyVK_D3D
Profile picture
Join Date: 10 Jun 13
Location: Moscow
Posts: 36
Posted: Tue, 2021-01-05 07:30
  • Up0
  • Down0
or Register

Opinions expressed in the content posted here are the personal opinions of the original authors, and do not necessarily reflect those of Qualcomm Incorporated or its subsidiaries (“Qualcomm”). The content is provided for informational purposes only and is not meant to be an endorsement or representation by Qualcomm or any other party. This site may also provide links or references to non-Qualcomm sites and resources. Qualcomm makes no representations, warranties, or other commitments whatsoever about any non-Qualcomm sites or third-party resources that may be referenced, accessible from, or linked to this site.