# How to confirm whether BrainFrame is running an algorithm on HDDL Hardware

**URL:** <https://forum.aotu.ai/t/how-to-confirm-whether-brainframe-is-running-an-algorithm-on-hddl-hardware/169>\
**Category:** Questions\
**Created:** [April 13, 2021, 12:35am UTC](https://forum.aotu.ai/t/how-to-confirm-whether-brainframe-is-running-an-algorithm-on-hddl-hardware/169 "2021-04-13T00:35:00Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![alex.thiel](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.aotu.ai/alex.thiel/32/48_2.png) [@alex.thiel](https://forum.aotu.ai/u/alex.thiel)\
**Post date:** [April 13, 2021, 12:35am UTC](https://forum.aotu.ai/t/how-to-confirm-whether-brainframe-is-running-an-algorithm-on-hddl-hardware/169/1 "2021-04-13T00:35:00Z")

</div>

The purpose of this post is to explain in-depth how BrainFrame tries to load OpenVINO capsules.

# Short Answer:

Check the BrainFrame logs for an error of the following format ([link to source code](https://github.com/opencv/open_vision_capsules/blob/master/vcap_utils/vcap_utils/backends/base_openvino.py#L72)):

```auto
Failed to load {BACKEND CLASS NAME} onto device MULTI:CPU,HDDL. 
Error: {OPENVINO ERROR}. Trying again with device_name='CPU'

```

To get BrainFrame logs, you can run `brainframe compose logs -f core`. You can also filter the logs by running:

```auto
brainframe compose logs -f core | grep Failed

```

* * *

# Long Answer:

1. BrainFrame initially loads a capsule and checks what devices the capsule supports. Capsules specify the logic for device loading by implementing a `device_mapper`. [Take this line of our open source face detector](https://github.com/aotuai/capsule-zoo/blob/vcap-v0.2/capsules/detector_face_openvino/capsule.py#L15)

2. The function `DeviceMapper.map_to_openvino_devices()` is calling [the following open-source code from the VisionCapsules library, vcap](https://github.com/opencv/open_vision_capsules/blob/master/vcap/vcap/device_mapping.py#L80)

3. This code initially checks for an environment variable called `OPENVINO_DEVICE_PRIORITY` to see how it should prioritize openvino devices. By default, it loads onto the following device name: `MULTI:CPU,HDDL`. That means it gives CPU priority, and will also load onto HDDL as secondary priority.

To edit how BrainFrame loads onto OpenVINO devices, create a `.env` file at  
`/usr/local/share/brainframe/.env`

```auto
OPENVINO_DEVICE_PRIORITY="HDDL,CPU"

```

In the above line, we give priority to HDDL devices over CPU.

* * *

# Debugging HDDL Issues

If you are getting the `Failed to load` error, this can happen because the HDDL drivers are not available on the host computer. Unfortunately, to run HDDL in docker, the drivers must be installed on the host. To do this, install OpenVINO on the host computer, and run the following lines:

```auto
echo "export HDDL_INSTALL_DIR=/opt/intel/openvino/deployment_tools/inference_engine/external/hddl/" >> ~/.bashrc
echo "source /opt/intel/openvino/bin/setupvars.sh" >> ~/.bashrc

# Restart terminal
cd $HDDL_INSTALL_DIR
bash install_IVAD_VPU_dependencies.sh
cd ${HDDL_INSTALL_DIR}/drivers
sudo bash setup.sh install

```
