Failed to create 4096x4096 texture on Mali-400. The app crashes. What can be wrong?
What do you mean by "crash"? If a segfault do you have a backtrace?
The obvious point to check is whether your device is running out of memory - 4kx4k textures can be quite memory intensive (64MB for RGBA8 uncompressed texture).
Cheers, Pete
Hi,
I do not have a backtrace as the mali ddk is provided as a third party library. The application terminates. I cannot debug that part. I can just debug the mali linux kernel part (drivers/gpu/arm/mali).
We have 128 MB for Graphics memory. This should be enough for this rendering. I also found that textures of size
upto 4096x3000 is rendered, but as soon as I cross height > 3000 the OpenGL App terminates.
It's still not clear what your error actually is. If the application exits cleanly with no segfault or kernel low memory killer kicking in, that sounds like a memory allocation failure (either in the application itself, or the application exiting because of an GL error returned by the OpenGL ES driver).
Also be aware that there are implementation limits defined for certain features. Did you check the texture dimension limit for that platform ?
I checked that the GL_MAX_TEXTURE_SIZE is 4096 on the platform.
And I see that the __mali_ukk_mem_mmap() in Linux Kernel part has a failure (memory allocation is partial, mali allocationengine fails to allocate full memory). I increased graphic driver memory to 512MB & tested. even then the same error. I guess the user space part of ARM Mali DDK has got some upper limit. However I cannot debug that as that is provided as a 3rd party library.
also our requirement is 3888x3888. From experiments we found that there is a 12 Mega pixels limit put by
ARM Mali. I do not know where this limit is applied. If we cross 12Mega pixel size, the App crashes without any
trace ..it just gets killed.
Hi somabha,
Could you give us more detail?
For example, what device(s) does this affect? What OS and what version? What version of Mali?
Can you also check to make sure that you update the OS accordingly. If this is a bug in our driver, it is likely it would have been fixed and an OTA update may contain this fix.
But without knowing more, it is hard to say if this is an issue or not, and what the issue may be.
In short, a reproducer is required for us to investigate further. Without being able to reproduce this, we can only guess and advise as best we can.
Kind Regards,
Michael McGeagh
Hi Michael,
I am unable to share device/driver details. However I tried to modify the ARM Mali Linux driver to allocate more memory. Originally the frame buffer size was 16 MB in mali/platform/arm.c & I increased to 128 MB. Now the behavior has changed. The Application now pauses for a very long time at the gltexImage2D() call & then the App is terminated with following message "....Partial allocation..memory allocation failed...could not allocate 64 MB"
I guess there is some limit on the memory allocation in OpenGL driver. Or User space OpenGL driver (the version I have) cannot handle large texture size.
Regards,
Somabha
Mali can render to any memory as long as it can be mapped, which either happens through a DMAbuf handle, UMP handle, or specially mapped memory.
Mali allocates memory through the kernel device driver, which will then (usually) use the OS allocator to acquire memory, so your limitation may be with your OS's memory allocator, not the Mali driver.
Without knowing more about the device, unfortunately I cannot give you more information and advice than this.
This problem has been resolved.
The issue was memory allocation. I found that in case of shared memory, the memory allocation for GPU fails because of out of memory. However if I choose dedicated memory for GPU, then the loading of 4Kx4K texture becomes possible.