Part Number: TDA4VM
Hi,
I'm using edgeai-tidl-tools to compile TIDL artifacts for TDA4 using an ONNX file. Since moving to RTOS SDK 8.6 (and edgeai 8.6), I have SIGBUS and SIGSEV throws when trying to compile.
Here a short version of my script:
import onnxruntime as rt
import onnx
# ...
onnx.shape_inference.infer_shapes_path(onnx_model_path, onnx_model_path)
compile_options = {
'tidl_tools_path': os.environ['TIDL_TOOLS_PATH'],
'artifacts_folder': artifacts_folder,
'tensor_bits': 16,
'accuracy_level': 0,
'advanced_options:calibration_frames': 1,
'advanced_options:calibration_iterations': 1,
'advanced_options:quantization_scale_type': 1,
'debug_level': 1,
"platform": "J7"
}
delegate_options = {}
delegate_options.update(compile_options)
so = rt.SessionOptions()
EP_list = ['TIDLCompilationProvider', 'CPUExecutionProvider']
sess = rt.InferenceSession(onnx_model_path, providers=EP_list,
provider_options=[delegate_options, {}],
sess_options=so)
# ...
output = sess.run(None, {...})
Specifically, the python script stops with "Bus error (core dumped)" when I call sess.run(...). Here's the backtrace when I run the script with gdb python3:
Thread 1 "python3" received signal SIGBUS, Bus error. 0x00007ffff7b70ded in ?? () from /lib/x86_64-linux-gnu/libc.so.6 (gdb) backtrace #0 0x00007ffff7b70ded in ?? () from /lib/x86_64-linux-gnu/libc.so.6 #1 0x00007fff40f09f06 in vxCreateUserDataObject () from /devel/edgeai-tidl-tools/tidl_tools/libvx_tidl_rt.so #2 0x00007fff40f0214c in TIDLRT_create () from /devel/edgeai-tidl-tools/tidl_tools/libvx_tidl_rt.so #3 0x00007fff4cc65cab in TIDL_subgraphRtCreate () from /devel/edgeai-tidl-tools/tidl_tools/tidl_model_import_onnx.so #4 0x00007fff4cc43dc6 in TIDL_computeImportFunc () from /devel/edgeai-tidl-tools/tidl_tools/tidl_model_import_onnx.so
If I comment out sess.run(...), the script then stops with a "Segmentation fault (core dumped)" instead. Here's the backtrace for that:
Thread 1 "python3" received signal SIGSEGV, Segmentation fault. 0x00007fff40f1707c in ownReleaseReferenceInt () from /devel/edgeai-tidl-tools/tidl_tools/libvx_tidl_rt.so (gdb) backtrace #0 0x00007fff40f1707c in ownReleaseReferenceInt () from /devel/edgeai-tidl-tools/tidl_tools/libvx_tidl_rt.so #1 0x00007fff40f02ba7 in TIDLRT_delete () from /devel/edgeai-tidl-tools/tidl_tools/libvx_tidl_rt.so #2 0x00007fff4cc660bf in TIDL_subgraphRtDelete () from /devel/edgeai-tidl-tools/tidl_tools/tidl_model_import_onnx.so
I have tested the removal of the "TIDLCompilationProvider" to only keep the "CPUExecutionProvider", and I'm then able to compile my artifacts and use them on my TDA4. I think this validates that there's no issue with the ONNX or my script.
# echo $LD_LIBRARY_PATH :/devel/edgeai-tidl-tools/tidl_tools:/devel/edgeai-tidl-tools/tidl_tools/osrt_deps # echo $ARM64_GCC_PATH /devel/edgeai-tidl-tools/gcc-arm-9.2-2019.12-x86_64-aarch64-none-linux-gnu # echo $TIDL_TOOLS_PATH /devel/edgeai-tidl-tools/tidl_tools # echo $SOC am68pa