Is SNPE GPU supported on RB5 or RB3 linaro OS?

Hi,
I am trying to run a neural network on the GPU of RB3 and/or RB5. Does the linaro OS for either of these boards support Snapdragon Neural Processing Engine SDK (GPU)?
I was able to run the neural network on the CPU using instructions here, but not able to run the network on the GPU.

Thank you

Hi, have a look at these instructions to run SNPE on RB3 on Hexagon CDSP. https://github.com/96boards/documentation/wiki/Dragonboard-Hexagon-DSP#running-snapdragon-neural-processing-engine-on-db845c

I have not tried it on GPU. You would need OpenCL for GPU backend. I have not spent any time investigating on this.

–srini

Hi @srini
Thank you for the response. I faced a few bumps while trying to follow your instructions for running DSP on RB3.

Setup:
linaro OS - Linux linaro-gnome 5.13.0-qcomlt-arm64 #202 SMP PREEMPT Fri Aug 13 02:49:49 UTC 2021 aarch64
gcc version - gcc (Debian 10.2.1-6) 10.2.1 20210110
SNPE 1.54.2.2899 on Ubuntu 18.04 Host machine.

Problems faced:

  1. Copy command from here gives the following no disk space left error:

linaro@linaro-gnome:~$ sudo mount /dev/disk/by-partlabel/dsp_a /dsp
linaro@linaro-gnome:~$ sudo cp ~/snpe/dsp/* /dsp/cdsp/
cp: error writing ‘/dsp/cdsp/libcalculator_skel.so’: No space left on device
cp: error writing ‘/dsp/cdsp/libsnpe_dsp_v65_domains_v2_skel.so’: No space left on device
cp: error writing ‘/dsp/cdsp/libsnpe_dsp_v66_domains_v2_skel.so’: No space left on device
cp: error writing ‘/dsp/cdsp/libsnpe_dsp_v68_domains_v3_skel.so’: No space left on device
linaro@linaro-gnome:~$ df -h
> /dev/sde9 28M 27M 0 100% /dsp

  1. Location of libcdsprpc.so and libc.so are different than instructions.

linaro@linaro-gnome:~$ locate libc.so
/lib/aarch64-linux-gnu/libc.so.6
> /usr/lib/aarch64-linux-gnu/libc.so

linaro@linaro-gnome:~$ locate libcdsprpc
/usr/lib/aarch64-linux-gnu/libcdsprpc.la
> /usr/lib/aarch64-linux-gnu/libcdsprpc.so
/usr/lib/aarch64-linux-gnu/libcdsprpc.so.0
/usr/lib/aarch64-linux-gnu/libcdsprpc.so.0.0.0

which leads to the following runtime error:

linaro@linaro-gnome:~$ export ADSP_LIBRARY_PATH=/dsp/cdsp
linaro@linaro-gnome:~$ sudo cdsprpcd&
[1] 2079
linaro@linaro-gnome:~$ echo $LD_LIBRARY_PATH

linaro@linaro-gnome:~$ export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/home/linaro/snpe/lib
linaro@linaro-gnome:~$ ls snpe/lib/lib
libPlatformValidatorShared.so libcalculator.so libsnpe_dsp_domains_v2.so
libSNPE.so libhta.so
linaro@linaro-gnome:~$ ls snpe/lib/lib^C
linaro@linaro-gnome:~$ ^C
linaro@linaro-gnome:~$ export PATH=$PATH:/home/linaro/snpe/bin
linaro@linaro-gnome:~$ locate libcdsprpc
/usr/lib/aarch64-linux-gnu/libcdsprpc.la
/usr/lib/aarch64-linux-gnu/libcdsprpc.so
/usr/lib/aarch64-linux-gnu/libcdsprpc.so.0
/usr/lib/aarch64-linux-gnu/libcdsprpc.so.0.0.0
linaro@linaro-gnome:~$ LD_PRELOAD=/usr/local/lib/libcdsprpc.so snpe-platform-validator --runtime dsp
ERROR: ld.so: object ‘/usr/local/lib/libcdsprpc.so’ from LD_PRELOAD cannot be preloaded (cannot open shared object file): ignored.
PF_VALIDATOR: DEBUG: Calling PlatformValidator->setRuntime
PF_VALIDATOR: DEBUG: Calling PlatformValidator->RuntimeCheck
PF_VALIDATOR: DEBUG: Testing for the support of DSP runtime.
src/rpcmem_android.c:134:stat Failed on /dev/ion hello snpe-platform-validator - fastrpc_apps_user.c:1068: Error: remote_handle_control_domain: remote handle control called with unsupported request ID 2hello snpe-platform-validator - fastrpc_apps_user.c:1073: Error 0x6c: remote_handle_control_domain failed for request ID 2 on domain 3hello snpe-platform-validator - fastrpc_apps_user.c:1084: Error 0x6c: remote_handle_control failed for request ID 2hello snpe-platform-validator - fastrpc_apps_user.c:1491: Error: Device node open failed for domain 3 (errno Permission denied)hello snpe-platform-validator - fastrpc_apps_user.c:1704: Error 0x57: apps_dev_init failed for domain 3, errno Permission denied
hello snpe-platform-validator - fastrpc_apps_user.c:1799: Error 57: open dev -1 for domain 3 failed
hello snpe-platform-validator - fastrpc_apps_user.c:1491: Error: Device node open failed for domain 3 (errno Permission denied)hello snpe-platform-validator - fastrpc_apps_user.c:1704: Error 0x57: apps_dev_init failed for domain 3, errno Permission denied
hello snpe-platform-validator - fastrpc_apps_user.c:1799: Error 57: open dev -1 for domain 3 failed
PF_VALIDATOR: DEBUG: CPU side validation failed.

PF_VALIDATOR: ERROR: All the libraries needed for SNPE DSP are not present. Files missing: /lib/libc.so.6,/usr/lib/libadsprpc.so,
Unit Test on the runtime DSP: Failed.
SNPE is NOT supported for runtime DSP on the device.
PF_VALIDATOR: DEBUG: Calling PlatformValidator->IsRuntimeAvailable
PF_VALIDATOR: DEBUG: CPU side validation failed.

PF_VALIDATOR: ERROR: All the libraries needed for SNPE DSP are not present. Files missing: /lib/libc.so.6,/usr/lib/libadsprpc.so,
Runtime DSP Prerequisites: Absent.
Error in saving the results

Same errors when I do these steps as root.

  1. The latest SNPE only gives me the option of gcc7.5 which does not match the latest RB3 linaro gcc. Should I try an older version of linaro? if so, which one?

kshitij@geode:~/projects/waar3d/snpe/snpe-1.54.2.2899/lib$ ls
aarch64-android-clang6.0 aarch64-oe-linux-gcc9.3 arm-android-clang6.0 dsp x86_64-linux-clang
aarch64-oe-linux-gcc8.2 aarch64-ubuntu-gcc7.5 arm-oe-linux-gcc8.2hf python

Thank you
Kshitij