I have tried different versions of nnlibs at codeaurora
and used SDK 3.0
, 3.2
and 3.3.3
to compile and test them. The closest I got was to use the commit version 7321d49318a33a99e978b18411adee43df7ddaea (Jan 2018) with SDK 3.3.3
and while running the graph_app I receive this helper:
$ adb shell /data/graph_app
Usage: testapp [--flag flagopt] [inputfile [inputfile...]]
flag name type default function
height int 0 Height of the input data. 0 == autodetect-square
width int 0 Width of the input data. 0 == autodetect-square
depth int 3 Depth of the input data
iters int 1 Number of times to run each input
perfdump int 0 Generate performance dump
pmu int 0 Get Performance Monitor Unit information
elementsize int 1 Element Size (uint8==1,float==4)
layer_reorder string NULL Reorder depth layers. ("210" changes RGB to BGR)
pprint_floats int 0 Pretty-Print output as floats
pprint_imagenet int 1 Pretty-print output, getting top 5 values and use imagenet categories
debug int 0 Debug verbosity level. Higher numbers get more verbosity.
benchmark int 0 Bechmark mode. Reduce work at the end of execution. Reduces messages.
bus_bw int 0 Collect bus BW
node_perf int 0 Show the cycles each node consumed in last execution
graph_rebuild int 0 Number of times to build/destroy the graph
showaddress int 0 Show the offset of some item in the .so, useful for
However, none of the tries succeeded to produce any results because of the mismatch in the image file:
$adb shell data/graph_app --height 200 --width 200 --depth 1 --iters 1 --perfdump 0 --pmu 0 --pprint_floats 0 --pprint_imagenet 1 --debug 0 /data/keyboard_299x299.jpg
return value from dspCV_initQ6() : 0
node 66122 success
node 66304 success
node 66637 success
Init graph done.Prepare a830e780 success!
nn @ a830e780: id=0x0 debug_level=0
node @ a830ecf0: id=0x1024a type=0x0(INPUT) n_inputs=0 n_outputs=1 padding=0(WHATEVER)
node @ a830edd0: id=0x10300 type=0x2(Nop) n_inputs=1 n_outputs=1 padding=0(WHATEVER)
node @ a830eed0: id=0x1044d type=0x1(OUTPUT) n_inputs=1 n_outputs=0 padding=0(WHATEVER)
3 nodes total.
Using </data/keyboard_299x299.jpg>
image size 25763 does not match element size 1, depth 1, width 200, height 200
Looking at the test/graph_app.c
code, I have to comform to these rules:
if ((filesize % elementsize != 0)
|| (elements % depth != 0)
|| (height * width != area)) {
printf("image size %d does not match "
"element size %d, "
"depth %d, "
"width %d, "
"height %d, "
"elements %d, "
"area %d\n ",
filesize,
elementsize,
depth,
width,
height,
elements,
area);
return -1;
}
yet, when they do, applications gets stuck in Run!
and the device is overflown and I have to remount using adb to access the DSP again.
Also, I tried the latest nnlib and it seems that the header file: pmu_adsp.h is missing in the project. Any help is appreciated.
UPDATED QUESTION: As per the comments of @Erich Plondke, I tried to feed in just a tiny image and here is the results:
21 nodes total.
Init graph done.Prepare 9a912180 success!
nn @ 9a912180: id=0x0 debug_level=0
node @ 9a912610: id=0x1000b type=0x3(Const) n_inputs=0 n_outputs=1 padding=0(WHATEVER)
node @ 9a912a20: id=0x1000c type=0x3(Const) n_inputs=0 n_outputs=1 padding=0(WHATEVER)
node @ 9a912b20: id=0x1000d type=0x3(Const) n_inputs=0 n_outputs=1 padding=0(WHATEVER)
node @ 9a912b70: id=0x1000e type=0x3(Const) n_inputs=0 n_outputs=1 padding=0(WHATEVER)
node @ 9a912c20: id=0x1000f type=0x3(Const) n_inputs=0 n_outputs=1 padding=0(WHATEVER)
node @ 9a912d30: id=0x10010 type=0x3(Const) n_inputs=0 n_outputs=1 padding=0(WHATEVER)
node @ 9a912ec0: id=0x10011 type=0x3(Const) n_inputs=0 n_outputs=1 padding=0(WHATEVER)
node @ 9a912fa0: id=0x10012 type=0x3(Const) n_inputs=0 n_outputs=1 padding=0(WHATEVER)
node @ 9a912ff0: id=0x10250 type=0x3(Const) n_inputs=0 n_outputs=1 padding=0(WHATEVER)
node @ 9a913040: id=0x1024a type=0x0(INPUT) n_inputs=0 n_outputs=1 padding=0(WHATEVER)
node @ 9a9130c0: id=0x1024b type=0xe(Flatten) n_inputs=2 n_outputs=1 padding=0(WHATEVER)
node @ 9a939af0: id=0x1024c type=0x21(Min_f) n_inputs=2 n_outputs=1 padding=0(WHATEVER)
node @ 9a939bd0: id=0x1024d type=0x23(Max_f) n_inputs=2 n_outputs=1 padding=0(WHATEVER)
node @ 9a939cb0: id=0x1024e type=0x25(Quantize) n_inputs=3 n_outputs=3 padding=0(WHATEVER)
node @ 9a93a8a0: id=0x10254 type=0x29(Supernode_8x8p8to8) n_inputs=12 n_outputs=3 padding=2(VALID)
node @ 9a93a4e0: id=0x10442 type=0x27(Dequantize) n_inputs=3 n_outputs=1 padding=0(WHATEVER)
node @ 9a93a5d0: id=0x1044d type=0x1(OUTPUT) n_inputs=1 n_outputs=0 padding=0(WHATEVER)
node @ 9a93a690: id=0xffffffff type=0x3(Const) n_inputs=0 n_outputs=1 padding=0(WHATEVER)
node @ 9a93a7a0: id=0xfffffffe type=0x3(Const) n_inputs=0 n_outputs=1 padding=0(WHATEVER)
node @ 9a93a7f0: id=0xfffffffd type=0x3(Const) n_inputs=0 n_outputs=1 padding=0(WHATEVER)
20 nodes total.
Using </data/keyboard_299x299.dat>
filesize=256 elementsize=4 height=8 width=8 depth=1
Run!
sum=0
Executing!
execute got err: -1
hexagon/ops/src/op_supernode.c:1142:oops, depth != depth
output size=4096
Rank,Softmax,index,string
0,303036292954618408664607741320364032.000000,148,keeshond
1,79327539388858010780491752432205824.000000,177,Saint Bernard
2,79327539388858010780491752432205824.000000,239,canoe
3,78932096774468846046999075786588160.000000,933,bell cote
4,78025652318903304902112439047290880.000000,350,harmonica
AppReported: 4294967296
The file pmu_adsp.h
shouldn't be needed, probably just a mistake somewhere.
In this particular case, you probably want to feed in a very small file. Try dd if=/dev/zero of=test.dat bs=4 count=64
and then try --height 8 --width 8 --depth 1 --elementsize 4
If you look through the code, there's a maximum size that can be spat out, and by default it's too small for the simple nop graph, it's designed to be more amenable to a image recognition graph (not shipped).
Also, make sure you are on SD820 or SD835. Other targets may require you to send to the "CDSP" instead of the "ADSP". If you send it to a DSP device without HVX it can hang or crash.
User contributions licensed under CC BY-SA 3.0