2024年2月7日 星期三

STM32MP1 darknet

Env: Board: STM32MP157f-DK2
OS: buildroot (branch: remotes/origin/st/2023.02.6)
patch: buildroot-external-st (remotes/origin/st/2023.02.2)

Build darknet
result: not enough memory to run darknet :(
root@buildroot:~/darknet_mp157
# ./darknet detect cfg/yolov3.cfg yolov3.weights data/dog.jpg
layer     filters    size              input                output
    0 conv     32  3 x 3 / 1   416 x 416 x   3   ->   416 x 416 x  32  0.299 BFLOPs
    1 conv     64  3 x 3 / 2   416 x 416 x  32   ->   208 x 208 x  64  1.595 BFLOPs
    2 conv     32  1 x 1 / 1   208 x 208 x  64   ->   208 x 208 x  32  0.177 BFLOPs
    3 conv     64  3 x 3 / 1   208 x 208 x  32   ->   208 x 208 x  64  1.595 BFLOPs
    4 res    1                 208 x 208 x  64   ->   208 x 208 x  64
    5 conv    128  3 x 3 / 2   208 x 208 x  64   ->   104 x 104 x 128  1.595 BFLOPs
    6 conv     64  1 x 1 / 1   104 x 104 x 128   ->   104 x 104 x  64  0.177 BFLOPs
    7 conv    128  3 x 3 / 1   104 x 104 x  64   ->   104 x 104 x 128  1.595 BFLOPs
    8 res    5                 104 x 104 x 128   ->   104 x 104 x 128
    9 conv     64  1 x 1 / 1   104 x 104 x 128   ->   104 x 104 x  64  0.177 BFLOPs
   10 conv    128  3 x 3 / 1   104 x 104 x  64   ->   104 x 104 x 128  1.595 BFLOPs
   11 res    8                 104 x 104 x 128   ->   104 x 104 x 128
   12 conv    256  3 x 3 / 2   104 x 104 x 128   ->    52 x  52 x 256  1.595 BFLOPs
   13 conv    128  1 x 1 / 1    52 x  52 x 256   ->    52 x  52 x 128  0.177 BFLOPs
   14 conv    256  3 x 3 / 1    52 x  52 x 128   ->    52 x  52 x 256  1.595 BFLOPs
   15 res   12                  52 x  52 x 256   ->    52 x  52 x 256
   16 conv    128  1 x 1 / 1    52 x  52 x 256   ->    52 x  52 x 128  0.177 BFLOPs
   17 conv    256  3 x 3 / 1    52 x  52 x 128   ->    52 x  52 x 256  1.595 BFLOPs
   18 res   15                  52 x  52 x 256   ->    52 x  52 x 256
   19 conv    128  1 x 1 / 1    52 x  52 x 256   ->    52 x  52 x 128  0.177 BFLOPs
   20 conv    256  3 x 3 / 1    52 x  52 x 128   ->    52 x  52 x 256  1.595 BFLOPs
   21 res   18                  52 x  52 x 256   ->    52 x  52 x 256
   22 conv    128  1 x 1 / 1    52 x  52 x 256   ->    52 x  52 x 128  0.177 BFLOPs
   23 conv    256  3 x 3 / 1    52 x  52 x 128   ->    52 x  52 x 256  1.595 BFLOPs
   24 res   21                  52 x  52 x 256   ->    52 x  52 x 256
   25 conv    128  1 x 1 / 1    52 x  52 x 256   ->    52 x  52 x 128  0.177 BFLOPs
   26 conv    256  3 x 3 / 1    52 x  52 x 128   ->    52 x  52 x 256  1.595 BFLOPs
   27 res   24                  52 x  52 x 256   ->    52 x  52 x 256
   28 conv    128  1 x 1 / 1    52 x  52 x 256   ->    52 x  52 x 128  0.177 BFLOPs
   29 conv    256  3 x 3 / 1    52 x  52 x 128   ->    52 x  52 x 256  1.595 BFLOPs
   30 res   27                  52 x  52 x 256   ->    52 x  52 x 256
   31 conv    128  1 x 1 / 1    52 x  52 x 256   ->    52 x  52 x 128  0.177 BFLOPs
   32 conv    256  3 x 3 / 1    52 x  52 x 128   ->    52 x  52 x 256  1.595 BFLOPs
   33 res   30                  52 x  52 x 256   ->    52 x  52 x 256
   34 conv    128  1 x 1 / 1    52 x  52 x 256   ->    52 x  52 x 128  0.177 BFLOPs
   35 conv    256  3 x 3 / 1    52 x  52 x 128   ->    52 x  52 x 256  1.595 BFLOPs
   36 res   33                  52 x  52 x 256   ->    52 x  52 x 256
   37 conv    512  3 x 3 / 2    52 x  52 x 256   ->    26 x  26 x 512  1.595 BFLOPs
   38 conv    256  1 x 1 / 1    26 x  26 x 512   ->    26 x  26 x 256  0.177 BFLOPs
   39 conv    512  3 x 3 / 1    26 x  26 x 256   ->    26 x  26 x 512  1.595 BFLOPs
   40 res   37                  26 x  26 x 512   ->    26 x  26 x 512
   41 conv    256  1 x 1 / 1    26 x  26 x 512   ->    26 x  26 x 256  0.177 BFLOPs
   42 conv    512  3 x 3 / 1    26 x  26 x 256   ->    26 x  26 x 512  1.595 BFLOPs
   43 res   40                  26 x  26 x 512   ->    26 x  26 x 512
   44 conv    256  1 x 1 / 1    26 x  26 x 512   ->    26 x  26 x 256  0.177 BFLOPs
   45 conv    512  3 x 3 / 1    26 x  26 x 256   ->    26 x  26 x 512  1.595 BFLOPs
   46 res   43                  26 x  26 x 512   ->    26 x  26 x 512
   47 conv    256  1 x 1 / 1    26 x  26 x 512   ->    26 x  26 x 256  0.177 BFLOPs
   48 conv    512  3 x 3 / 1    26 x  26 x 256   ->    26 x  26 x 512  1.595 BFLOPs
   49 res   46                  26 x  26 x 512   ->    26 x  26 x 512
   50 conv    256  1 x 1 / 1    26 x  26 x 512   ->    26 x  26 x 256  0.177 BFLOPs
   51 conv    512  3 x 3 / 1    26 x  26 x 256   ->    26 x  26 x 512  1.595 BFLOPs
   52 res   49                  26 x  26 x 512   ->    26 x  26 x 512
   53 conv    256  1 x 1 / 1    26 x  26 x 512   ->    26 x  26 x 256  0.177 BFLOPs
   54 conv    512  3 x 3 / 1    26 x  26 x 256   ->    26 x  26 x 512  1.595 BFLOPs
   55 res   52                  26 x  26 x 512   ->    26 x  26 x 512
   56 conv    256  1 x 1 / 1    26 x  26 x 512   ->    26 x  26 x 256  0.177 BFLOPs
   57 conv    512  3 x 3 / 1    26 x  26 x 256   ->    26 x  26 x 512  1.595 BFLOPs
   58 res   55                  26 x  26 x 512   ->    26 x  26 x 512
   59 conv    256  1 x 1 / 1    26 x  26 x 512   ->    26 x  26 x 256  0.177 BFLOPs
   60 conv    512  3 x 3 / 1    26 x  26 x 256   ->    26 x  26 x 512  1.595 BFLOPs
   61 res   58                  26 x  26 x 512   ->    26 x  26 x 512
   62 conv   1024  3 x 3 / 2    26 x  26 x 512   ->    13 x  13 x1024  1.595 BFLOPs
   63 conv    512  1 x 1 / 1    13 x  13 x1024   ->    13 x  13 x 512  0.177 BFLOPs
   64 conv   1024  3 x 3 / 1    13 x  13 x 512   ->    13 x  13 x1024  1.595 BFLOPs
   65 res   62                  13 x  13 x1024   ->    13 x  13 x1024
   66 conv    512  1 x 1 / 1    13 x  13 x1024   ->    13 x  13 x 512  0.177 BFLOPs
   67 conv   1024  3 x 3 / 1    13 x  13 x 512   ->    13 x  13 x1024  1.595 BFLOPs
   68 res   65                  13 x  13 x1024   ->    13 x  13 x1024
   69 conv    512  1 x 1 / 1    13 x  13 x1024   ->    13 x  13 x 512  0.177 BFLOPs
   70 conv   1024  3 x 3 / 1    13 x  13 x 512   ->    13 x  13 x1024  1.595 BFLOPs
   71 res   68                  13 x  13 x1024   ->    13 x  13 x1024
   72 conv    512  1 x 1 / 1    13 x  13 x1024   ->    13 x  13 x 512  0.177 BFLOPs
   73 conv   1024  3 x 3 / 1    13 x  13 x 512   ->    13 x  13 x1024  1.595 BFLOPs
   74 res   71                  13 x  13 x1024   ->    13 x  13 x1024
   75 conv    512  1 x 1 / 1    13 x  13 x1024   ->    13 x  13 x 512  0.177 BFLOPs
   76 conv   1024  3 x 3 / 1    13 x  13 x 512   ->    13 x  13 x1024  1.595 BFLOPs
   77 conv    512  1 x 1 / 1    13 x  13 x1024   ->    13 x  13 x 512  0.177 BFLOPs
   78 conv   1024  3 x 3 / 1    13 x  13 x 512   ->    13 x  13 x1024  1.595 BFLOPs
   79 conv    512  1 x 1 / 1    13 x  13 x1024   ->    13 x  13 x 512  0.177 BFLOPs
   80 conv   1024  3 x 3 / 1    13 x  13 x 512   ->    13 x  13 x1024  1.595 BFLOPs
   81 conv    255  1 x 1 / 1    13 x  13 x1024   ->    13 x  13 x 255  0.088 BFLOPs
   82 yolo
   83 route  79
   84 conv    256  1 x 1 / 1    13 x  13 x 512   ->    13 x  13 x 256  0.044 BFLOPs
   85 upsample            2x    13 x  13 x 256   ->    26 x  26 x 256
   86 route  85 61
   87 conv    256  1 x 1 / 1    26 x  26 x 768   ->    26 x  26 x 256  0.266 BFLOPs
   88 conv    512  3 x 3 / 1    26 x  26 x 256   ->    26 x  26 x 512  1.595 BFLOPs
   89 conv    256  1 x 1 / 1    26 x  26 x 512   ->    26 x  26 x 256  0.177 BFLOPs
   90 conv    512  3 x 3 / 1    26 x  26 x 256   ->    26 x  26 x 512  1.595 BFLOPs
   91 conv    256  1 x 1 / 1    26 x  26 x 512   ->    26 x  26 x 256  0.177 BFLOPs
   92 conv    512  3 x 3 / 1    26 x  26 x 256   ->    26 x  26 x 512  1.595 BFLOPs
   93 conv    255  1 x 1 / 1    26 x  26 x 512   ->    26 x  26 x 255  0.177 BFLOPs
   94 yolo
   95 route  91
   96 conv    128  1 x 1 / 1    26 x  26 x 256   ->    26 x  26 x 128  0.044 BFLOPs
   97 upsample            2x    26 x  26 x 128   ->    52 x  52 x 128
   98 route  97 36
   99 conv    128  1 x 1 / 1    52 x  52 x 384   ->    52 x  52 x 128  0.266 BFLOPs
  100 conv    256  3 x 3 / 1    52 x  52 x 128   ->    52 x  52 x 256  1.595 BFLOPs
  101 conv    128  1 x 1 / 1    52 x  52 x 256   ->    52 x  52 x 128  0.177 BFLOPs
  102 conv    256  3 x 3 / 1    52 x  52 x 128   ->    52 x  52 x 256  1.595 BFLOPs
  103 conv    128  1 x 1 / 1    52 x  52 x 256   ->    52 x  52 x 128  0.177 BFLOPs
  104 conv    256  3 x 3 / 1    52 x  52 x 128   ->    52 x  52 x 256  1.595 BFLOPs
  105 conv    255  1 x 1 / 1    52 x  52 x 256   ->    52 x  52 x 255  0.353 BFLOPs
  106 yolo
Loading weights from yolov3.weights...Done!
[  360.338432] darknet invoked oom-killer: gfp_mask=0x140cca(GFP_HIGHUSER_MOVABLE|__GFP_COMP)0
[  360.347669] CPU: 1 PID: 291 Comm: darknet Tainted: G           O       6.1.28 #1
[  360.354975] Hardware name: STM32 (Device Tree Support)
[  360.360159]  unwind_backtrace from show_stack+0x10/0x14
[  360.365363]  show_stack from dump_stack_lvl+0x40/0x4c
[  360.370456]  dump_stack_lvl from dump_header+0x4c/0x1f8
[  360.375652]  dump_header from oom_kill_process+0x21c/0x228
[  360.381146]  oom_kill_process from out_of_memory+0x100/0x350
[  360.386739]  out_of_memory from __alloc_pages_may_oom+0xf8/0x1bc
[  360.392742]  __alloc_pages_may_oom from __alloc_pages_slowpath.constprop.0+0x32c/0x708
[  360.400661]  __alloc_pages_slowpath.constprop.0 from __alloc_pages+0x22c/0x2d8
[  360.407872]  __alloc_pages from do_anonymous_page+0x64/0x468
[  360.413573]  do_anonymous_page from handle_mm_fault+0x12c/0x2ac
[  360.419476]  handle_mm_fault from do_page_fault+0x158/0x454
[  360.425071]  do_page_fault from do_DataAbort+0x3c/0xb0
[  360.430153]  do_DataAbort from __dabt_usr+0x54/0x60
[  360.435034] Exception stack(0xdf261fb0 to 0xdf261ff8)
[  360.440111] 1fa0:                                     002a4000 afe1d000 00000004 000087ff
[  360.448318] 1fc0: 002a4000 00000001 be80a160 00000002 afdfb008 0000006b 00000000 00456641
[  360.456523] 1fe0: be80a458 be809d58 00456677 0046f41e 000b0030 ffffffff
[  360.463159] Mem-Info:
[  360.465321] active_anon:31 inactive_anon:90990 isolated_anon:0
[  360.465321]  active_file:19 inactive_file:4 isolated_file:0
[  360.465321]  unevictable:0 dirty:0 writeback:0
[  360.465321]  slab_reclaimable:2087 slab_unreclaimable:2643
[  360.465321]  mapped:8 shmem:71 pagetables:510
[  360.465321]  sec_pagetables:0 bounce:0
[  360.465321]  kernel_misc_reclaimable:0
[  360.465321]  free:615 free_pcp:0 free_cma:8
[  360.502769] Node 0 active_anon:124kB inactive_anon:363960kB active_file:76kB inactive_files
[  360.528846] Normal free:2460kB boost:0kB min:2532kB low:3164kB high:3796kB reserved_highatB
[  360.555893] lowmem_reserve[]: 0 0 0
[  360.559272] HighMem free:0kB boost:0kB min:128kB low:128kB high:128kB reserved_highatomic:B
[  360.584594] lowmem_reserve[]: 0 0 0
[  360.588071] Normal: 77*4kB (UM) 41*8kB (UM) 31*16kB (UM) 19*32kB (UMC) 12*64kB (UM) 2*128kB
[  360.602086] HighMem: 0*4kB 0*8kB 0*16kB 0*32kB 0*64kB 0*128kB 0*256kB 0*512kB 0*1024kB 0*2B
[  360.612825] 110 total pagecache pages
[  360.616481] 0 pages in swap cache
[  360.619833] Free swap  = 0kB
[  360.622700] Total swap = 0kB
[  360.625548] 131072 pages RAM
[  360.628394] 8192 pages HighMem/MovableOnly
[  360.632478] 30458 pages reserved
[  360.635730] 16384 pages cma reserved
[  360.639283] Tasks state (memory values in pages):
[  360.643981] [  pid  ]   uid  tgid total_vm      rss pgtables_bytes swapents oom_score_adj e
[  360.652640] [    111]     0   111      708       22    10240        0             0 syslogd
[  360.660955] [    115]     0   115      708       28     8192        0             0 klogd
[  360.669199] [    127]     0   127     3770      202    12288        0         -1000 udevd
[  360.677342] [    215]   100   215      764       42    10240        0             0 dbus-dn
[  360.686091] [    219]     0   219      632       28     8192        0             0 tee-sut
[  360.695030] [    224]     0   224     1112       52    12288        0             0 bluetod
[  360.703586] [    239]     0   239      597       23     8192        0             0 dropber
[  360.712000] [    256]     0   256      708       32     8192        0             0 sh
[  360.719933] [    262]     0   262     1716      113    14336        0             0 wpa_sut
[  360.728982] [    280]     0   280      708       22     6144        0             0 udhcpc
[  360.737215] [    281]     0   281      597       37    10240        0             0 dropber
[  360.745658] [    282]     0   282      708       30     8192        0             0 sh
[  360.753586] [    291]     0   291   330190    90325   919552        0             0 darknet
[  360.761899] oom-kill:constraint=CONSTRAINT_NONE,nodemask=(null),global_oom,task_memcg=/,ta0
[  360.772307] Out of memory: Killed process 291 (darknet) total-vm:1320760kB, anon-rss:361290
Killed
root@buildroot:~/darknet_mp157
#

top
Mem: 246616K used, 155840K free, 284K shrd, 3728K buff, 35076K cached
CPU:  49% usr   0% sys   0% nic  49% idle   0% io   0% irq   0% sirq
Load average: 0.35 0.14 0.06 2/101 293
  PID  PPID USER     STAT   VSZ %VSZ %CPU COMMAND
  291   256 root     R     948m 241%  50% ./darknet detect cfg/yolov3.cfg yolov3.weights data/d
  284   282 root     R     2832   1%   0% top
   19     2 root     IW       0   0%   0% [kworker/1:0-eve]
   12     2 root     SW       0   0%   0% [ksoftirqd/0]
  127     1 root     S    15080   4%   0% /sbin/udevd -d
  262     1 root     S     6864   2%   0% wpa_supplicant -B -iwlan0 -c /etc/wpa_supplicant.conf
  224     1 root     S     4448   1%   0% /usr/libexec/bluetooth/bluetoothd -n
  215     1 dbus     S     3056   1%   0% dbus-daemon --system
    1     0 root     S     2832   1%   0% init
  256     1 root     S     2832   1%   0% -sh
  111     1 root     S     2832   1%   0% /sbin/syslogd -n
  115     1 root     S     2832   1%   0% /sbin/klogd -n
  282   281 root     S     2832   1%   0% -sh
  280     1 root     S     2832   1%   0% udhcpc -i wlan0
  219     1 root     S     2528   1%   0% /usr/sbin/tee-supplicant -d /dev/teepriv0
  281   239 root     S     2388   1%   0% /usr/sbin/dropbear -R -2 9
  239     1 root     S     2388   1%   0% /usr/sbin/dropbear -R
   44     2 root     IW       0   0%   0% [kworker/u4:3-ev]


Memory
# free -m
              total        used        free      shared  buff/cache   available
Mem:            393         371           9           0          13          12
Swap:             0           0           0

沒有留言:

張貼留言