# Opencl cannot find devices

Source: https://forum.modalai.com/topic/1960/opencl-cannot-find-devices
Category: VOXL 2 and VOXL 2 Mini (https://forum.modalai.com/category/26/voxl-2-and-voxl-2-mini)
Tags: voxl-2
Posted: 2023-03-17 14:10:48 UTC by DanielHviid
Replies: 4 · Views: 1370

## DanielHviid · 2023-03-17 14:10:48 UTC

I'm trying to use transparent API on opencv to to enable hardware acceleration, but there is no GPU utilization. Both from opencv and from clinfo, it informs me that there are no devices available.
Am I missing a driver, or is this not available yet?

## Reply by Chad Sweet (ModalAI staff) · 2023-03-29 00:11:04 UTC

Hi Daniel, OpenCL should definitely be there. voxl-tflite-server uses GPU acceleration with TensorFlow Lite. We will have to look into an example to enable this. I did double check that /usr/lib/libOpenCL.so is present, so you should be able to make progress.

[Here](https://storage.googleapis.com/modalai_public/temp/hellocl.zip) is a simple test to check for OpenCL. I don't have a VOXL 2 nearby but this might help with the basics

## Reply by DanielHviid · 2023-03-29 12:52:06 UTC

Hi Chad, I have confirmed that OpenCL is present and that the code compiles on emulator and natively, and runs on our voxl2.

The voxl-cross docker image does not contain /usr/lib/libOpenCL.so, and our opencv application, which is based on voxl-cross-template. We have tried to build it in the emulator, or on target, but we are unable to apt install dependencies like voxl-opencv in the emulator, and natively their .so files are reported as the wrong file format by cmake.

Are there plans to include OpenCL in the voxl-cross image, or would it be better for us to rebuild the application/libraries to work with the emulator?

## Reply by Chad Sweet (ModalAI staff) · 2023-03-29 17:34:19 UTC

That's good feedback. We will add including the OpenCL libs to voxl-cross to our TO DO list.

In the meantime, can you just copy the opencl libs into your voxl-cross workspace? (which is what we would do for the next rev of voxl-cross)

## Reply by DanielHviid · 2023-03-30 07:40:43 UTC

I tried adding the .so file to the hellocl example, and got the following error:

```
/usr/lib/gcc-cross/aarch64-linux-gnu/7/../../../../aarch64-linux-gnu/bin/ld: warning: libcutils.so.0, needed by /usr/lib/../lib/libOpenCL.so, not found (try using -rpath or -rpath-link)
/usr/lib/../lib/libOpenCL.so: undefined reference to `property_get'
```
and when adding it to our OpenCV application, OpenCV still cannot find any OpenCL devices. I suspect OpenCV needs to be recompiled with the .so file in the docker image.

This issue is not immediately pressing, so if you intend to update the voxl-cross image I can wait for that instead of trying to create a fix.
