Forums - snpe-net-run failed on Arm64 Ubuntu 18.04

8 posts / 0 new
Last post
snpe-net-run failed on Arm64 Ubuntu 18.04
nasso8b
Join Date: 5 Sep 22
Posts: 4
Posted: Wed, 2022-09-14 23:42

Hello.

I have run snpe-net-run on an AWS EC2 instance, but I got an error. How can I resolve this issue?
(Note:  In bin/envsetup.sh, the path to x86_64-linux-clang is set. Therefore, I copied envsetup.sh and rewrote it to the path to aarch64-ubuntu-gcc7.5.)

$ source bin/envsetup_arm.sh -t /
$ cd $SNPE_ROOT/bin/aarch64-ubuntu-gcc7.5
$ ./snpe-net-run --container ../../models/inception_v3/dlc/inception_v3.dlc --input_list ../../models/inception_v3/data/cropped/raw_list.txt
 
error_code=1200; error_message=libstd error. error_code=1200; error_message=libstd error. QnnBackend_initialize failed: 1006; error_component=Dependent library; line_no=646; thread_id=281473257910576; error_component=Dependent library; line_no=342; thread_id=281473258459152
 
 

The execution environment is as follows:

- SNPE: snpe-1.65.0.3676
- AWS EC2 ARM64 (AMI: ubuntu-bionic-18.04-arm64-server-20220610)
- Python 3.6.9
 

$ source bin/check_python_depends.sh
Supported version of Python found: 3.6

Checking for python3-numpy: install ok installed
WARNING: pip is being invoked by an old script wrapper. This will fail in a future version of pip.
Please see https://github.com/pypa/pip/issues/5599 for advice on fixing the underlying issue.
To avoid this problem you can invoke Python with '-m pip' instead of running pip directly.
WARNING: It appears the python module numpy is installed on this system using the apt-get distribution as well as pip. If you encounter errors, please use only one distribution.
===========================================
Checking for python-sphinx:
WARNING: pip is being invoked by an old script wrapper. This will fail in a future version of pip.
Please see https://github.com/pypa/pip/issues/5599 for advice on fixing the underlying issue.
To avoid this problem you can invoke Python with '-m pip' instead of running pip directly.
sphinx installed via pip Version: 2.2.1
===========================================
Checking for python3-scipy: install ok installed
WARNING: pip is being invoked by an old script wrapper. This will fail in a future version of pip.
Please see https://github.com/pypa/pip/issues/5599 for advice on fixing the underlying issue.
To avoid this problem you can invoke Python with '-m pip' instead of running pip directly.
WARNING: It appears the python module scipy is installed on this system using the apt-get distribution as well as pip. If you encounter errors, please use only one distribution.
===========================================
Checking for python3-matplotlib: install ok installed
WARNING: pip is being invoked by an old script wrapper. This will fail in a future version of pip.
Please see https://github.com/pypa/pip/issues/5599 for advice on fixing the underlying issue.
To avoid this problem you can invoke Python with '-m pip' instead of running pip directly.
WARNING: It appears the python module matplotlib is installed on this system using the apt-get distribution as well as pip. If you encounter errors, please use only one distribution.
===========================================
Checking for python3-skimage: install ok installed
WARNING: pip is being invoked by an old script wrapper. This will fail in a future version of pip.
Please see https://github.com/pypa/pip/issues/5599 for advice on fixing the underlying issue.
To avoid this problem you can invoke Python with '-m pip' instead of running pip directly.
WARNING: It appears the python module scikit-image is installed on this system using the apt-get distribution as well as pip. If you encounter errors, please use only one distribution.
===========================================
dpkg-query: no packages found matching python-protobuf
Checking for python-protobuf:
WARNING: pip is being invoked by an old script wrapper. This will fail in a future version of pip.
Please see https://github.com/pypa/pip/issues/5599 for advice on fixing the underlying issue.
To avoid this problem you can invoke Python with '-m pip' instead of running pip directly.
protobuf installed via pip Version: 3.6.0
===========================================
Checking for python3-yaml: install ok installed
WARNING: pip is being invoked by an old script wrapper. This will fail in a future version of pip.
Please see https://github.com/pypa/pip/issues/5599 for advice on fixing the underlying issue.
To avoid this problem you can invoke Python with '-m pip' instead of running pip directly.
WARNING: It appears the python module pyyaml is installed on this system using the apt-get distribution as well as pip. If you encounter errors, please use only one distribution.
===========================================
dpkg-query: no packages found matching python3-mako
Checking for python3-mako:
WARNING: pip is being invoked by an old script wrapper. This will fail in a future version of pip.
Please see https://github.com/pypa/pip/issues/5599 for advice on fixing the underlying issue.
To avoid this problem you can invoke Python with '-m pip' instead of running pip directly.
mako installed via pip Version: 1.1.6
===========================================
 
$ source bin/dependencies.sh
Checking for python3-dev: install ok installed
Success: Version of python3-dev matches tested version
Checking for wget: install ok installed
Success: Version of wget matches tested version
Checking for zip: install ok installed
Success: Version of zip matches tested version
Checking for libc++-9-dev: install ok installed
Success: Version of libc++-9-dev matches tested version
 
  • Up0
  • Down0
v.bathini
Join Date: 27 Feb 22
Posts: 6
Posted: Thu, 2022-09-15 22:24

Hi nasso8b

Recently i am also done this exercise  on AWS EC2 instance 

Ubuntu Version: 18.04.6

Snpe Version: 1.65.0.3676

https://developer.qualcomm.com/sites/default/files/docs/snpe/usergroup0.html

The above link will help you regarding your issue

PATH  for  snpe setup

snpe -> snpe setup

Related to inception V3 model and  do the tutorial setup as well

Path for tutorial setup 

tutorials and examples -> tutorial setup

Path for inception v3 modeltutorials and examples -> Running nets -> Tensoerflow inception v3

  • Up0
  • Down0
weihuan
Join Date: 12 Apr 20
Posts: 120
Posted: Sat, 2022-09-17 23:28

Dear developer,

You need to reset the SNPE environment on Linux like as below,

export TENSORFLOW_HOME=/usr/local/lib/python3.6/dist-packages/tensorflow
 
source ${SNPE_ROOT}/bin/envsetup.sh -t $TENSORFLOW_HOME

 

BR.

Wei

  • Up0
  • Down0
andreasbeckerr22
Join Date: 19 Sep 22
Posts: 1
Posted: Mon, 2022-09-19 06:07
  • Up0
  • Down0
nasso8b
Join Date: 5 Sep 22
Posts: 4
Posted: Mon, 2022-09-19 17:42

Thank you v.bathini,

I was thinking that Tensorflow would not be needed after the DLC is generated.
 
I will install Tensorflow and try again.

 

  • Up0
  • Down0
nasso8b
Join Date: 5 Sep 22
Posts: 4
Posted: Tue, 2022-09-27 18:16

Thank you weihuan,

I have built and installed tensorflow 2.3.  And I have set the tensorflow env variable.

$ export TENSORFLOW_HOME=/home/ubuntu/.local/lib/python3.6/site-packages/tensorflow
$ source bin/envsetup_arm.sh -t $TENSORFLOW_HOME

[INFO] Setting TENSORFLOW_HOME=/home/ubuntu/.local/lib/python3.6/site-packages/tensorflow
[WARNING] Can't find ANDROID_NDK_ROOT or ndk-build. SNPE needs android ndk to build the NativeCppExample

 

But I still get the same error.  Could you tell me what is missing?

snpe-net-run --container dlc/inception_v3.dlc --input_list data/cropped/raw_list.txt
error_code=1200; error_message=libstd error. error_code=1200; error_message=libstd error. QnnBackend_initialize failed: 1006; error_component=Dependent library; line_no=646; thread_id=281473244393776; error_component=Dependent library; line_no=342; thread_id=281473244942352
  • Up0
  • Down0
v.bathini
Join Date: 27 Feb 22
Posts: 6
Posted: Tue, 2022-09-27 22:29
Hi nasso8b,
 
Before setting tensorflow path you need to set android ndk path and if you don't have android ndk , you need to download.
android-ndk-r17c This is my android ndk.
 
Below commands are useful to  set environment
 
export ANDROID_NDK_ROOT=/home/ubuntu/android-ndk-r17c
 
To know tensorflow path -> pyton -m pip show tensorflow 
 
source snpe-1.65.0.3676/bin/envsetup.sh -t /home/ubuntu/anaconda3/envs/snpe/lib/python3.6/site-packages
 
after running second command you can get below information
 [email protected]:~$ source snpe-1.65.0.3676/bin/envsetup.sh -t /home/ubuntu/anaconda3/envs/snpe/lib/python3.6/site-packages
[INFO] Setting TENSORFLOW_HOME=/home/ubuntu/anaconda3/envs/snpe/lib/python3.6/site-packages
[INFO] Found ANDROID_NDK_ROOT at /home/ubuntu/android-ndk-r17c
 

 

  • Up0
  • Down0
nasso8b
Join Date: 5 Sep 22
Posts: 4
Posted: Wed, 2022-09-28 19:01

Thank you v.bathini,

I'll try it.

  • 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.