当前手里有一块am62a 的开发版,系统sdk 9.2, 已经转好板端模型,能正常运行模型得到正确结果。期间碰到一个问题:模型推理过程中,如果程序崩溃或者在检测过程中强行C掉程序,简单讲,没有正确执行最后的资源释放代码,就会导致,下一次无法正确运行模型,只能重启板子。报错如下:
libtidl_onnxrt_EP loaded 0xed32db0
Final number of subgraphs created are : 1, - Offloaded Nodes - 132, Total Nodes - 135
176789.252347 s: VX_ZONE_ERROR:[ownContextSendCmd:875] Command ack message returned failure cmd_status: -1
176789.252405 s: VX_ZONE_ERROR:[ownNodeKernelInit:590] Target kernel, TIVX_CMD_NODE_CREATE failed for node TIDLNode
176789.252424 s: VX_ZONE_ERROR:[ownNodeKernelInit:591] Please be sure the target callbacks have been registered for this core
176789.252439 s: VX_ZONE_ERROR:[ownNodeKernelInit:592] If the target callbacks have been registered, please ensure no errors are occurring within the create callback of this kernel
176789.252457 s: VX_ZONE_ERROR:[ownGraphNodeKernelInit:608] kernel init for node 0, kernel com.ti.tidl:1:1 ... failed !!!
176789.252487 s: VX_ZONE_ERROR:[vxVerifyGraph:2159] Node kernel init failed
176789.252500 s: VX_ZONE_ERROR:[vxVerifyGraph:2213] Graph verify failed
TIDL_RT_OVX: ERROR: Verifying TIDL graph ... Failed !!!
TIDL_RT_OVX: ERROR: Verify OpenVX graph failed
经过查询,初步分析,判断ti 的模型调用,并不是直接调用的硬件,而是与其他进程做通信,由其他进程分配资源。程序崩溃导致不能给相应的进程发送释放信号,导致资源被占用,资源不够导致再次运行出错。
[C7x_1 ] 28392.238061 s: IPC: Echo status: a530-0[.] r5f0-0[P] c75ss0[s]
[C7x_1 ] 176789.251932 s: VX_ZONE_ERROR:[tivxAlgiVisionAllocMem:194] Failed to Allocate memory record 13 @ space = 17 and size = 4964028 !!!
[C7x_1 ] 176789.251968 s: VX_ZONE_ERROR:[tivxAlgiVisionCreate:358] tivxAlgiVisionAllocMem Failed
[C7x_1 ] 176789.251999 s: VX_ZONE_ERROR:[tivxKernelTIDLCreate:926] tivxAlgiVisionCreate returned NULL
[C7x_1 ] 176789.548018 s: VX_ZONE_ERROR:[tivxAlgiVisionAllocMem:194] Failed to Allocate memory record 13 @ space = 17 and size = 3828764 !!!
[C7x_1 ] 176789.548052 s: VX_ZONE_ERROR:[tivxAlgiVisionCreate:358] tivxAlgiVisionAllocMem Failed
[C7x_1 ] 176789.548082 s: VX_ZONE_ERROR:[tivxKernelTIDLCreate:926] tivxAlgiVisionCreate returned NULL
[C7x_1 ] 176789.860206 s: VX_ZONE_ERROR:[tivxAlgiVisionAllocMem:194] Failed to Allocate memory record 5 @ space = 17 and size = 2935104 !!!
[C7x_1 ] 176789.860240 s: VX_ZONE_ERROR:[tivxAlgiVisionCreate:358] tivxAlgiVisionAllocMem Failed
[C7x_1 ] 176789.860269 s: VX_ZONE_ERROR:[tivxKernelTIDLCreate:926] tivxAlgiVisionCreate returned NULL
[C7x_1 ] 176790.194297 s: VX_ZONE_ERROR:[tivxAlgiVisionAllocMem:194] Failed to Allocate memory record 5 @ space = 17 and size = 2826986 !!!
[C7x_1 ] 176790.194331 s: VX_ZONE_ERROR:[tivxAlgiVisionCreate:358] tivxAlgiVisionAllocMem Failed
[C7x_1 ] 176790.194361 s: VX_ZONE_ERROR:[tivxKernelTIDLCreate:926] tivxAlgiVisionCreate returned NULL
请问,有什么api可以手动释放这个资源吗?