Forums - Hexagon delegate on RB5

10 posts / 0 new
Last post
Hexagon delegate on RB5
SoDa
Join Date: 22 Nov 19
Posts: 5
Posted: Fri, 2021-06-25 23:58

Hello,

I've tried to run a tflite model with hexagon delegate on Qualcomm RB5. But I am getting the following errors:

INFO: Initialized TensorFlow Lite runtime.

WARNING: Failed to fetch Hexagon NN version. This might be because you're using incompatible versions of libhexagon_interface and libhexagon_nn_skel. You must use compatible versions. Refer to Tensorflow Lite Hexagon Delegate Guide.
WARNING: Incompatible versions between interface library and libhexagon_skel 136961 vs -1. You must use compatible versions. Refer to Tensorflow Lite Hexagon Delegate Guide.
INFO: Created TensorFlow Lite delegate for Hexagon.
INFO: Hexagon delegate: 31 nodes delegated out of 31 nodes.
 
INFO: Replacing 31 node(s) with delegate (TfLiteHexagonDelegate) node, yielding 1 partitions.
ERROR: hexagon_nn_config failed. Error: 44
ERROR: Hexagon Kernel was not initialized
ERROR: Node number 31 (TfLiteHexagonDelegate) failed to prepare.
 
ERROR: Restored previous execution plan after delegate application failure.
Segmentation fault
 
Appartenly, there is a compatibilty issue between libhexagon_interface and libhexagon_nn_skel, but there is no way to find out what are the required versions for Hexagon delegate.
It's worth to mention that the libhexagon_nn_skel provided with the OS in "/usr/lib/rfsa/adsp/" directory is incompatible , so I've used libraries provided by the follwoing github repo:
Also, I am using the most updated OS edition:   QRB5165.UBUN.1.0.0.0.009.1_r003005
TFlite Version: r2.6
 
Please let me know how this issue can be resolved, it would be great if you can provide working example.
 
Thank you so much for your time,
 
  • Up0
  • Down0
kevin.dai
Join Date: 21 Oct 20
Posts: 137
Posted: Tue, 2021-06-29 12:15

Here is commrent from our ML engineer:

Failed to fetch Hexagon NN version. This might be because you're using incompatible versions of libhexagon_interface and libhexagon_nn_skel. You must use compatible versions. Refer to Tensorflow Lite Hexagon Delegate Guide.

Thanks

Kevin

  • Up0
  • Down0
kpoliset
Join Date: 28 Aug 19
Posts: 8
Posted: Wed, 2021-06-30 14:05

Hi SoDa,

I see that you are trying to run a TFLite app on the Hexagon dsp. If you are trying to get started with using Hexagon dsp on RB5, we have a working sample app here : https://github.com/quic/sample-apps-for-Qualcomm-Robotics-RB5-platform/tree/master/HexgonSDK-Image-classification, that runs a Tensorflow model on dsp. 

Can you please execute this app and let us know the result, so we know if the problem is from Hexagon or the TFLite model?

Thank you

  • Up0
  • Down0
SoDa
Join Date: 22 Nov 19
Posts: 5
Posted: Wed, 2021-06-30 21:59

Hi,

Thank you for the reply! unfortunately the provided sample didn't work as well. 

I've got an error in step 1 when I was trying to retrieve the serial number;

./getserial: /usr/lib/libadsprpc.so: no version information available (required by ./getserial)

Could not retrieve serial num
 
so I fixed this problem by using the following command and then convert it to hexadecimal value:
 
cat /sys/bus/soc/devices/soc0/serial_number
 
But again at the end, when I tried to run the compiled example on RB5, I got the following error:
 
./graph_app: /usr/lib/libcdsprpc.so: no version information available (required by ./graph_app)
ERROR: Could not initialize a new graph
UPDATE: I have removed the CDSP_FLAG=1 from compilation command, so it doesn't complaint about "no version information available" anymore but it still could not run the sample code ;

ERROR: Could not initialize a new graph
Thank you again for helping me out
  • Up0
  • Down0
bmallem
Join Date: 21 Jan 20
Posts: 3
Posted: Thu, 2021-07-01 13:33

Hi @SoDa,

I see you mentioned you are using TF v2.6.  May I know how you got libhexagon_interface.so library?

Usually, RB5 ships with both libhexagon_interface.so and libhexagon_nn_skel.so that are required to offload a network with Hexagon Delegate and you don't need to recompile and download any other libraries (from tensorflow). 

Could you share more details on how you got this libhexagon_interface.so? 

  • Up0
  • Down0
SoDa
Join Date: 22 Nov 19
Posts: 5
Posted: Sun, 2021-07-04 03:42

Hi,

Thanks for the reply! I've used "libhexagon_interface.so"  shipped with RB5 OS. However, I've re-installed the RB5 OS again and re-wrote the label_image example from tflite Github repo for linux_aarch64. It works now on CPU, GPU and DSP. Even though the sample app for RB5 still not working. I think my problem was caused by these two reasons:

1. The compiled "libhexgon_nn_skel.so" version mismatch. As you suggested I didn't replaced it with the compiled version from Hexagon SDK

2. I ran everything with root user. After using "strace" I realized that apparently the user doesn't have access permission to HW even though it was a sudoer user.

Thank you again for your replies

  • Up0
  • Down0
hs.chaya
Join Date: 20 Mar 20
Posts: 23
Posted: Mon, 2021-10-11 02:42

Hi,

I am working on hexagon sdk image classification sample app,

https://github.com/quic/sample-apps-for-Qualcomm-Robotics-RB5-platform/tree/master/HexgonSDK-Image-classification

that runs a Tensorflow model on dsp.

Faced checksum issue when building transform graph tool in tensorflow model(step 3), resolved it by modifying the workspace.bzl file. Followed further steps, then faced below error in step 6.

/data/graph_app: /usr/lib/libcdsprpc.so: no version information available (required by /data/graph_app)

ERROR: Could not initialize a new graph

Didn't replace the default libhexagon_nn_skel.so file in RB5. But the issue still remains. Please help me in resolving the issue.

Thanks

  • Up0
  • Down0
cris.thomas.sky...
Join Date: 12 Aug 22
Posts: 7
Posted: Mon, 2022-08-15 04:52

Greetings,

Are there any working example (C++) that uses the hexagon dsp via tflite delegates on RB5?

Also compatible interface and skel libraries?

It would be really helpful.

Thanks in advance.

  • Up0
  • Down0
cris.thomas.sky...
Join Date: 12 Aug 22
Posts: 7
Posted: Wed, 2022-09-14 07:00

Hi @bmallem

I tried to use the libhexagon_interface.so and libhexagon_nn_skel.so already present with the RB5.

Got the following error: 

WARNING: Failed to fetch Hexagon NN version. This might be because you're using incompatible versions of libhexagon_interface and libhexagon_nn_skel. You must use compatible versions. Refer to Tensorflow Lite Hexagon Delegate Guide.
INFO: Hexagon Delegate is not supported.
 
ERROR: Null delegate.

Then, I built the libhexagon_interface.so library on the v2.9.1 tensorflow branch and used corresponding libhexagon_nn_skel from https://storage.cloud.google.com/download.tensorflow.org/tflite/hexagon_...Still getting the same error.

How can we make sure that we are using the compatible versions of the libraries? 

 

  • Up0
  • Down0
yusufsatilmis
Join Date: 25 Apr 22
Posts: 2
Posted: Sat, 2023-07-22 06:01

Hi @cris.thomas.sky... 

I am having the same problem. Did you solve the problem?

Thanks

  • Up0
  • Down0
or Register

Opinions expressed in the content posted here are the personal opinions of the original authors, and do not necessarily reflect those of Qualcomm Incorporated or its subsidiaries (“Qualcomm”). The content is provided for informational purposes only and is not meant to be an endorsement or representation by Qualcomm or any other party. This site may also provide links or references to non-Qualcomm sites and resources. Qualcomm makes no representations, warranties, or other commitments whatsoever about any non-Qualcomm sites or third-party resources that may be referenced, accessible from, or linked to this site.