Forums - errno 35 + no texture on Adreno 610 Device

1 post / 0 new
errno 35 + no texture on Adreno 610 Device
bekiroe
Join Date: 24 Dec 22
Posts: 1
Posted: Sat, 2022-12-24 08:08

I'm working on an Android app using the Android SDK + OpenGL ES 3.2. A compute shader (for IBL computation) of  mine causes a crash with the following report:

W/Adreno-GSL: <gsl_ldd_control:553>: ioctl fd 84 code 0xc040094a (IOCTL_KGSL_GPU_COMMAND) failed: errno 35 Resource deadlock would occur
W/Adreno-GSL: <log_gpu_snapshot:462>: panel.gpuSnapshotPath is not set.not generating user snapshot
...

 

Another thing I've noticed is that if, for example, I add a `glFinish()` call at the end of my render loop, the app won't crash but it'll be unresponsive and all I get is a white screen. Additionally, on top of the above error messages this one pops up:

W/Adreno-GSL: <gsl_ldd_control:553>: ioctl fd 85 code 0xc0200933 (IOCTL_KGSL_TIMESTAMP_EVENT) failed: errno 22 Invalid argument
W/Adreno-GSL: <ioctl_kgsl_syncobj_create:4451>: (56, f, 25536) fail 22 Invalid argument
 
Anyway, I've basically adapted the following implementation: https://bruop.github.io/ibl/. I've tested it on two Mali devices, and it works for both of them, but not for the Adreno device. Specifically the double for-loop in section "Lambertian Diffuse Component" along with the `textureLod()` call seems to be what is causing the crash. I can circumvent it by using a larger step size, but now the problem is that I get a black texture as output (again, it works for Mali).
 
Here is the loop:
for(float phi = 0.0; phi < TWO_PI; phi += deltaPhi) {
    for(float theta = 0.0; theta < HALF_PI; theta += deltaTheta) {
        vec3 tempVec = cos(phi) * right + sin(phi) * up;
        vec3 sampleVec = cos(theta) * normal + sin(theta) * tempVec;

        irradiance += textureLod(u_environmentMap, sampleVec, 0.0).rgb * cos(theta) * sin(theta);
        sampleCount++;
    }
}
 
TheOpenGL setup:
val size = irradianceMapSize

glGenTextures(1, irradianceMap, 0)
glBindTexture(GL_TEXTURE_CUBE_MAP, irradianceMap[0])
glTexParameteri(GL_TEXTURE_CUBE_MAP, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE)
glTexParameteri(GL_TEXTURE_CUBE_MAP, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE)
glTexParameteri(GL_TEXTURE_CUBE_MAP, GL_TEXTURE_WRAP_R, GL_CLAMP_TO_EDGE)
glTexParameteri(GL_TEXTURE_CUBE_MAP, GL_TEXTURE_MAG_FILTER, GL_LINEAR)
glTexParameteri(GL_TEXTURE_CUBE_MAP, GL_TEXTURE_MIN_FILTER, GL_LINEAR)
glTexStorage2D(GL_TEXTURE_CUBE_MAP, 1, GL_RGBA16F, size, size)
glBindImageTexture(1, irradianceMap[0], 0, true, 0, GL_WRITE_ONLY, GL_RGBA16F)

// Dispatch compute
glUseProgram(irradianceShaderProgram)

val imageSizeLoc = glGetUniformLocation(irradianceShaderProgram, "u_imageSize")
glUniform1f(imageSizeLoc, size.toFloat())

glActiveTexture(GL_TEXTURE0 + 0)
glBindTexture(GL_TEXTURE_CUBE_MAP, environmentMap[0])

glDispatchCompute(size / 4, size / 4, 1)
glMemoryBarrier(GL_SHADER_IMAGE_ACCESS_BARRIER_BIT)
 
If you need more details or resources such as an .apk file or RenderDoc captures for broken and working versions, I can provide those.
 
Edit:
Looking at the RenderDoc captures again, it seems that the creation of `environmentMap` (the cubemap for the skybox) results in a black texture.
 
This is a minimalistic example (with large step sizes), in which on a Mali device I will get a fully red skybox, whereas on the Adreno device it'll be all black:
 
Compute shader ("toCubemapShaderProgram"): 
#version 320 es

layout (local_size_x = 4, local_size_y = 4, local_size_z = 6) in;

layout (rgba16f, binding = 1) writeonly uniform highp image2DArray u_target;

void main() {
    imageStore(u_target, ivec3(gl_GlobalInvocationID.xyz), vec4(1.0, 0.0, 0.0, 1.0))
}
 
OpenGL setup (size == 512):
val size = environmentMapSize
val maxMipLevel = log2(size.toFloat()).toInt()

glGenTextures(1, environmentMap, 0)
glBindTexture(GL_TEXTURE_CUBE_MAP, environmentMap[0])
glTexStorage2D(GL_TEXTURE_CUBE_MAP, maxMipLevel + 1, GL_RGBA16F, size, size)
glBindImageTexture(1, environmentMap[0], 0, true, 0, GL_WRITE_ONLY, GL_RGBA16F)

glUseProgram(toCubemapShaderProgram)

glDispatchCompute(size / 4, size / 4, 1)
glMemoryBarrier(GL_SHADER_IMAGE_ACCESS_BARRIER_BIT)

glGenerateMipmap(GL_TEXTURE_CUBE_MAP)

 

Result Mali:

 

Result Adreno:

 

Edit: it seems images won't be shown unfortunately

  • Up0
  • Down0

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.