1st I try the example I compiled.
sdm845:/data/local/tmp/alexnet # snpe-sample -b USERBUFFER -d bvlc_alexnet>
SNPE Version: 1.13.0.0
Runtime is GPU ...1.13.0.0
Force Runtime to DSP ...1.13.0.0
Segmentation fault
2nd, I tried the example QCOM provided
snpe-net-run --container inception_v3_quantized.dlc --input_list target_raw_list.txt --use_DSP
error_code=310; error_message=Dlc read failure. Failed to read archive file /data/local/tmp/alexnet/dlc; error_component=Dl Container; line_no=493; thread_id=-300620632
lc_alexnet.dlc --input_list data/cropped/raw_list.txt <
Failed to open input file: data/cropped/raw_list.txt
Does it mean that SDM845 does not support DSP for SNPE?
Thanks
SNPE supports DSP on SDM845.
Can you try the inceptionV3 sample from the user's guide, using the exact commands in the user's guide?
2nd part of your post says you tried the example... and shows a command line that calls for inceptionv3, but the error message says it cannot find the Alexnet DLC file.
Yes, I've foillow the user's guide again:
1st, push the libraries like this:
export SNPE_TARGET_ARCH=arm-android-gcc4.9
export SNPE_TARGET_STL=libgnustl_shared.so
adb shell "mkdir -p /data/local/tmp/snpeexample/$SNPE_TARGET_ARCH/bin"
adb shell "mkdir -p /data/local/tmp/snpeexample/$SNPE_TARGET_ARCH/lib"
adb shell "mkdir -p /data/local/tmp/snpeexample/dsp/lib"
adb push $SNPE_ROOT/lib/$SNPE_TARGET_ARCH/$SNPE_TARGET_STL \
/data/local/tmp/snpeexample/$SNPE_TARGET_ARCH/lib
adb push $SNPE_ROOT/lib/$SNPE_TARGET_ARCH/libsymphony-cpu.so \
/data/local/tmp/snpeexample/$SNPE_TARGET_ARCH/lib
adb push $SNPE_ROOT/lib/$SNPE_TARGET_ARCH/libsymphonypower.so \
/data/local/tmp/snpeexample/$SNPE_TARGET_ARCH/lib
adb push $SNPE_ROOT/lib/dsp/libsnpe_dsp_skel.so \
/data/local/tmp/snpeexample/dsp/lib
adb push $SNPE_ROOT/lib/dsp/libsnpe_dsp_v65_skel.so \
/data/local/tmp/snpeexample/dsp/lib
adb push $SNPE_ROOT/lib/$SNPE_TARGET_ARCH/libsnpe_adsp.so \
/data/local/tmp/snpeexample/$SNPE_TARGET_ARCH/lib
adb push $SNPE_ROOT/lib/$SNPE_TARGET_ARCH/libsnpe_cdsp.so \
/data/local/tmp/snpeexample/$SNPE_TARGET_ARCH/lib
adb push $SNPE_ROOT/lib/$SNPE_TARGET_ARCH/libsnpe_cdsp_v65.so \
/data/local/tmp/snpeexample/$SNPE_TARGET_ARCH/lib
adb push $SNPE_ROOT/lib/$SNPE_TARGET_ARCH/libSNPE.so \
/data/local/tmp/snpeexample/$SNPE_TARGET_ARCH/lib
adb push $SNPE_ROOT/bin/$SNPE_TARGET_ARCH/snpe-net-run \
/data/local/tmp/snpeexample/$SNPE_TARGET_ARCH/bin
2nd, push pictures and dlc file like this
cd $SNPE_ROOT/models/inception_v3
mkdir data/rawfiles && cp data/cropped/*.raw data/rawfiles/
adb shell "mkdir -p /data/local/tmp/inception_v3"
adb push data/rawfiles /data/local/tmp/inception_v3/cropped
adb push data/target_raw_list.txt /data/local/tmp/inception_v3
adb push dlc/inception_v3_quantized.dlc /data/local/tmp/inception_v3
rm -rf data/rawfiles
Then we get this result :
snpe-net-run --container inception_v3_quantized.dlc --input_list target_raw_list.txt --use_dsp <
The selected runtime is not available on this platform. Continue anyway to observe the failure at network creation time.
error_code=101; error_message=Invalid parameter in user config. Attempted to set a neural network configuration option DSP that is not supported on this platform.; error_component=System Configuration; line_no=107; thread_id=-354147160
Then I do it by my example like this :
1st, compile the native cpp file
cd ~/snpe-sdk/examples/NativeCpp/SampleCode
$ ndk-build NDK_TOOLCHAIN_VERSION=4.9 APP_STL=gnustl_shared
jni/Android.mk:8: "the value of LOCAL_PATH is jni TARGET_ARCH_ABI is armeabi-v7a"
jni/Android.mk:9: /home/yuepx1027/snpe-sdk
jni/Android.mk:8: "the value of LOCAL_PATH is jni TARGET_ARCH_ABI is arm64-v8a"
jni/Android.mk:9: /home/yuepx1027/snpe-sdk
[armeabi-v7a] Prebuilt : libSNPE.so <= /home/yuepx1027/snpe-sdk/lib/arm-android-gcc4.9/
.........//here we compiled normally.
[arm64-v8a] Executable : snpe-sample
[arm64-v8a] Install : snpe-sample => libs/arm64-v8a/snpe-sample
[arm64-v8a] Install : libgnustl_shared.so => libs/arm64-v8a/libgnustl_shared.so
2nd, I push the libraries and snpe-example to device:
3rd, execute the naitve example like this:
Then I'll get the logs below:
SNPE Version: 1.13.0.0
Runtime is GPU ...1.13.0.0
Force Runtime to DSP ...1.13.0.0
Segmentation fault
Here is my modifications:
--- a/examples/NativeCpp/SampleCode/jni/CheckRuntime.cpp
+++ b/examples/NativeCpp/SampleCode/jni/CheckRuntime.cpp
@@ -45,9 +45,14 @@ zdl::DlSystem::Runtime_t checkRuntime()
if (zdl::SNPE::SNPEFactory::isRuntimeAvailable(zdl::DlSystem::Runtime_t::GPU)) {
Runtime = zdl::DlSystem::Runtime_t::GPU;
+ std::cout << "Runtime is GPU ..." << Version.asString().c_str() << std::endl;
} else {
Runtime = zdl::DlSystem::Runtime_t::CPU;
+ std::cout << "Runtime is CPU ..." << Version.asString().c_str() << std::endl;
}
+ std::cout << "Force Runtime to DSP ..." << Version.asString().c_str() << std::endl;
+ Runtime = zdl::DlSystem::Runtime_t::DSP;
+ //std::cout << "SNPE Version: " << Version.asString().c_str() << "Runtime is " << Runtime << std::endl; //Print Version number
return Runtime;
}
What's my mistaked?
Waiting for your kind reply.
Thanks