Thank you for your quick responses!
I see you only enabled the CpuAcc as backend in run_inference.py. In original example is only GpuAcc enabled as backend, and that’s where my issue is coming from. When I only enable the CpuAcc, it works just fine.
Here’s are all the steps I took to end up with the segmentation fault.
opencv-python==4.11.0.86
pillow==11.2.1
tflite-runtime
librosa==0.11.0
numpy==1.26.2
- Running the mobilenet inference I don’t get the segmentation fault, but a log line about not able to find any graphics library that is needed to utilize the GPU (GpuAcc is the only backend that is enable by default in the armnn_tflite repo mobilnet example).
$ python run_inference.py
Info: ArmNN v34.0.0
Couldn't find any of the following OpenCL library: libOpenCL.so libGLES_mali.so libmali.so
Info: Initialization time: 8.51 ms.
INFO: TfLiteArmnnDelegate: Requested unknown backend GpuAcc
Traceback (most recent call last):
File "/home/khadas/git/armnn_tflite/venv/lib/python3.10/site-packages/tflite_runtime/interpreter.py", line 166, in load_delegate
delegate = Delegate(library, options)
File "/home/khadas/git/armnn_tflite/venv/lib/python3.10/site-packages/tflite_runtime/interpreter.py", line 104, in __init__
raise ValueError(capture.message)
ValueError: TfLiteArmnnDelegate: No known backend specified.
- During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/home/khadas/git/armnn_tflite/mobilenet_v1/run_inference.py", line 42, in <module>
armnn_delegate = tflite.load_delegate(
File "/home/khadas/git/armnn_tflite/venv/lib/python3.10/site-packages/tflite_runtime/interpreter.py", line 168, in load_delegate
raise ValueError('Failed to load delegate from {}\n{}'.format(
ValueError: Failed to load delegate from ./libarmnnDelegate.so.29
TfLiteArmnnDelegate: No known backend specified.
Info: Shutdown time: 0.02 ms.
- When I run clinfo it says that there are no platforms available which suggests that the mali drivers are not installed.
$ clinfo
Number of platforms 0
ICD loader properties
ICD loader Name OpenCL ICD Loader
ICD loader Vendor OCL Icd free software
ICD loader Version 2.3.2
ICD loader Profile OpenCL 3.0
- I proceeded to follow the instructions on VIM3/3L OpenCL [Khadas Docs]. After running all the setup commands, I ran clinfo again. I do not post the whole output, since this would be very long. The output now shows that there’s a platform available:
$ clinfo
Number of platforms 1
Platform Name Portable Computing Language
Platform Vendor The pocl project
Platform Version OpenCL 3.0 PoCL 5.0+debian Linux, None+Asserts, RELOC, SPIR, LLVM 16.0.6, SLEEF, POCL_DEBUG
Platform Profile FULL_PROFILE
Platform Extensions cl_khr_icd cl_pocl_content_size
Platform Extensions with Version cl_khr_icd 0x400000 (1.0.0)
cl_pocl_content_size 0x400000 (1.0.0)
Platform Numeric Version 0xc00000 (3.0.0)
Platform Extensions function suffix POCL
Platform Host timer resolution 0ns
Platform Name Portable Computing Language
Number of devices 1
Device Name cpu--cortex-a53
Device Vendor ARM
Device Vendor ID 0x13b5
Device Version OpenCL 3.0 PoCL HSTR: cpu-aarch64-unknown-linux-gnu-(null)
Device Numeric Version 0xc00000 (3.0.0)
Driver Version 5.0+debian
Device OpenCL C Version OpenCL C 1.2 PoCL
...
- When I now run the inference again, the segfault returns:
$ python run_inference.py
Info: ArmNN v34.0.0
Segmentation fault
Conclusion: It looks like the install of graphics libraries isn’t entirely correct, since clinfo shows only the CPU as platform and I cannot use the ARM NN delegate once I followed the setup instructions on the official OpenCL page of Khadas.
Am I doing something wrong? Did I miss another setup page or something like that?