CPU usage is too high

I hope this email finds you well. I am currently encountering an issue with the Hailo module. Specifically, when running the example provided at link, it appears that the CPU usage is excessively high.

As I am aiming to utilize the AI functionality provided by the Hailo module without relying heavily on the CPU, I am seeking guidance on how to address this concern. Could you please provide assistance or suggest any alternative approaches to mitigate the high CPU usage while running the Hailo module?

Hi @minh.vo,

To check for a breakdown of the CPU utilization when running the example, you can do the following:
Install FlameGraph:

sudo apt install -y linux-tools-$(uname -r) linux-tools-common
git clone https://github.com/brendangregg/FlameGraph

Compile your app and export the FlageGraph to a SVG file:

sudo time perf record -g -o perf_with_stack.data YOUR-APP
sudo perf script -f -i perf_with_stack.data | FlameGraph/stackcollapse-perf.pl | FlameGraph/flamegraph.pl > flamegraph.svg

Where “YOUR-APP” is the full command you are running to run your app including the command line arguments

The result is a an SVG that can be viewed on a web browser, and it shows the breakdown of the call-graph.


1 Like

This is what the output SVG would look like:

You can drill down to each function\action and see the usage of the CPU it takes.