Khadas vim3 Graph verify failed

453 views
Skip to first unread message

Etem Sezgin

unread,
Jun 30, 2022, 6:46:35 AM6/30/22
to doubango-ai
I'm trying to run ultimateALPR-SDK on khadas vim3
I followed the instructions you shared https://github.com/DoubangoTelecom/ultimateALPR-SDK/blob/master/AmlogicNPU.md

When I run "uname -a" on my device I see Linux Khadas 4.9.241 #739 SMP PREEMPT Fri Apr 29 10:15:28 CST 2022 aarch64 aarch64 aarch64 GNU/Linux

When I set --npu_enabled to true I get the following error

*[ULTALPR_SDK INFO]: Starting benchmark...
*[COMPV INFO]: [UltAlprSdkEngine] Call: init
*[COMPV INFO]: [UltAlprSdkEngine] jsonConfig: {"debug_level": "info","debug_write_input_image_enabled": false,"debug_internal_data_path": ".","gpgpu_enabled": true,"max_latency": -1,"klass_vcr_gamma": 1.5,"detect_roi": [0, 0, 0, 0],"detect_minscore": 0.1,"pyramidal_search_enabled": false,"pyramidal_search_sensitivity": 0.28,"pyramidal_search_minscore": 0.8,"pyramidal_search_min_image_size_inpixels": 800,"recogn_minscore": 0.3,"recogn_score_type": "min","assets_folder": "../../../assets","charset": "latin","num_threads": -1,"recogn_rectify_enabled": false,"ienv_enabled": false,"openvino_enabled": false,"openvino_device": "CPU","npu_enabled": true,"asm_enabled": true,"intrin_enabled": true,"klass_lpci_enabled": false,"klass_vcr_enabled": false,"klass_vmmr_enabled": false,"klass_vbsr_enabled": false}
*[COMPV INFO]: [UltAlprSdkEngine] **** Copyright (C) 2011-2021 Doubango Telecom <https://www.doubango.org> ****
ultimateALPR-SDK <https://github.com/DoubangoTelecom/ultimateALPR-SDK> version 3.9.0

*[COMPV INFO]: [CompVBase] Initializing [base] modules (v 1.0.0, nt -1)...
*[COMPV INFO]: [CompVBase] sizeof(compv_scalar_t)= #8
*[COMPV INFO]: [CompVBase] sizeof(float)= #4
*[COMPV INFO]: Initializing window registery
*[COMPV INFO]: [ImageDecoder] Initializing image decoder...
*[COMPV INFO]: [CompVCpu] H: 'Khadas VIM3', S: '***', M: '', MN: ''
*[COMPV INFO]: [CompVBase] CPU features: [arm];[arm64];neon;neon_fma;vfpv4;
*[COMPV INFO]: [CompVBase] CPU cores: online=#6, conf=#6
*[COMPV INFO]: [CompVBase] CPU cache1: line size: #64B, size :#0KB
*[COMPV INFO]: [CompVBase] CPU Phys RAM size: #1860GB
*[COMPV INFO]: [CompVBase] CPU endianness: LITTLE
*[COMPV INFO]: /!\ Code in file '/home/ultimate/compv/base/compv_base.cxx' in function 'init' starting at line #195: Not optimized -> Your ARM OS is neither Android nor Raspberry Pi nor iOS nor NVIDIA Jetson. You may miss some optimizations. Let us know what's your OS.
*[COMPV INFO]: [CompVBase] Binary type: AArch64
*[COMPV INFO]: [CompVBase] Intrinsic enabled
*[COMPV INFO]: [CompVBase] Assembler enabled
*[COMPV INFO]: [CompVBase] Code built with option /arch:NEON
*[COMPV INFO]: [CompVBase] OS name: Generic Linux
*[COMPV INFO]: [CompVBase] Math Fast Trig.: true
*[COMPV INFO]: [CompVBase] Math Fixed Point: true
*[COMPV INFO]: [CompVMathExp] Init
*[COMPV INFO]: [CompVBase] Default alignment: #32
*[COMPV INFO]: [CompVBase] Best alignment: #32
*[COMPV INFO]: [CompVBase] Heap limit: #262144KB (#256MB)
*[COMPV INFO]: [CompVParallel] Initializing [parallel] module...
*[COMPV INFO]: [CompVAsyncTask11] run(coreId:requested=0,set=useless, threadId:0x7fb4069170, kThreadSetAffinity:false) - ENTER
*[COMPV INFO]: [CompVAsyncTask11] run(coreId:requested=1,set=useless, threadId:0x7fb3868170, kThreadSetAffinity:false) - ENTER
*[COMPV INFO]: [CompVAsyncTask11] run(coreId:requested=2,set=useless, threadId:0x7fb3067170, kThreadSetAffinity:false) - ENTER
*[COMPV INFO]: [CompVAsyncTask11] run(coreId:requested=3,set=useless, threadId:0x7fb2866170, kThreadSetAffinity:false) - ENTER
*[COMPV INFO]: [CompVAsyncTask11] run(coreId:requested=4,set=useless, threadId:0x7fb2065170, kThreadSetAffinity:false) - ENTER
*[COMPV INFO]: [CompVThreadDispatcher] Thread dispatcher created with #6 threads/#6 cores
*[COMPV INFO]: [CompVParallel] [Parallel] module initialized
*[COMPV INFO]: [CompVBase] [Base] modules initialized
*[COMPV INFO]: [CompVAsyncTask11] run(coreId:requested=5,set=useless, threadId:0x7fb1864170, kThreadSetAffinity:false) - ENTER
*[COMPV INFO]: [CompVCore] Initializing [core] module (v 1.0.0)...
*[COMPV INFO]: [CompVFeature] Registering feature factory with id = 1 and name = 'FAST (Features from Accelerated Segment Test)'...
*[COMPV INFO]: [CompVFeature] Registering feature factory with id = 8 and name = 'ORB (Oriented FAST and Rotated BRIEF)'...
*[COMPV INFO]: [CompVFeature] Registering feature factory with id = 27 and name = 'Sobel edge detector'...
*[COMPV INFO]: [CompVFeature] Registering feature factory with id = 28 and name = 'Scharr edge detector'...
*[COMPV INFO]: [CompVFeature] Registering feature factory with id = 29 and name = 'Prewitt edge detector'...
*[COMPV INFO]: [CompVFeature] Registering feature factory with id = 20 and name = 'Canny edge detector'...
*[COMPV INFO]: [CompVFeature] Registering feature factory with id = 30 and name = 'Hough standard (STD)'...
*[COMPV INFO]: [CompVFeature] Registering feature factory with id = 31 and name = 'Kernel-based Hough transform (KHT)'...
*[COMPV INFO]: [CompVFeature] Registering feature factory with id = 41 and name = 'Standard Histogram of oriented gradients (S-HOG)'...
*[COMPV INFO]: [CompVMatcher] Registering matcher factory with id = 0 and name = 'Brute force matcher'...
*[COMPV INFO]: [CompVConnectedComponentLabeling] Registering connected component labeling factory with id = 1 and name = 'PLSL (Parallel Light Speed Labeling)'...
*[COMPV INFO]: [CompVConnectedComponentLabeling] Registering connected component labeling factory with id = 19 and name = 'LMSER (Linear Time Maximally Stable Extremal Regions)'...
*[COMPV INFO]: [CompVGL] Initializing [gl] module (v 1.0.0)...
*[COMPV INFO]: [CompVGL] GL module initialized
*[COMPV INFO]: [CompVGpu] Initializing [gpu] module (v 1.0.0)...
*[COMPV INFO]: [CompVCamera] Initializing [camera] module (v 1.0.0)...
*[COMPV INFO]: [CompVDrawing] Initializing [drawing] module (v 1.0.0)...
*[COMPV INFO]: [CompVDrawing] /!\ No jpeg decoder found
*[COMPV INFO]: [CompVDrawing] Drawing module initialized
*[COMPV INFO]: [UltAlprSdkEnginePrivate] Line in ../../../assets/models.amlogic_npu/supported_hardware.txt -> [Amlogic]
*[COMPV INFO]: [UltAlprSdkEnginePrivate] Line in ../../../assets/models.amlogic_npu/supported_hardware.txt -> [Khadas VIM3]
*[COMPV INFO]: [UltAlprSdkEnginePrivate] Your hardware (Khadas VIM3) is registered in ../../../assets/models.amlogic_npu/supported_hardware.txt
*[COMPV INFO]: [CompVGpu] GPU enabled: true
*[COMPV INFO]: /!\ Code in file '/home/ultimate/ultimateBase/lib/source/ultimate_base_engine.cxx' in function 'init' starting at line #82: Not optimized for GPU -> GPGPU computing not enabled or deactivated
*[COMPV INFO]: [UltBaseOpenCL] Trying to load [libOpenCL.so]
*[COMPV INFO]: [CompVSharedLib] Loading sharded library from libOpenCL.so
*[COMPV INFO]: [UltBaseOpenCL] Loaded [libOpenCL.so], looksLikeValid: yes...
*[COMPV INFO]: [UltBaseOpenCLUtils] Selected platform vendor: Vivante Corporation
*[COMPV INFO]: [UltBaseOpenCLUtils] deviceCount=1
*[COMPV INFO]: [UltBaseOpenCLUtils] Device -> name: Vivante OpenCL Device VIPNano-QI.7120.0000, id: 0x7fb4848028
*[COMPV INFO]: [UltBaseOpenCLUtils] CL_DEVICE_PREFERRED_VECTOR_WIDTH_FLOAT=4
*[COMPV INFO]: [UltBaseOpenCLUtils] CL_DEVICE_PREFERRED_VECTOR_WIDTH_DOUBLE=0
*[COMPV INFO]: [UltBaseOpenCLUtils] CL_DEVICE_MAX_COMPUTE_UNITS=1
*[COMPV INFO]: [UltBaseOpenCLUtils] CL_DEVICE_MAX_WORK_ITEM_DIMENSIONS=3
*[COMPV INFO]: [UltBaseOpenCLUtils] CL_DEVICE_MAX_WORK_ITEM_SIZES=256, 256, 256,
*[COMPV INFO]: [UltBaseOpenCLUtils] CL_DEVICE_MAX_WORK_GROUP_SIZE=256
*[COMPV INFO]: [UltBaseOpenCLUtils] CL_DEVICE_MAX_CLOCK_FREQUENCY=800 MHz
*[COMPV INFO]: [UltBaseOpenCLUtils] CL_DEVICE_GLOBAL_MEM_CACHELINE_SIZE=64 B
*[COMPV INFO]: [UltBaseOpenCLUtils] CL_DEVICE_GLOBAL_MEM_SIZE=268435456 B (256 MB)
*[COMPV INFO]: [UltBaseOpenCLUtils] CL_DEVICE_LOCAL_MEM_SIZE=32768 B (32 KB)
*[COMPV INFO]: [UltBaseOpenCLUtils] CL_DEVICE_MAX_MEM_ALLOC_SIZE=128 MB
*[COMPV INFO]: [UltBaseOpenCLUtils] CL_PLATFORM_VERSION=OpenCL 3.0 V6.4.8.7.415784
*[COMPV INFO]: [UltBaseOpenCLUtils] CL_DEVICE_VERSION=OpenCL 3.0
*[COMPV INFO]: [UltBaseOpenCLUtils] CL_DRIVER_VERSION=OpenCL 3.0 V6.4.8.7.415784
*[COMPV INFO]: [UltBaseOpenCLUtils] CL_DEVICE_OPENCL_C_VERSION=OpenCL C 1.2
*[COMPV INFO]: [UltBaseOpenCLUtils] CL_DEVICE_EXTENSIONS=cl_khr_byte_addressable_store cl_khr_fp16 cl_khr_il_program cl_khr_global_int32_base_atomics cl_khr_global_int32_extended_atomics cl_khr_local_int32_base_atomics cl_khr_local_int32_extended_atomics
*[COMPV INFO]: [UltBaseOpenCL] !!!Booom!!!, OpenCL successfully loaded [libOpenCL.so]
*[COMPV INFO]: [UltOcrEngine] Tensorflow version: 1.12.3
*[COMPV INFO]: [UltAlprPlugin] Loading plugin: /home/khadas/ultimateALPR-SDK/binaries/linux/aarch64/libultimatePluginAmlogicNPU.so ...
*[COMPV INFO]: [CompVSharedLib] Loading sharded library from /home/khadas/ultimateALPR-SDK/binaries/linux/aarch64/libultimatePluginAmlogicNPU.so
*[COMPV INFO]: [CompVSharedLib] Loaded shared lib: /home/khadas/ultimateALPR-SDK/binaries/linux/aarch64/libultimatePluginAmlogicNPU.so
*[COMPV INFO]: [UltAlprSdkEnginePrivate] **** Copyright (C) 2011-2022 Doubango Telecom <https://www.doubango.org> ****
You're using an unlicensed version of ultimateALPR-SDK <https://github.com/DoubangoTelecom/ultimateALPR-SDK>
without the rights to include the SDK in any form of commercial product.
*[COMPV INFO]: [UltAlprSdkEnginePrivate] IC took 0 millis
*[COMPV INFO]: [CompVCpu] Enabling asm code
*[COMPV INFO]: [CompVCpu] Enabling intrinsic code
*[COMPV INFO]: [UltAlprSdkEnginePrivate] The 4 first chars of your serial number: 290b
*[COMPV INFO]: [UltAlprSdkEnginePrivate] Line in ../../../assets/models.amlogic_npu/pid_serial_mapping.txt -> [0x7D,290a]
*[COMPV INFO]: [UltAlprSdkEnginePrivate] Line in ../../../assets/models.amlogic_npu/pid_serial_mapping.txt -> [0x88,290b]
*[COMPV INFO]: [UltAlprSdkEnginePrivate] Matched PID in ../../../assets/models.amlogic_npu/pid_serial_mapping.txt: [0x88]
*[COMPV INFO]: [UltAlprSdkEnginePrivate] recogn_tf_num_threads: 6, acceleration backend: AmlogicNPU
*[COMPV INFO]: [CompVThreadDispatcher] Not optimized -> Your system have #6 cores but you're only using #4. Sad!!
*[COMPV INFO]: [CompVAsyncTask11] run(coreId:requested=1,set=useless, threadId:0x7faeafd170, kThreadSetAffinity:false) - ENTER
*[COMPV INFO]: [CompVAsyncTask11] run(coreId:requested=2,set=useless, threadId:0x7fae2fc170, kThreadSetAffinity:false) - ENTER
*[COMPV INFO]: [CompVAsyncTask11] run(coreId:requested=0,set=useless, threadId:0x7faf2fe170, kThreadSetAffinity:false) - ENTER
*[COMPV INFO]: [CompVThreadDispatcher] Thread dispatcher created with #4 threads/#6 cores
*[COMPV INFO]: [CompVAsyncTask11] run(coreId:requested=3,set=useless, threadId:0x7fadafb170, kThreadSetAffinity:false) - ENTER
*[PLUGIN_AMLNPU INFO]: /!\ Code in file '/home/ultimateAmlogicNPU/pluginAmlogicNPU/source/plugin_amlnpu_interface.cxx' in function 'pluginAmlogicNPU_Engine_new' starting at line #113: Version: 1.0.0
****[PLUGIN_AMLNPU FATAL]: function: "pluginAmlDetect()"
file: "/home/ultimateAmlogicNPU/pluginAmlogicNPU/source/plugin_amlnpu_detect.cxx"
line: "59"
message: [pluginAmlDetect] Graph verify failed: -1 -> A generic error code, used when no other describes the error.
****[PLUGIN_AMLNPU FATAL]: function: "pluginAmlDetect()"
file: "/home/ultimateAmlogicNPU/pluginAmlogicNPU/source/plugin_amlnpu_detect.cxx"
line: "60"
message: Assertion failed!
Aborted

Mamadou DIOP

unread,
Jun 30, 2022, 6:26:03 PM6/30/22
to Etem Sezgin, doubango-ai
This is a generic error from OpenVX returned when the hardware doesn’t support the compiled version of the models.
What’s your Khadas Model (Basic, Pro…)? Mine is a Basic.

--
You received this message because you are subscribed to the Google Groups "doubango-ai" group.
To unsubscribe from this group and stop receiving emails from it, send an email to doubango-ai...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/doubango-ai/706dfbd3-44b5-4c8f-9e92-43ecd06ec532n%40googlegroups.com.

Mike Bedford

unread,
Jul 8, 2022, 4:26:25 PM7/8/22
to Mamadou DIOP, Etem Sezgin, doubango-ai
Did this ever get figured out? I got my VIM3 the other day and I am trying to get up and running, I have the exact same error. Below I have pasted the log. This is a VIM3 PRO.

Thanks!

*[ULTALPR_SDK INFO]: Starting benchmark...
*[COMPV INFO]: [UltAlprSdkEngine] Call: init
*[COMPV INFO]: [UltAlprSdkEngine] jsonConfig: {"debug_level": "info","debug_write_input_image_enabled": false,"debug_internal_data_path": ".","gpgpu_enabled": true,"max_latency": -1,"klass_vcr_gamma": 1.5,"detect_roi": [0, 0, 0, 0],"detect_minscore": 0.1,"pyramidal_search_enabled": false,"pyramidal_search_sensitivity": 0.28,"pyramidal_search_minscore": 0.8,"pyramidal_search_min_image_size_inpixels": 800,"recogn_minscore": 0.3,"recogn_score_type": "min","assets_folder": "../../../assets","charset": "latin","num_threads": -1,"recogn_rectify_enabled": false,"ienv_enabled": false,"openvino_enabled": false,"openvino_device": "CPU","npu_enabled": true,"asm_enabled": true,"intrin_enabled": true,"klass_lpci_enabled": false,"klass_vcr_enabled": false,"klass_vmmr_enabled": false,"klass_vbsr_enabled": false}
*[COMPV INFO]: [UltAlprSdkEngine] **** Copyright (C) 2011-2021 Doubango Telecom <https://www.doubango.org> ****
ultimateALPR-SDK <https://github.com/DoubangoTelecom/ultimateALPR-SDK> version 3.9.0

*[COMPV INFO]: [CompVBase] Initializing [base] modules (v 1.0.0, nt -1)...
*[COMPV INFO]: [CompVBase] sizeof(compv_scalar_t)= #8
*[COMPV INFO]: [CompVBase] sizeof(float)= #4
*[COMPV INFO]: Initializing window registery
*[COMPV INFO]: [ImageDecoder] Initializing image decoder...
*[COMPV INFO]: [CompVCpu] H: 'Khadas VIM3', S: '***', M: '', MN: ''
*[COMPV INFO]: [CompVBase] CPU features: [arm];[arm64];neon;neon_fma;vfpv4;
*[COMPV INFO]: [CompVBase] CPU cores: online=#6, conf=#6
*[COMPV INFO]: [CompVBase] CPU cache1: line size: #64B, size :#0KB
*[COMPV INFO]: [CompVBase] CPU Phys RAM size: #3707GB

*[COMPV INFO]: [CompVBase] CPU endianness: LITTLE
*[COMPV INFO]: /!\ Code in file '/home/ultimate/compv/base/compv_base.cxx' in function 'init' starting at line #195: Not optimized -> Your ARM OS is neither Android nor Raspberry Pi nor iOS nor NVIDIA Jetson. You may miss some optimizations. Let us know what's your OS.
*[COMPV INFO]: [CompVBase] Binary type: AArch64
*[COMPV INFO]: [CompVBase] Intrinsic enabled
*[COMPV INFO]: [CompVBase] Assembler enabled
*[COMPV INFO]: [CompVBase] Code built with option /arch:NEON
*[COMPV INFO]: [CompVBase] OS name: Generic Linux
*[COMPV INFO]: [CompVBase] Math Fast Trig.: true
*[COMPV INFO]: [CompVBase] Math Fixed Point: true
*[COMPV INFO]: [CompVMathExp] Init
*[COMPV INFO]: [CompVBase] Default alignment: #32
*[COMPV INFO]: [CompVBase] Best alignment: #32
*[COMPV INFO]: [CompVBase] Heap limit: #262144KB (#256MB)
*[COMPV INFO]: [CompVParallel] Initializing [parallel] module...
*[COMPV INFO]: [CompVAsyncTask11] run(coreId:requested=0,set=useless, threadId:0x7f94f5c170, kThreadSetAffinity:false) - ENTER
*[COMPV INFO]: [CompVAsyncTask11] run(coreId:requested=1,set=useless, threadId:0x7f9475b170, kThreadSetAffinity:false) - ENTER
*[COMPV INFO]: [CompVAsyncTask11] run(coreId:requested=2,set=useless, threadId:0x7f93f5a170, kThreadSetAffinity:false) - ENTER
*[COMPV INFO]: [CompVAsyncTask11] run(coreId:requested=3,set=useless, threadId:0x7f93759170, kThreadSetAffinity:false) - ENTER
*[COMPV INFO]: [CompVAsyncTask11] run(coreId:requested=4,set=useless, threadId:0x7f92f58170, kThreadSetAffinity:false) - ENTER

*[COMPV INFO]: [CompVThreadDispatcher] Thread dispatcher created with #6 threads/#6 cores
*[COMPV INFO]: [CompVAsyncTask11] run(coreId:requested=5,set=useless, threadId:0x7f92757170, kThreadSetAffinity:false) - ENTER

*[COMPV INFO]: [CompVParallel] [Parallel] module initialized
*[COMPV INFO]: [CompVBase] [Base] modules initialized
*[COMPV INFO]: [UltBaseOpenCLUtils] Device -> name: Vivante OpenCL Device VIPNano-QI.7120.0000, id: 0x7f9573b028

*[COMPV INFO]: [UltBaseOpenCLUtils] CL_DEVICE_PREFERRED_VECTOR_WIDTH_FLOAT=4
*[COMPV INFO]: [UltBaseOpenCLUtils] CL_DEVICE_PREFERRED_VECTOR_WIDTH_DOUBLE=0
*[COMPV INFO]: [UltBaseOpenCLUtils] CL_DEVICE_MAX_COMPUTE_UNITS=1
*[COMPV INFO]: [UltBaseOpenCLUtils] CL_DEVICE_MAX_WORK_ITEM_DIMENSIONS=3
*[COMPV INFO]: [UltBaseOpenCLUtils] CL_DEVICE_MAX_WORK_ITEM_SIZES=256, 256, 256,
*[COMPV INFO]: [UltBaseOpenCLUtils] CL_DEVICE_MAX_WORK_GROUP_SIZE=256
*[COMPV INFO]: [UltBaseOpenCLUtils] CL_DEVICE_MAX_CLOCK_FREQUENCY=800 MHz
*[COMPV INFO]: [UltBaseOpenCLUtils] CL_DEVICE_GLOBAL_MEM_CACHELINE_SIZE=64 B
*[COMPV INFO]: [UltBaseOpenCLUtils] CL_DEVICE_GLOBAL_MEM_SIZE=268435456 B (256 MB)
*[COMPV INFO]: [UltBaseOpenCLUtils] CL_DEVICE_LOCAL_MEM_SIZE=32768 B (32 KB)
*[COMPV INFO]: [UltBaseOpenCLUtils] CL_DEVICE_MAX_MEM_ALLOC_SIZE=128 MB
*[COMPV INFO]: [UltBaseOpenCLUtils] CL_PLATFORM_VERSION=OpenCL 3.0 V6.4.8.7.415784
*[COMPV INFO]: [UltBaseOpenCLUtils] CL_DEVICE_VERSION=OpenCL 3.0
*[COMPV INFO]: [UltBaseOpenCLUtils] CL_DRIVER_VERSION=OpenCL 3.0 V6.4.8.7.415784
*[COMPV INFO]: [UltBaseOpenCLUtils] CL_DEVICE_OPENCL_C_VERSION=OpenCL C 1.2
*[COMPV INFO]: [UltBaseOpenCLUtils] CL_DEVICE_EXTENSIONS=cl_khr_byte_addressable_store cl_khr_fp16 cl_khr_il_program cl_khr_global_int32_base_atomics cl_khr_global_int32_extended_atomics cl_khr_local_int32_base_atomics cl_khr_local_int32_extended_atomics
*[COMPV INFO]: [UltBaseOpenCL] !!!Booom!!!, OpenCL successfully loaded [libOpenCL.so]
*[COMPV INFO]: [UltOcrEngine] Tensorflow version: 1.12.3
*[COMPV INFO]: [UltAlprPlugin] Loading plugin: /home/khadas/ultimateALPR-SDK-master/binaries/linux/aarch64/libultimatePluginAmlogicNPU.so ...
*[COMPV INFO]: [CompVSharedLib] Loading sharded library from /home/khadas/ultimateALPR-SDK-master/binaries/linux/aarch64/libultimatePluginAmlogicNPU.so
*[COMPV INFO]: [CompVSharedLib] Loaded shared lib: /home/khadas/ultimateALPR-SDK-master/binaries/linux/aarch64/libultimatePluginAmlogicNPU.so

*[COMPV INFO]: [UltAlprSdkEnginePrivate] **** Copyright (C) 2011-2022 Doubango Telecom <https://www.doubango.org> ****
You're using an unlicensed version of ultimateALPR-SDK <https://github.com/DoubangoTelecom/ultimateALPR-SDK>
without the rights to include the SDK in any form of commercial product.
*[COMPV INFO]: [UltAlprSdkEnginePrivate] IC took 0 millis
*[COMPV INFO]: [CompVCpu] Enabling asm code
*[COMPV INFO]: [CompVCpu] Enabling intrinsic code
*[COMPV INFO]: [UltAlprSdkEnginePrivate] The 4 first chars of your serial number: 290b
*[COMPV INFO]: [UltAlprSdkEnginePrivate] Line in ../../../assets/models.amlogic_npu/pid_serial_mapping.txt -> [0x7D,290a]
*[COMPV INFO]: [UltAlprSdkEnginePrivate] Line in ../../../assets/models.amlogic_npu/pid_serial_mapping.txt -> [0x88,290b]
*[COMPV INFO]: [UltAlprSdkEnginePrivate] Matched PID in ../../../assets/models.amlogic_npu/pid_serial_mapping.txt: [0x88]
*[COMPV INFO]: [UltAlprSdkEnginePrivate] recogn_tf_num_threads: 6, acceleration backend: AmlogicNPU
*[COMPV INFO]: [CompVThreadDispatcher] Not optimized -> Your system have #6 cores but you're only using #4. Sad!!
*[COMPV INFO]: [CompVAsyncTask11] run(coreId:requested=0,set=useless, threadId:0x7f901f1170, kThreadSetAffinity:false) - ENTER
*[COMPV INFO]: [CompVAsyncTask11] run(coreId:requested=1,set=useless, threadId:0x7f8f9f0170, kThreadSetAffinity:false) - ENTER

*[COMPV INFO]: [CompVThreadDispatcher] Thread dispatcher created with #4 threads/#6 cores
*[COMPV INFO]: [CompVAsyncTask11] run(coreId:requested=2,set=useless, threadId:0x7f8f1ef170, kThreadSetAffinity:false) - ENTER
*[COMPV INFO]: [CompVAsyncTask11] run(coreId:requested=3,set=useless, threadId:0x7f8e9ee170, kThreadSetAffinity:false) - ENTER

*[PLUGIN_AMLNPU INFO]: /!\ Code in file '/home/ultimateAmlogicNPU/pluginAmlogicNPU/source/plugin_amlnpu_interface.cxx' in function 'pluginAmlogicNPU_Engine_new' starting at line #113: Version: 1.0.0
****[PLUGIN_AMLNPU FATAL]: function: "pluginAmlDetect()"
file: "/home/ultimateAmlogicNPU/pluginAmlogicNPU/source/plugin_amlnpu_detect.cxx"
line: "59"
message: [pluginAmlDetect] Graph verify failed: -1 -> A generic error code, used when no other describes the error.
****[PLUGIN_AMLNPU FATAL]: function: "pluginAmlDetect()"
file: "/home/ultimateAmlogicNPU/pluginAmlogicNPU/source/plugin_amlnpu_detect.cxx"
line: "60"
message: Assertion failed!
./run.sh: line 8: 85322 Aborted                 LD_LIBRARY_PATH=../../../binaries/linux/aarch64:$LD_LIBRARY_PATH ./benchmark --positive ../../../assets/images/lic_us_1280x720.jpg --negative ../../../assets/images/london_traffic.jpg --assets ../../../assets --charset latin --loops 100 --rate 0.2 --parallel true




--

Mamadou DIOP

unread,
Jul 8, 2022, 6:05:26 PM7/8/22
to Mike Bedford, Etem Sezgin, doubango-ai

The code was developed and tested for VIM3 Basic (https://github.com/DoubangoTelecom/ultimateALPR-SDK/blob/master/AmlogicNPU.md#Benchmarking_Running). Maybe the compiled models are not compatible with the Pro edition.

I haven't tested on Pro, will do it if a get one. Basic and Pro have same PID.

Mike Bedford

unread,
Jul 8, 2022, 8:23:47 PM7/8/22
to Mamadou DIOP, Etem Sezgin, doubango-ai
I highly doubt is is a pro versus basic issue (but I can certainly be wrong). Besides the fact that they have the same PID as you pointed out, looking at the specs between the two and literally the only difference between them is pro has more RAM and more eMMC space. Everything else that would matter and cause a difference (like the CPU, NPU, etc...) are the same. 

I think there is something else going on here. 

Could it be a permissions issue? I noticed that on Ubuntu, when I downloaded the SDK, none of the permissions had execute set. Apparently Linux does this and won't assume or default any files as executable. For example, in the pre-built binaries, where "Benchmark" and "Recognizer" are, they were not set as executable. When I first tried to run them, I got an error that the command could not be found. I then had to set them to executable and they worked. Maybe there are dependencies that Benchmark cannot run for the same reason? 

Speaking of, the folder/file in the error message, file: "/home/ultimateAmlogicNPU/pluginAmlogicNPU/source/plugin_amlnpu_detect.cxx", I cannot seem to find that folder /home/ultimateAmlogicNPU where does that come from?

Thanks!

Mamadou DIOP

unread,
Jul 9, 2022, 2:59:12 AM7/9/22
to Mike Bedford, Etem Sezgin, doubango-ai
The error message (“A generic error code, used when no other describes the error”) is from OpenVX, you can Google it. This means the image reached the NPU.

When I was developing the plugin I also looked at https://www.khadas.com/vim3 #Performance section and concluded that the Pro and Basic have the same CPU/GPU/NPU. So, I compiled the models and generated the *.nb (Network Binary files) on the basic hardware.

If i’m not wrong you have Jetson licenses. If that’s the case you have noticed that you had to build the models yourself in order to be able to use them on a device. The pipeline is "Tensorflow -> ONX -> Binary models”. For example, if you compile the models on Jetson AGX they won’t work on Jetson Nano. Same principles apply to Khadas. NVIDIA offers a clear and clean documentation on how to write the CUDA compiler while Khadas (and Amlogic) documentation is dirty with many hardcoded lines that you have to uncomment/patch (https://github.com/khadas/aml_npu_sdk). It’s a mess and they don’t provide documentation on how to write a compiler which means you cannot redistribute the IL code (intermediate).

I’ll order a Pro device and compile the models on it and see.

Mamadou DIOP

unread,
Jul 9, 2022, 3:08:13 AM7/9/22
to Mike Bedford, Etem Sezgin, doubango-ai
Additional message for why I think it’s Basic vs Pro: When I was dev the plugin I generated the binaries using the default scripts but the PID in Amlogic SDK was hardcoded at https://github.com/khadas/aml_npu_sdk/blob/591f6d358f2c7a2ce84e3b0dad612ab7c56828b0/acuity-toolkit/demo/2_export_case_code.sh#L17 . You can see that the PID is “VIPNANOQI_PID0X1E” which is not correct for VIM3 and I got the exact same error message (“A generic error code, used when no other describes the error”). Changed it to VIPNANOQI_PID0X88 and worked. I figured it out reading https://github.com/khadas/aml_npu_sdk/blob/master/docs/en/Model%20Transcoding%20and%20Running%20User%20Guide%20(1.0).pdf page 8 and 9.

Mike Bedford

unread,
Jul 9, 2022, 12:30:35 PM7/9/22
to Mamadou DIOP, Etem Sezgin, doubango-ai
Okay, understood. Thank you for looking into this in more detail for us all. It is crazy that they can have the same hardware specs and have the differences you described but I understand.

It would be good to get it working for the Pro too. Besides the advantages of double memory and storage space, which is a big deal, it turns out that the Pro is much more stocked and available than the basic. I was going to order a basic so I have one of each but it will be a while to get one. 

Is there anything I can do to help? I would be happy to give you remote access to my device even, if that will help any using a product similar to TeamViewer. 

Thanks!

Mike

Mike Bedford

unread,
Jul 9, 2022, 1:00:22 PM7/9/22
to Mamadou DIOP, Etem Sezgin, doubango-ai
Wait a minute!! I promise I am not doubting you. 😀

But I noticed that in the basic you worked with, serial started with 290b which maps to 0x88 as you mentioned in your email. 

My pro model also has the same serial which maps to the same 0x88 (this snippet is from my logs)

So, doesn't that indicate the same model and even it it doesn't, how are you going to detect difference between pro and basic if you can't use the serial number like Khadas says?

*[COMPV INFO]: [UltAlprSdkEnginePrivate] The 4 first chars of your serial number: 290b
*[COMPV INFO]: [UltAlprSdkEnginePrivate] Line in ../../../assets/models.amlogic_npu/pid_serial_mapping.txt -> [0x7D,290a]
*[COMPV INFO]: [UltAlprSdkEnginePrivate] Line in ../../../assets/models.amlogic_npu/pid_serial_mapping.txt -> [0x88,290b]
*[COMPV INFO]: [UltAlprSdkEnginePrivate] Matched PID in ../../../assets/models.amlogic_npu/pid_serial_mapping.txt: [0x88]
On Sat, Jul 9, 2022 at 12:08 AM Mamadou DIOP <diopm...@doubango.org> wrote:

Mamadou DIOP

unread,
Jul 9, 2022, 1:22:16 PM7/9/22
to Mike Bedford, Etem Sezgin, doubango-ai
Yes, they have same PID.

In your log, you have "CPU Phys RAM size: #3707GB". It should be different for Basic.

We have the code to retrieve info for the CPU features and RAM: https://github.com/DoubangoTelecom/compv/blob/master/base/compv_cpu.cxx

So, we'll be able to make the difference based on the RAM size for example.

I have ordered a Pro version and will have it on July 12.



Sent from my Galaxy
Speaking of, the folder/file in the error message, "gmail_quote">

Mike Bedford

unread,
Jul 9, 2022, 8:59:59 PM7/9/22
to Mamadou DIOP, Etem Sezgin, doubango-ai
Hello again! Sorry to be a pest. Thank you for getting a pro board and checking this. In the meantime, I decided to do some more checking on my end, in my environment, to make sure things are set up correctly. In doing so, I think I found another potential culprit for the issue. 

I am using the Ubuntu release provided by Khadas but I also did an update after the OS was installed. I saw this document: https://github.com/khadas/aml_npu_sdk/blob/master/docs/en/NN%20Integration%20Guide%20(0.2).pdf 

If you look at this section in the image below, they mention that the NN driver version on the board MUST match the transcoding tool and SDK you used when you created the models. I think this is a problem because there is no way to know what version you used versus what version all users that run the software may have and if this difference can cause issues, this is going to keep coming up. 

image.png

I decided to check my board and here is the result of the command they said to run on step 1: 
     [      12.622621] Galcore version 6.4.8.7.1.1.1

This version must be very new because it is not even listed in the table they show in the document on step 2, mine is newer than the last one. So, maybe the process of updating Ubuntu, updated the driver as well?

As a quick test, I could figure out how to manually roll back/install the appropriate driver version but to be precise, I would have to know what version you used and then hope/figure out I can find that version and install it. 

Another approach, as a quick test, would be for you to update to the newest driver version and re-do the model transcoding with the correct SDK and see if that fixes the issue. Either of these would confirm or rule out this as an issue. 

All of this is assuming that you aren't already on the same version I have on my device of course. 

Thoughts?

Thanks!

Mike

Etem Sezgin

unread,
Jul 12, 2022, 8:24:07 AM7/12/22
to doubango-ai
Hello there
 
  I don't think the problem is due to the pro or basic versions. I get the same error with khadas vim3 basic. I think maybe the difference is the image 

I use emmc imaj. Mamadou, can you try to install with this image?  

10 Temmuz 2022 Pazar tarihinde saat 03:59:59 UTC+3 itibarıyla mi...@ensight-technologies.com şunları yazdı:

Mamadou DIOP

unread,
Jul 12, 2022, 8:46:34 AM7/12/22
to Etem Sezgin, doubango-ai
Hi,


"You don't need to override the Android OS from the eMMC, install the Linux OS on an external SD card. Your Khadas will choose the OS on the SD card at boot time. This is the healthiest way to test NPU acceleration on Linux without overwriting the OS on the eMMC. Once you're happy with the result you could install the Linux OS on the eMMC which is faster than the SD card (memory read/write). You just need to remove the SD card for the boot loader to choose Android (on the eMMC) again."

Overriding my eMMC is a risky move as I have some data en configs I want to keep. I also want to keep the Android OS.

It's easier for you to install the OS we have recommended on SD card and see it works.

Mike Bedford

unread,
Jul 15, 2022, 12:38:18 AM7/15/22
to Mamadou DIOP, Etem Sezgin, doubango-ai
Etem, 

Thank you for confirming that it did not work on your basic model either, I am glad I did not buy a basic. Between less RAM and storage, it likely would not have solved the problem. 

My opinion on this, I understand you recommend that people install Linux to the SD card first but it should not be a problem is a user decides that Android is useless to them anyway and they go straight to installing Linux on the eMMC (which was the case for me, I have no use for Android at all). 

Aside from that, I followed your steps on the github page you linked exactly by installing the Linux 4.9 version from Khadas and doing an update, etc... I also ran the uname -a command and got a very similar result. So, I don't think there is an issue with my Linux installation or the way I installed it. 

In my opinion, I still think it comes down to the update step: "Make sure to upgrade your OS as explained at https://docs.khadas.com/linux/vim3/UpgradeSystem.html"

I think it is updating to a newer NPU driver than you used to create the models. Looking forward to what you find though. Thanks again for looking in to it. 

Mike. 

Mamadou DIOP

unread,
Jul 15, 2022, 12:45:53 AM7/15/22
to Mike Bedford, Etem Sezgin, doubango-ai
I have received my VIM3 Pro on Tuesday but unfortunately haven’t found time to check it yet.
Will let you know ASAP.

Mamadou DIOP

unread,
Jul 17, 2022, 7:41:40 PM7/17/22
to Mike Bedford, Etem Sezgin, doubango-ai

1/ I have burned the image at https://dl.khadas.com/Firmware/VIM3/Ubuntu/SD_USB/VIM3_Ubuntu-server-focal_Linux-4.9_arm64_SD-USB_V1.0.9-211217.img.xz on a SD-card on my Khadas VIM Pro. I haven't done any update.

    * `uname -a` gives me 'Linux Khadas 4.9.241 #22 SMP PREEMPT Fri Dec 17 17:34:50 CST 2021 aarch64 aarch64 aarch64 GNU/Linux'

    * checked out ultimateALPR current source (c03ad94)

    * as per https://github.com/DoubangoTelecom/ultimateALPR-SDK/blob/master/AmlogicNPU.md#running-on-khadas-vim3-basic-edition, ran `LD_LIBRARY_PATH=.:$LD_LIBRARY_PATH ./benchmark \
    --positive ../../../assets/images/lic_us_1280x720.jpg \
    --negative ../../../assets/images/london_traffic.jpg \
    --assets ../../../assets \
    --npu_enabled true \
    --charset latin \
    --loops 100 \
    --rate 1.0 \
    --parallel true > logs_pro.txt 2>&1`

    as you can see in the logs, everything went fine and the NPU is correctly used and I get the almost the same benchmark numbers as the Basic device (34fps with 33fps for rate=1.0)

2/ Did the same test with my Basic edition. `uname -a` gives me 'Linux Khadas 4.9.241 #8 SMP PREEMPT Sat Jan 8 09:27:25 CST 2022 aarch64 aarch64 aarch64 GNU/Linux' as this is the device with an up to date ROM and the one used to write https://github.com/DoubangoTelecom/ultimateALPR-SDK/blob/master/AmlogicNPU.md. I have also attached the output logs

3/ In the attached logs you can see this:

    * Basic: 'CPU Phys RAM size: #1860GB'

    * Pro: 'CPU Phys RAM size: #3707GB'

which confirms I really have a Pro device (who knows?)

4/ I have purchased my VIM3 Pro on Amazon France and you can check it https://www.amazon.fr/gp/product/B082SBR5HL/ref=ppx_yo_dt_b_asin_title_o00_s00?ie=UTF8&psc=1

5/ In our license manager I can see activations for Khadas Pro (based on the RAM size). I think we would have reports with other users had the same issue

logs_basic.txt
logs_pro.txt

Mike Bedford

unread,
Jul 19, 2022, 4:17:36 AM7/19/22
to Mamadou DIOP, Etem Sezgin, doubango-ai
Hello!

Thank you for the detailed testing and results. I decided to expand upon your testing to see what version(s) of Ubuntu will work and if I could find the root cause of why some of us are getting the failure. 

I noticed two differences in your recent test results:
1. You mentioned that you did NOT update (FYI, the instructions on your github page here https://github.com/DoubangoTelecom/ultimateALPR-SDK/blob/master/AmlogicNPU.md#running-on-khadas-vim3-basic-edition tell us to update in the third paragraph under "Operating System"). The update causing the failure has been sent as a theory as what is causing the failure in previous emails. 
2. You are using the headless server version of Ubuntu on the Khadas site. I had been using the Desktop version. 

Here are my results (summarized but I do have more details and grabbed the log files on each step if you want them). Of course, all of this is on my Khadas Pro.

1. Installed the newest headless server version from the Khadas site on the SD card, like you did in your last email. 
    -uname - a gives 'Linux Khadas 4.9.241 #22 SMP PREEMPT Fri Dec 17 17:34:50 CST 2021 aarch64 aarch64 aarch64 GNU/Linux'
    -Benchmark works fine on NPU, about 33fps. Logs show all is good. 

2. Installed the same headless server version on the eMMC instead of the SD card. 
   -uname -a gives 'Linux Khadas 4.9.241 #22 SMP PREEMPT Fri Dec 17 17:34:50 CST 2021 aarch64 aarch64 aarch64 GNU/Linux'
   -Benchmark still works fine on NPU, same fps, same logs. 

3. Did the update like your github says we should do on the same version in step 2 above that had just worked fine, as explained here: https://docs.khadas.com/linux/vim3/UpgradeSystem.html
   -uname -a gives 'Linux Khadas 4.9.241 #739 SMP PREEMPT Fri Apr 29 10:15:28 CST 2022 aarch64 aarch64 aarch64 GNU/Linux'
   -I now get the error!!! You can see that uname is different too. This pretty much confirms that the update is what causes the failure as suspected before.

4. As a final test, I installed the newest desktop version from the Khadas site on the eMMC.
   -uname -a gives 'Linux Khadas 4.9.241 #20 SMP PREEMPT Fri Dec 17 17:20:36 CST 2021 aarch64 aarch64 aarch64 GNU/Linux'
   -Benchmark works fine on NPU, no errors, logs look good. It should be noted that the fps is a little slower on desktop, 25fps. This is probably expected and might be able to be tuned to be increased?

Final thoughts:
1. Pro versus basic is not an issue.
2. Server/headless versus desktop is not an issue.
3. SD versus eMMC is not an issue. 
4. The only issue is doing the update. I guess either remove the note to make sure to update and instead tell us to not update OR figure out how to get it working on the newest version after the update?

That said, no rush, I can move forward for now by simply not doing the update since I have a working system now. 

Thank you!

Mike

Mamadou DIOP

unread,
Jul 19, 2022, 11:13:22 AM7/19/22
to Mike Bedford, Etem Sezgin, doubango-ai

- At https://github.com/DoubangoTelecom/ultimateALPR-SDK/blob/master/AmlogicNPU.md#operating-system the version we got after Upgrade was 'Linux Khadas 4.9.241 #8 SMP PREEMPT Sat Jan 8 09:27:25 CST 2022 aarch64 aarch64 aarch64 GNU/Linux' while you both got 'Linux Khadas 4.9.241 #739 SMP PREEMPT Fri Apr 29 10:15:28 CST 2022 aarch64 aarch64 aarch64 GNU/Linux'. You got a newer version (Jan 8 versus April 29). I'll change the documentation to remove the upgrade part and add a link to this thread.

- Desktop versions are always slower as rendering the UI will eat your CPU/GPU resources

Guy Coen

unread,
Jun 20, 2025, 3:05:54 AMJun 20
to doubango-ai
I have the same isse today. Using a KHADAS VIM3 Pro with image from the README
```
*[PLUGIN_AMLNPU INFO]: /!\ Code in file '/home/khadas/ultimateAmlogicNPU/pluginAmlogicNPU/source/plugin_amlnpu_interface.cxx' in function 'pluginAmlogicNPU_Engine_new' starting at line #113: Version: 1.0.0

****[PLUGIN_AMLNPU FATAL]: function: "pluginAmlDetect()"
file: "/home/khadas/ultimateAmlogicNPU/pluginAmlogicNPU/source/plugin_amlnpu_detect.cxx"
line: "59"
message: [pluginAmlDetect] Graph verify failed: -1 -> A generic error code, used when no other describes the error.
****[PLUGIN_AMLNPU FATAL]: function: "pluginAmlDetect()"
file: "/home/khadas/ultimateAmlogicNPU/pluginAmlogicNPU/source/plugin_amlnpu_detect.cxx"
line: "60"
message: Assertion failed!
```
`uname -a` command gives
```
Linux Khadas 4.9.241 #2 SMP PREEMPT Tue Apr 25 16:17:03 CST 2023 aarch64 aarch64 aarch64 GNU/Linux
```
Any ideas on how to solve this?

Mamadou DIOP

unread,
Jun 20, 2025, 4:27:04 AMJun 20
to Guy Coen, doubango-ai
Share full logs. Don't cut them



Sent from my Galaxy


-------- Original message --------
From: Guy Coen <gc...@cirrusled.com>
Date: 6/20/25 09:05 (GMT+01:00)
To: doubango-ai <douba...@googlegroups.com>
Subject: Re: Khadas vim3 Graph verify failed

I have the same isse today. Using a KHADAS VIM3 Pro with image from the README
```
*[PLUGIN_AMLNPU INFO]: /!\ Code in file '/home/khadas/ultimateAmlogicNPU/pluginAmlogicNPU/source/plugin_amlnpu_interface.cxx' in function 'pluginAmlogicNPU_Engine_new' starting at line #113: Version: 1.0.0
****[PLUGIN_AMLNPU FATAL]: function: "pluginAmlDetect()"
"/home/khadas/ultimateAmlogicNPU/pluginAmlogicNPU/source/plugin_amlnpu_detect.cxx"
line: "59"
message: [pluginAmlDetect] Graph verify failed: -1 -> A generic error code, used when no other describes the error.
****[PLUGIN_AMLNPU FATAL]: function: "pluginAmlDetect()"
...

Email truncated

Mamadou DIOP

unread,
Jun 20, 2025, 4:31:16 AMJun 20
to Guy Coen, doubango-ai
We already explained several times in the past why we haven't updated the NPU support to newest versions: in short, few licenses sold compared to jetson. Not worth the hassle 


...

Email truncated
Reply all
Reply to author
Forward
0 new messages