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

Huge memory leak when drawing shapes on surface textures on Mali G68/G72/G77 Android 12+

Hello dear community!

I have faced enormous memory allocation (1GB per second) and application crash when drawing surface paths on terrain textures in my 3D GIS engine on Mali GPUs since Android 12.

Here you can find a code in methods drawShapesToTexture and drawTextureToTerrain https://github.com/WorldWindEarth/WorldWindKotlin/blob/develop/worldwind/src/commonMain/kotlin/earth/worldwind/draw/DrawableSurfaceShape.kt

This issue is available only on Mali GPU and only starting from Android 12+

Affected and tested devices are:

Galaxy Tab Active3 Mali G72 Android 13

Galaxy A53 Mali G68 Android 13

Galaxy S20 Mali G77 Android 12

Devices which works ok:

Galaxy Note 9 Mali G72 Android 10 (the same GPU as in the affected list above)

Any Adreno, PowerVR or other GPU equipped device.

It seems that new driver allocates copy of texture memory each time I bind frame buffer and use color attachment to draw lines in terrain texture. Drawing terrain textures without shapes works ok.

To reproduce an issue you can build a project using link above and run worldwind-examples application MGRSGraticuleActivity and just zoom map.

It is required only 2 seconds to overflow 2 GB of VRAM and crash the application.

Could you please assist is it a driver bug or what was conceptually changed?

Why the same code works on all other GPUs and worked already 4 years before on many devices, but now started providing OOM errors on modern Mali equipped devices?

Thanks.

Parents
  • After long investigation with the help of ARM team we found a bug in memory allocator in Mali drivers 32-38, possibly fixed in 44.

    Bug in memory allocator is somehow related with AFBC compression.

    Workaround which helps to solve an issue is to add additional glTexImage2d call with size 1x1 pixels before normal texture load for all render target textures, which disables AFBC compression to this texture.

Reply
  • After long investigation with the help of ARM team we found a bug in memory allocator in Mali drivers 32-38, possibly fixed in 44.

    Bug in memory allocator is somehow related with AFBC compression.

    Workaround which helps to solve an issue is to add additional glTexImage2d call with size 1x1 pixels before normal texture load for all render target textures, which disables AFBC compression to this texture.

Children
No data