filament icon indicating copy to clipboard operation
filament copied to clipboard

Android - Adreno - Model not responding initially for few seconds

Open mbalajee opened this issue 1 year ago • 5 comments

When loading a glb model (~6.5K entites) there's an initial lag for ~10 seconds before the model responds to touch events. This happens only on Adreno GPUs, even on the recent top end device (tested on OnePlus Open / S23 Ultra / S23+).

Since the lag is closer to 10 seconds, users exit the screen thinking that app is not responding. Is there a workaround for this? Currently we set the zoom level to -1 which takes the camera closer to the model so frustum culling helps there - the lag is lesser but still long enough to think that app is frozen

To Reproduce Steps to reproduce the behavior:

  1. Load a larger model in any adreno device
  2. Observe model is not responding for ~10 seconds
  3. After the initial lag, model responds to touch events without a lag

Screenshots Here is the recording of sample-gltf-viewer app running on S23, https://drive.google.com/file/d/1JKu4lqXT_lMD2UpiTx3as6v2LmB3hXBM/view?usp=sharing

Logs I see the panic log, but it appears on Mali devices too which don't have this initial lag issue,

in HandleBase::HandleId filament::backend::HandleAllocator<32, 64, 136>::allocateHandleSlow(size_t) [P0 = 32, P1 = 64, P2 = 136]:128

Smartphone (please complete the following information): Samsung S23 FE / Android 15

Additional context Tested on recent commit

mbalajee avatar Sep 13 '24 04:09 mbalajee

I would have to look into it with systrace. can you share your glb model with us? If not publicly could you share it privately?

pixelflinger avatar Sep 16 '24 21:09 pixelflinger

Is this different from #8028 ?

pixelflinger avatar Sep 16 '24 21:09 pixelflinger

Is this different from #8028 ?

It may be related. In 8028, larger models (like 10K+) don't even load on Adreno devices but they load just fine on Mali. In this issue, relatively smaller models (7K) render on Adreno but not responsive for the ~10 seconds. After that interaction becomes a lot smoother (no lag at all). This initial lag issue happens very consistently.

Shared the google drive link privately with you

mbalajee avatar Sep 16 '24 23:09 mbalajee

Is this different from #8028 ?

It may be related. In 8028, larger models (like 10K+) don't even load on Adreno devices but they load just fine on Mali. In this issue, relatively smaller models (7K) render on Adreno but not responsive for the ~10 seconds. After that interaction becomes a lot smoother (no lag at all). This initial lag issue happens very consistently.

Shared the google drive link privately with you

mh, it might have something to do with the parallel shader compilation maybe. I wonder why it would behave so differently on Adreno. I would need to look at this with systrace, if I can reproduce it.

pixelflinger avatar Sep 17 '24 17:09 pixelflinger

We had issues in our engine with some Mali drivers (G76) behaving like there is a mutex in the driver when compiling shaders so we had to implement a multiprocess solution for this. Not for Adreno though.

jeanlemotan avatar Sep 27 '24 16:09 jeanlemotan