-
Notifications
You must be signed in to change notification settings - Fork 80
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
OpenCL for OpenCV on Pi #29
Comments
Being able to run OpenCV is one of the goals of this project. But at this stage is is neither tested nor expected to work. |
will you announce here once VC4CL is compatible with OpenCV?
…On Thu, Apr 12, 2018, 6:13 AM doe300 ***@***.***> wrote:
Being able to run OpenCV is one of the goals of this project. But at this
stage is is neither tested nor expected to work.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#29 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AZX8mNItkjhmfWvfeYKGc1hCBsRLxRjtks5tnzbBgaJpZM4TNdeX>
.
|
its a shame, it seems the GPU will help the maker comunity alot but no results so far anywhere. Damm Nvidia taking all the AI, i purchase the Movidious stick while i wait for this to happen, let see how it goes once i get it. |
What about Caffe? Caffe is currently the only deep learning library to properly support OpenCL 1.2. If this can be made to work with Caffe, itll really be very powerful for AI work |
OpenCL-enabled OpenCV is located in my Github; I'm testing original test cases provided by OpenCV; There are 16,182 tests from 132 test cases. |
That sounds promising. For the failed tests, how good are the outputs? Are they any good to debug issues in VC4CL? |
Fantastic Thor! My goal is to run OpenCV on Pi against the GPU, while also
running a small YOLO model against the Pi CPU (NNPack).
This way I can spread the load, so that video processing and NN do not
compete for the same processor.
Do you think this is possible with your release?
…On Sun, Jul 22, 2018 at 12:19 AM, Thor Watanabe ***@***.***> wrote:
OpenCL-enabled OpenCV is located in my Github;
https://github.com/thortex/rpi3-opencv/
https://github.com/thortex/rpi3-opencv/releases/tag/v3.4.2-opencl
I'm testing original test cases provided by OpenCV;
https://github.com/thortex/rpi3-vc4cl/
https://github.com/thortex/rpi3-vc4cl/releases
https://github.com/thortex/rpi3-vc4cl/tree/master/test/opencv
There are 16,182 tests from 132 test cases.
I've run 2,865 test, got 1,555 NGs, and 1,308 OKs.
opencv-opencl-test.zip
<https://github.com/doe300/VC4CL/files/2216741/opencv-opencl-test.zip>
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#29 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AZX8mG9GUdClA33c6z3kjXICNUGNpEG-ks5uJAt5gaJpZM4TNdeX>
.
|
I attached OpenCL Arithmetic test result of OpenCV 3.4.2 above. Warning/Error summary is listed below:
If VC4CL supports clGetProgramInfo(), it's good to execute OpenCL tests for shortening processing time. |
Hi spinoza1791 , I think it won't work yet. |
Thanks @thortex for testing this and the logs. A few quick comments on the log:
|
Thanks @doe300, I checked the following fails:
And I found failure patterns:
an example result of unsigned 8-bit data type matrix Add operation is:
The expected result is:
I don't know why, but VC4CL returns 0xFF for all result of operation. |
That's some interesting results, I will have to look into it. 64-bit floating point test cannot pass, it is probably just skipped. |
I attached mini.zip (including six test results for matrix add arithmetic operation).
It's 65535 (0xFFFF) described in line #722 of mini.log. mini-debug.log includes VC4CL debugging outputs. |
I found and fixed a bug in conversion with saturation and the failing tests now succeed. |
Thanks doe300!!! I'll also check other tests with bedb33c8d6241bab60e9ca3954b20faf8fbf7af3. |
So does this mean that its possible to run some OpenCV functions with OpenCL accelerations? |
@doe300 and @thortex , is it feasible results could be slower? I've been using the opencv_perf_imgproc for comparisons when looking at 32bit pi vs 64bit pi, so I thought I'd fire this up again with opencl using the work here (which is really great + interesting - thanks alot). I took opencv from @thortex repo, and then rebuilt so I got the perf binaries (on latest raspbian 32bit OS). There's a few crashes but on the test subsets that run OK, so far I see some times coming in similar, but some quite alot (e.g. factor of 10) slower. |
Yes it is possible. As mentioned in various other posts, memory access (esp. write access) is a bottleneck. Although there are some optimizations left to be done. |
If I may ask, what is the current status of opencv support? Do most operations work? Has anyone tried it with the DNN module? I've got MobileNetV2 running with ~.2 sec inference time using optimized cpu based opencv. I would be interested to see if it could go faster using the GPU. |
I don't have any progress testing OpenCV. The problem is that it is hard to test and not very suitable for debugging issues with wrongly generated code. |
@spinoza1791 @doe300 I've successfully compiled Latest OpenCV(4.0.1 - dev) with VC4CL OpenCL with no whatsoever compilation error. I have included VC4CL OpenCL during OpenCV compilation and also with FFmpeg build. I'll update here with benchmark results. |
Great! Looking forward to seeing benchmarks for Pi!
…On Mon, Feb 4, 2019 at 11:40 PM Abhishek Thakur ***@***.***> wrote:
@spinoza1791 <https://github.com/spinoza1791> @doe300
<https://github.com/doe300> I've successfully compiled Latest
OpenCV(4.0.1 - dev) with VC4CL OpenCL with no whatsoever compilation error.
I have included VC4CL OpenCL during OpenCV compilation and also with FFmpeg
build. I'll update here with benchmark results.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#29 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AZX8mEaaU9ERGb8z0yOw0uEq-t0sY5nnks5vKRlGgaJpZM4TNdeX>
.
|
Perfect. U da man!
…On Tue, Feb 5, 2019 at 4:19 PM Thor Watanabe ***@***.***> wrote:
Also updated: https://github.com/thortex/rpi3-opencv/releases/tag/v4.0.1
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#29 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AZX8mCl39HxjodW3MRTl8-ajVzzLlyM9ks5vKgNtgaJpZM4TNdeX>
.
|
@thortex Looking at your build script, I think you're using OpenCV's inbuilt OpenCL module, not one provided by this repo. Check your |
@abhiTronix I used the dynamic load feature of OpenCV. |
I successfully installed your OpenCL version of OpenCV on Pi 3B+ via https://github.com/thortex/rpi3-opencv/releases/tag/v4.0.1. What else is needed to install VC4CL and test? |
@thortex I'm referring to the script on your GitHub repo. OpenCV prioritizes inbuilt libraries over System Libraries, so they have to be manually linked with OpenCV to make them work. VC4CL can't be dynamically linked with OpenCV directly unless path specified/linked at runtime. |
@abhiTronix, thanks for your reviewing. |
Thanks for the updates to your repo - I compiled and tried to execute the performance test. Without running as sudo it won't run the opencl extensions which is a handy way to test the difference for me. Anyway, with sudo, I noticed first few tests of the perf_imgproc run go OK, but then I start getting these kernel messages, and the process seems to hang. I'm not pushing for a solution, just incase the info helps anyones work/findings. [37353.721913] INFO: task kworker/0:2:1865 blocked for more than 120 seconds. |
@vb216, VC4CL and OpenCL-enabled OpenCV are still under development, and OpenCV performance tests would be fail. |
did you manage to install it and run yolo? |
@abhiTronix, |
Here are tiny-yolo v3 with 1440p Images benchmarks. We can clearly see an almost 1.5x performance boost with Latest OpenCL+TBB Enabled OpenCV binaries over TBB enabled OpenCV Binaries only. A detailed Benchmark will be updated soon.
I don't remember exactly but I used default flags as mentioned in the @thortex repo. |
What are the hardware specs here? Intel? |
@spinoza1791, this library only works with raspberry pi. But since you asked its Raspberry Pi 3 Model B rev 1.2. |
Which darknet repo are you using? AlexeyAB? |
I'm using default pre-built binaries available at their official website. |
Has anyone been able to run OpenCV on the Pi GPU using OpenCL? Is there an example somewhere demonstrating accessing the GPU with OpenCV using OpenCL?
The text was updated successfully, but these errors were encountered: