BB AI-64 edge_ai_apps python demo segmentation fault

Hello Everyone,

I am trying to run the apps_python demo under /opt/edge_ai_apps directory. However, I am getting Segmentation fault.

I am running the demo (following this link) without attaching camera and display (just from ssh terminal).

I have set the options in configs/image_classification.yaml as:

flows:
    flow0:
        input: input2
        models: [model0]
        outputs: [output2]
        mosaic:
            mosaic0:
                width:  1280
                height: 720
                pos_x:  320
                pos_y:  180

Where:
Input

input2:
        source: /opt/edge_ai_apps/data/images/%04d.jpg
        width: 1280
        height: 720
        index: 0
        framerate: 1
        loop: True

Model:

model0:
        model_path: /opt/model_zoo/TVM-CL-3410-gluoncv-mxnet-mobv2
        topN: 5

Output:

output2:
        sink: /opt/edge_ai_apps/data/output/images/output_image_%04d.jpg
        width: 1920
        height: 1080

The error output is:

root@BeagleBone:/opt/edge_ai_apps/apps_python# ./app_edgeai.py ../configs/image_classification.yaml 
2023-03-01 14:01:33,479 INFO Could not find libdlr.so in model artifact. Using dlr from /usr/dlr/libdlr.so
APP: Init ... !!!
MEM: Init ... !!!
MEM: Initialized DMA HEAP (fd=4) !!!
MEM: Init ... Done !!!
IPC: Init ... !!!
_rpmsg_char_find_rproc: 5c00000.r5f does not have any virtio devices!
_rpmsg_char_find_rproc: 5d00000.r5f does not have any virtio devices!
IPC: ERROR: Unable to create TX channels for CPU [mcu2_0] !!!
IPC: ERROR: Unable to create TX channels for CPU [mcu2_1] !!!
IPC: Init ... Done !!!
APP: ERROR: IPC init failed !!!
REMOTE_SERVICE: Init ... !!!
_rpmsg_char_find_rproc: 5c00000.r5f does not have any virtio devices!
_rpmsg_char_find_rproc: 5d00000.r5f does not have any virtio devices!
_rpmsg_char_find_ctrldev: could not find the matching rpmsg_ctrl device for virtio0.rpmsg_chrdev.-1.21
_rpmsg_char_find_ctrldev: could not find the matching rpmsg_ctrl device for virtio1.rpmsg_chrdev.-1.21
_rpmsg_char_find_ctrldev: could not find the matching rpmsg_ctrl device for virtio2.rpmsg_chrdev.-1.21
REMOTE_SERVICE: Init ... Done !!!
  1636.684231 s: GTC Frequency = 200 MHz
APP: Init ... Done !!!
  1636.684341 s:  VX_ZONE_INIT:Enabled
  1636.684352 s:  VX_ZONE_ERROR:Enabled
  1636.684357 s:  VX_ZONE_WARNING:Enabled
  1636.685434 s:  VX_ZONE_INIT:[tivxInitLocal:130] Initialization Done !!!
  1636.685640 s:  VX_ZONE_INIT:[tivxHostInitLocal:86] Initialization Done for HOST !!!
  1636.686114 s:  VX_ZONE_ERROR:[ownContextCreateCmdObj:161] context object descriptor [0] allocation failed
  1636.686142 s:  VX_ZONE_ERROR:[vxCreateContext:946] context objection creation failed
  1636.686162 s:  VX_ZONE_ERROR:[vxGetStatus:713] Reference is NULL
  1636.686180 s:  VX_ZONE_ERROR:[tivxAddKernelTIDL:233] Unable to allocate user kernel ID
  1636.686192 s:  VX_ZONE_ERROR:[vxGetStatus:713] Reference is NULL
  1636.686201 s:  VX_ZONE_ERROR:[vxGetStatus:713] Reference is NULL
  1636.686209 s:  VX_ZONE_ERROR:[vxGetStatus:713] Reference is NULL
  1636.686217 s:  VX_ZONE_ERROR:[vxGetStatus:713] Reference is NULL
  1636.686246 s:  VX_ZONE_ERROR:[vxSetReferenceName:659] Invalid reference
  1636.686261 s:  VX_ZONE_ERROR:[tivxMapTensorPatch:611] Invalid tensor reference
Segmentation fault

Please help. Thank you

Best
Shubham

UPDATE:

I compiled the /apps_cpp as well and run it, still getting the same error. Configurations are same as above.

debian@BeagleBone:/opt/edge_ai_apps/apps_cpp$ sudo ./bin/Release/app_edgeai ../configs/image_classification.yaml 
APP: Init ... !!!
MEM: Init ... !!!
MEM: Initialized DMA HEAP (fd=4) !!!
MEM: Init ... Done !!!
IPC: Init ... !!!
_rpmsg_char_find_rproc: 5c00000.r5f does not have any virtio devices!
_rpmsg_char_find_rproc: 5d00000.r5f does not have any virtio devices!
IPC: ERROR: Unable to create TX channels for CPU [mcu2_0] !!!
IPC: ERROR: Unable to create TX channels for CPU [mcu2_1] !!!
IPC: Init ... Done !!!
APP: ERROR: IPC init failed !!!
REMOTE_SERVICE: Init ... !!!
_rpmsg_char_find_rproc: 5c00000.r5f does not have any virtio devices!
_rpmsg_char_find_rproc: 5d00000.r5f does not have any virtio devices!
_rpmsg_char_find_ctrldev: could not find the matching rpmsg_ctrl device for virtio0.rpmsg_chrdev.-1.21
_rpmsg_char_find_ctrldev: could not find the matching rpmsg_ctrl device for virtio1.rpmsg_chrdev.-1.21
_rpmsg_char_find_ctrldev: could not find the matching rpmsg_ctrl device for virtio2.rpmsg_chrdev.-1.21
REMOTE_SERVICE: Init ... Done !!!
  3687.151736 s: GTC Frequency = 200 MHz
APP: Init ... Done !!!
  3687.151851 s:  VX_ZONE_INIT:Enabled
  3687.151863 s:  VX_ZONE_ERROR:Enabled
  3687.151868 s:  VX_ZONE_WARNING:Enabled
  3687.152614 s:  VX_ZONE_INIT:[tivxInitLocal:130] Initialization Done !!!
  3687.152815 s:  VX_ZONE_INIT:[tivxHostInitLocal:86] Initialization Done for HOST !!!
  3687.153179 s:  VX_ZONE_ERROR:[ownContextCreateCmdObj:161] context object descriptor [0] allocation failed
  3687.153207 s:  VX_ZONE_ERROR:[vxCreateContext:946] context objection creation failed
  3687.153232 s:  VX_ZONE_ERROR:[vxGetStatus:713] Reference is NULL
  3687.153248 s:  VX_ZONE_ERROR:[tivxAddKernelTIDL:233] Unable to allocate user kernel ID
  3687.153257 s:  VX_ZONE_ERROR:[vxGetStatus:713] Reference is NULL
  3687.153266 s:  VX_ZONE_ERROR:[vxGetStatus:713] Reference is NULL
  3687.153274 s:  VX_ZONE_ERROR:[vxGetStatus:713] Reference is NULL
  3687.153282 s:  VX_ZONE_ERROR:[vxGetStatus:713] Reference is NULL
  3687.153292 s:  VX_ZONE_ERROR:[vxSetReferenceName:659] Invalid reference
  3687.153912 s:  VX_ZONE_ERROR:[tivxMapTensorPatch:611] Invalid tensor reference
Segmentation fault

Hey,
I have the same issue with the same output.
I asked Jason Kridner about it and he told me to check if I have the latest image.
I am currently flashing it on the board. If I have any news about it I’ll let you know.
Best Antoine

Hi Antoine,

Thanks for the reply. I am already using the latest image from here still no luck.

I have tried both running from memory card and eMMC, it isn’t working.

Please let me know if you figure out something.

Thanks

Best
Shubham

Hi ,
So I have booted with this image here .

It’s the latest one used for the webinar and now everything is working perfectly. This is where I found it: https://www.beagleboard.org/distros as recommended by Jason.

I hope it will work for you too.

Best,
Antoine.

1 Like

Hello Antoine,

Thanks for the update. This solved the issue.

I am still not able to run few models but that I will figure out.

Thanks
Best
Shubham