Hi,
I'm working an an Android image processing app which uses OpenCL on Mali GPU.
I have a problem where I get a random seg faults on clEnqueueUnmapMemObject or a following clReleaseMemObject
The program just seg faults and I can't catch any of the OpenCL error codes for these operations anyway.
This bug happens randomly but I noticed it has a preference to happen on a certain image size.
The app works fine with sizes larger than and smaller than that size.
I think it has something to do with how it is distributed in the memory like certain buffer sizes might be close to a memory page edge or something.
And then it's is badly handled there.
Or maybe there are memory drifts and my mapped pointers become invalid after some time or as a result of a memory page change.
I'm not really sure about any of this I'm just throwing out some ideas which I had.
I always map my buffers before processing on the CPU and unmap them before processing on the GPU.
Any insight on my problem will be appreciated.
You can check dmesg to see if mali_kbase reports any illegal memory accesses.
For us to be able to reproduce the issue we need a sequence of commands to run on the device which will trigger the crash, something like:
while(1)
{ buf = clCreateBuffer()
mapping = clMapBuffer()
clUnmapBuffer(buf, mapping)
etc.
}
We already have some unit tests which cover all basic mapping operations and they pass on these devices, so if the problem comes from the driver there must be a special sequence of commands you do which triggers the issue that we don't cover in our tests.
Thanks,
Anthony