filament icon indicating copy to clipboard operation
filament copied to clipboard

Mali vs Adreno

Open mbalajee opened this issue 1 year ago • 4 comments

⚠️ Issues not using this template will be systematically closed.

Describe the bug High end devices (Samsung S22 ultra) fails (app crashes) to load a larger model (over 10K renderables) with the below error, (100s of these in logcat)

 Adreno-GSL              com.google.android.filament.gltf     W  <sharedmem_gpuobj_alloc:2736>: sharedmem_gpumem_alloc: mmap failed errno 12 Out of memory
 Adreno-GSL              com.google.android.filament.gltf     E  <gsl_memory_alloc_pure:2604>: GSL MEM ERROR: kgsl_sharedmem_alloc ioctl failed.
 Adreno-GSL              com.google.android.filament.gltf     W  <sharedmem_gpuobj_alloc:2736>: sharedmem_gpumem_alloc: mmap failed errno 12 Out of memory
 Adreno-GSL              com.google.android.filament.gltf     E  <gsl_memory_alloc_pure:2604>: GSL MEM ERROR: kgsl_sharedmem_alloc ioctl failed.

Loading the same model on even low end devices with Mali GPUs doesn't crash with OOM. This is from Samsung S6 Lite 2018 which loads even larger models just fine but high end devices like S22 Ultra fails with above error.

[ARM], [Mali-G72], [OpenGL ES 3.2 v1.r38p1-01bet0-mbs2v41_0.b9e42ffa6bf354232ad5ee190bbadf16], [OpenGL ES GLSL ES 3.20]

This is affecting our release since most of our customers are Samsung users with Adreno GPU. Any suggestions or help here?

mbalajee avatar Aug 09 '24 17:08 mbalajee

Looks like another driver bug. I have loaded 10K+ models on Pixel 4. Haven't tried S22. You could try our Vulkan backend, see if it helps.

pixelflinger avatar Aug 11 '24 07:08 pixelflinger

Vulkan backend renders the model but the model is almost unusable in Adreno GPUs. On Mali devices (such as Samsung S6 Lite), using Vulkan degrades the gesture (zoom, pan, orbit) performance. OpenGL backend on Mali devices provides better performance overall. I will try to create a sample model in a size similar to the one I have (can't share the actual model)

mbalajee avatar Aug 12 '24 05:08 mbalajee

@pixelflinger Not sure if this will help, but I found that Adreno-630 (OnePlus 6T) performs better (there was not initial lag after model is fully rendered) than Adreno-730 (Samsung S22 Ultra)

mbalajee avatar Aug 15 '24 17:08 mbalajee

We had issues with some Samsungs with Adreno that had an internal limit of 512 shaders max, but this was with OpenGL, not Vulkan. We worked around it by creating and destroying shaders per frame to stay in the 512 limit. As you can imagine, there were frequent freezes due to this. I'm not sure it's the case here though.

jeanlemotan avatar Sep 27 '24 16:09 jeanlemotan