New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Arm Mali/OpenCL - OpenCL error CL_OUT_OF_RESOURCES #13108
Comments
You're too quickly jumping to the conclusion. You can't expect that the device has an infinite memory. Is there any other reason you think this case is a bug ? |
Well, I believe, that a bug in specific combination of hardware/vendor driver and OpenCV/OpenCL (maybe even worse - graphic system, which is X11 and arm64 architecture/or kernel 4.4). While result may be correct, fallback from hardware implementation(CL/GPU) to software implementation(CPU or CL over CPU) in case, if GPU hardware able to work with such kernels/algorithms - it's bug. Proposed solution to decrease a maximum size of Creating this ticket, I am trying to evaluate (by receive some feedback from people, who get similar errors on arm/mali/opencl), how many issues can be solve with such solution (my expectation is about 5%, may be even less. looks like for more flexible Nvidia GPU it works much better). I am continue to evaluate, how many CL kernels have issues on that particular hardware, so will update this ticket, probably for a long time :) PS: can't assign ticket to myself (I don't won't to disturb core dev's with that issue) |
FYI, if you run entire opencv test suite, you'll get more than thousand lines of
Firefly RK3399 has Mali T860. Just for curiosity, how much memory does your Mali has ? |
number of While my issues happens on RK3399/T860/4 too, with driver/CV version from above, without yours detailed information about driver/window system/OS + OpenCV version, information from your |
I'm not following the situation. It passed on my firefly BTW, my Firefly has
Now your explanation is getting uncertain. Are you talking about specific test failure ? or are you just talking about printed log |
…on of opencv#13108 - OpenCL error CL_OUT_OF_RESOURCES issue
sorry for delay - just return to RK3399 board ;) start test with
from my board: Max memory allocation size = 493 MB 19 KB. in your logs it's a 494 MB 34 KB |
removing duplicate error messages(multiply call of FFT, for example) from
for (default/2) 128
so, looks like solution to decrease size of working group is working and useful, but required additional testing |
:( |
So it's not a specific test failure, since it's appear in different algorithms, like Issue, which can not be fixed by proposed reducing WGSize(nesting loops), required more complicated evaluation/fixes, like rewriting OpenCL kernel and/or change data flow in C++ code. BTW, my board if NanoPI M4 with Ubuntu 18.04/arm64 and slightly new driver, than yours. I will install a Ubuntu 16.04/arm32 to have more comparable results. Also I am trying to build OpenCV with OpenCL for ARM Bifrost(Mali G71) for android to make some test too. |
BTW, There is one place in OpenCL with "dynamic" adjusting of OpenCL group size / kernel re-compilation for selected group size: filter2D implementation. |
Thank you for this info - it can very helpful in future. At present moment my idea is to detect a ARM Mali during initialization of CL device, and decrease a WorgGroup Size only for algorithms, where it may help (like And need a lot of test before decide which solution is better. |
some updates:
|
…Mali-Gxx/Bifrost(all OK) opencv#13108
finally, I get stability from my board and can return to this issue.
full table
I am evaluating every method from above on target hardware(with some successful fixes already) an will update with results soon. |
Thank you for your evaluation on this topic. |
Are these Sorry for the very late answer, but I just ran into this today and this thread came up in my searching. Hat tip to Pragmataraxia at this link who solved it: https://forums.developer.nvidia.com/t/what-else-causes-cl-out-of-resources/11426/2 |
_update: this bug is specific to Mali Midgard(T8xx\T7xx\T6xx) GPU only. More resent Mali Bifrost(Gxx) series not affected
System information (version)
Detailed description
It is specific bug to arm\mali hardware in OpenCL, which related to limited resources on this mobile device.
OpenCL error CL_OUT_OF_RESOURCES (-5) during call: clEnqueueNDRangeKernel('stage1_with_sobel', dims=2, globalsize=4096x4096x1, localsize=32x8x1) sync=false
reducing
maxWorkGoupSize_
value ofcl::Device
from default256
to128
(to give more resources to kernel) remove that particular bug incv::GausianBlur
with size3x3
(and may be many more), but bigger parameters, like size '5x5' or other kernel, like described in #11503 issue, still lead toCL_OUT_OF_RESOURCES
I am continue to evaluate another CL-acceletared methods on Arm Mali-t860 to figure out another reasons of
CL_OUT_OF_RESOURCES
.Steps to reproduce
The text was updated successfully, but these errors were encountered: