Update: VIM3/3L NPU Toolkit v6.4.2.1

Dear Khadas NPU Users,

The latest version of our VIM3 / 3L NPU Toolkit v6.4.2.1 has been updated into khadas.com and khadas.cn respectively, and download links have already been sent out to all those who have subscribed / applied for the toolkit previously.

Do note that our team is currently having the China National Day / Golden Week holiday, and we will respond to your queries (in this thread) after October 7th. For those in China, we wish you a happy holiday! And for those overseas, please stay safe and remember to take care of your loved ones.

Sincerely,
Khadas Team

6 Likes

Can someone put change log in this thread??

1 Like

Yes you’re right. Once @numbqq comes back from vacation, he’ll let us know. :slight_smile:

1 Like

I hope Tensorflow 2.x is now supported :crossed_fingers:

2 Likes

thanks !!! :)…

@Zeesh No, It not support TF2.0

@Archangel1235 It support more layers. You can check it with the docs in SDK

Great work, thanks! May I ask, when can we see NPU support for more recent kernel versions? The kernel module is closed source, am I correct?

Only 4.9 kernel support NPU now. No, the NPU dirver is open source.

Please check drivers/amlogic/npu/

2 Likes

Ah I missed it, thank you very much!

Hi community,
I used SDKv6.4.2.1 to transform my YOLOv3 which was trained for detecting just 1 class object to run on VIM3, but got an error linux_sdk/linux_sdk/common.target:101: bin_r/vnn_yolov3.o] Error 1 on command sudo sh ./build_vx.sh "/home/codelogist/Downloads/Persepolis/Compressed/aml_npu_sdk_6.4.2.1/linux_sdk/linux_sdk" as well as ./build_vx.sh "/home/codelogist/Downloads/Persepolis/Compressed/aml_npu_sdk_6.4.2.1/linux_sdk/linux_sdk while running these commands from /aml_npu_app/DDK_6.3.3.4/detect_library/model_code/detect_yolo_v3. I followed https://docs.khadas.com/vim3/HowToTransformYolo.html and converted the yolo weights into .nb and copied yolov3.nb, vnn_yolov3.c, vnn_yolov3.h into folders they are told to. Altough while running ./2_export_case_code.sh I got a Warning about no .lib file to be removed so I just removed *.lib from the last line of 2_export_case_code.sh. The stack trace is given below for ./build_vx.sh:

/home/codelogist/Downloads/Persepolis/Compressed/aml_npu_sdk_6.4.2.1/linux_sdk/linux_sdk/common.target:85: warning: overriding recipe for target 'bin_r/libnn_yolo_v3.so'
/home/codelogist/Downloads/Persepolis/Compressed/aml_npu_sdk_6.4.2.1/linux_sdk/linux_sdk/common.target:64: warning: ignoring old recipe for target 'bin_r/libnn_yolo_v3.so'
  COMPILE /home/codelogist/Downloads/Persepolis/Compressed/aml_npu_app/DDK_6.3.3.4/detect_library/model_code/detect_yolo_v3/vnn_yolov3.c
In file included from vnn_yolov3.c:16:0:
./include/vnn_yolov3.h:19:0: warning: "VNN_VERSION_MINOR" redefined
 #define VNN_VERSION_MINOR 1
 
In file included from vnn_yolov3.c:15:0:
./include/vnn_global.h:32:0: note: this is the location of the previous definition
 #define VNN_VERSION_MINOR 0
 
In file included from vnn_yolov3.c:16:0:
./include/vnn_yolov3.h:20:0: warning: "VNN_VERSION_PATCH" redefined
 #define VNN_VERSION_PATCH 21
 
In file included from vnn_yolov3.c:15:0:
./include/vnn_global.h:33:0: note: this is the location of the previous definition
 #define VNN_VERSION_PATCH 10
 
In file included from vnn_yolov3.c:16:0:
./include/vnn_yolov3.h:37:11: error: unknown type name ‘vsi_nn_preprocess_map_element_t’
     const vsi_nn_preprocess_map_element_t * pre_process_map,
           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
./include/vnn_yolov3.h:39:11: error: unknown type name ‘vsi_nn_postprocess_map_element_t’
     const vsi_nn_postprocess_map_element_t * post_process_map,
           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
vnn_yolov3.c:130:11: error: unknown type name ‘vsi_nn_preprocess_map_element_t’
     const vsi_nn_preprocess_map_element_t * pre_process_map,
           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
vnn_yolov3.c:132:11: error: unknown type name ‘vsi_nn_postprocess_map_element_t’
     const vsi_nn_postprocess_map_element_t * post_process_map,
           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
vnn_yolov3.c: In function ‘vnn_CreateYolov3’:
vnn_yolov3.c:288:77: error: request for member ‘graph_input_idx’ in something not a structure or union
         status = vsi_nn_AddGraphPreProcess(graph, pre_process_map[i].graph_input_idx,
                                                                     ^
vnn_yolov3.c:289:70: error: request for member ‘preprocesses’ in something not a structure or union
                                                   pre_process_map[i].preprocesses,
                                                                     ^
vnn_yolov3.c:290:70: error: request for member ‘preprocess_count’ in something not a structure or union
                                                   pre_process_map[i].preprocess_count);
                                                                     ^
vnn_yolov3.c:299:80: error: request for member ‘graph_output_idx’ in something not a structure or union
       status = vsi_nn_AddGraphPostProcess(graph, post_process_map[i].graph_output_idx,
                                                                     ^
vnn_yolov3.c:300:73: error: request for member ‘postprocesses’ in something not a structure or union
                                                  post_process_map[i].postprocesses,
                                                                     ^
vnn_yolov3.c:301:73: error: request for member ‘postprocess_count’ in something not a structure or union
                                                  post_process_map[i].postprocess_count);
                                                                     ^
vnn_yolov3.c:145:29: warning: unused variable ‘data’ [-Wunused-variable]
     uint8_t *               data;
                             ^~~~
At top level:
vnn_yolov3.c:94:17: warning: ‘load_data’ defined but not used [-Wunused-function]
 static uint8_t* load_data
                 ^~~~~~~~~
make: *** [/home/codelogist/Downloads/Persepolis/Compressed/aml_npu_sdk_6.4.2.1/linux_sdk/linux_sdk/common.target:101: bin_r/vnn_yolov3.o] Error 1

Although, when I used SDKv6.4.0.10 to generate .nb, .c and .h files and used linux_dir argument as the path of linux_sdk from SDKv6.4.0.10 it was able to generate vnn_yolov3.o and .so files into bin_r folder.

Can anyone please guide me to solution for this? I don’t know why is this happening, also the the size of yolov3.data file generated by older SDK is larger than generated by newer sdk, the difference is about 100MB. I don’t know is it relevant or not.

I think the documentation on: https://docs.khadas.com/vim3/HowToTransformYolo.html#Build-the-source-code is out-dated as we don’t need path/to/fenix_dir now, there are lot of changes made after that, also there are lot of DDK versions available in aml_apu_app, when to use which one is pretty confussing. Also, there is change in 1_quantize_model.sh and 2_export_case_code.sh files, are they causing the issue?

Can someone clearify my doubts please :)?

Regards.

1 Like

@CodeLogist I already know the information about this error, we will fix this problem, and I will reply here after the fix

3 Likes

Thanks @Frank, I thought I was the only one getting these errors😅. So, I should use the older SDK for now right?

@CodeLogist Not one . Anyone who uses the latest SDK will have this problem, I will solve it as soon as possible

@Frank Is there a bug with aml_npu_demo_binaries also? Before even for the khadas’s version without any modifications, its showing Segmentation Fault on MIPI camera in FrameBuffer mode for command:
./detect_demo_mipi_fb /dev/video0 2 off and ./detect_demo_mipi_fb /dev/video0 2 off > /dev/null both

And for the X11 Demo it shows the same error as shown in the picture.

Can you please help me?

@CodeLogist No, the origin demo work fine . Have you made any changes?

1 Like

@Frank, No I have changed nothing. I was just trying to run the Khadas’s version of aml_npu_demo_app.

@CodeLogist Did you update you system ? If you use 200530 , you should update you system .