Posts: 1
Joined: Fri Sep 21, 2018 9:54 am

Testing VC4CL with OpenCV

Fri Sep 21, 2018 10:05 am

I recently installed VC4CL as instructed from the Github repo's on my RPI3B running Raspbian Stretch and everything installed just fine.
I then installed OpenCV with OpenCL enables and that worked fine as well.
I then tried to run a Python script (with 'sudo') that uses OpenCV's detectMultiScale Haar Cascade Classifier which worked as expected, but with no speedup compared to not having VC4CL installed. The CPU was still being used. I've seen the source code so I know that the function has an OpenCL implementation.
Does anyone have any pointers on where to start debugging this? The code isn't throwing any errors or anything, just seems to skip using OpenCL altogether.
Any help would be greatly appreciated.

Posts: 43
Joined: Thu Dec 29, 2016 1:41 pm

Re: Testing VC4CL with OpenCV

Sun Oct 21, 2018 8:17 am

The very first thing to try would be to check whether the OpenCL installation is recognized at all.
For that you can install and run the program clinfo. If it does not find the VC4CL implementation, you may need to add it to your library path (see here).
For VC4CL to be correctly read by clinfo you will need to use the clinfo version from the repository, since the package version has a bug. Also you will need to run it as root, but it will say so once VC4CL is recognized.

If this check lists VC4CL as an OpenCL implementation and it still seems to not be used, then it gets tricky. Maybe OpenCV has a way of a) forcing OpenCL to be used and b) specifying the device number (as queried by clinfo) to be used.

Return to “Graphics programming”

Who is online

Users browsing this forum: No registered users and 2 guests