KL630, Error code: 102.

您好,我在WINDOWS上使用KL630-96Board進行開發

有透過SD卡更新KL630_96board_firmware_sdk2.5.5

我目前嘗試運行Kneron PLUS - Python的範例,在進行推理的範例時都會出現Error code: 102,錯誤資訊如下:

  • 執行ScanDevices.py結果
[0] USB scan index: '0'
[0] USB port ID: '4329621'
[0] Product ID: '0x630 (KL630)'
[0] USB link speed: 'UsbSpeed.KP_USB_SPEED_HIGH'
[0] USB port path: '1-5-1-1-1-1'
[0] KN number: '0xA8B105C'
[0] Connectable: 'True'
[0] Firmware: 'KDP2 Comp/U/L'
  • 執行GenericCommand.py結果
[Check Device]
 - success
[Connect Device]
 - target device: 'KL630'
 - scan index: '0'
 - port ID: '4329621'
 - command: 'system'
[System Information]
{
  "kn_number": "0xA8B105C",
  "firmware_version": "1.2.0-build.507"
}
[PLUS Version]
2.3.0
  • 執行KL630DemoGenericDataInference.py結果
[Connect Device]
 - Success
[Upload Firmware]
 - Success
[Set Device Timeout]
 - Success
[Upload Model]
 - Success
[Prepare NPU Inference Data]
 - Success
[Starting Inference Work]
 - Starting inference loop 100 times
 - - Error: inference failed, error = Error raised in function: generic_data_inference_receive. Error code: 102. Description: ApiReturnCode.KP_FW_DDR_MALLOC_FAILED_102
  • 執行KL630DemoGenericImageInferenceMultiThread.py結果
[Connect Device]
 - Success
[Set Device Timeout]
 - Success
[Upload Firmware]
 - Success
[Upload Model]
 - Success
[Read Image]
 - Success
[Starting Inference Work]
 - Starting inference loop 100 times
 - - Error: inference failed, error = Error raised in function: generic_image_inference_receive. Error code: 102. Description: ApiReturnCode.KP_FW_DDR_MALLOC_FAILED_102
 - Error: inference failed, error = Error raised in function: generic_image_inference_send. Error code: -7. Description: ApiReturnCode.KP_ERROR_USB_TIMEOUT_N7
Error: Result queue is empty !


  • 執行KL630DemoGenericImageInferencePostYolo.py結果
[Connect Device]
 - Success
[Set Device Timeout]
 - Success
[Upload Firmware]
 - Success
[Upload Model]
 - Success
[Read Image]
 - Success
[Starting Inference Work]
 - Starting inference loop 50 times
 -  - Error: inference failed, error = Error raised in function: generic_image_inference_receive. Error code: 102. Description: ApiReturnCode.KP_FW_DDR_MALLOC_FAILED_102


Comments

  • Hi FU-SYUAN,

    看起來是KL630的記憶體不足,請問KL630有同時執行其他程式嗎?

    請協助在執行python範例時,在KL630執行下面指令並將相關log提供給我這邊替您查看:

    1. ps

    2. cat /sys/class/vpl_edmc/footprint

    3. free -m

    謝謝。

  • 您好,執行範例過程中只有執行教學中程序,例如:KneronDFUT、透過telnet連到KL630,都算是外部連線到630,不知算不算占用系統資源,預設也有基本的rtsp串流,但沒有觀看。

    以下是執行KL630DemoGenericDataInference.py截取的資訊,再麻煩您協助了,感謝您。

    1. ps

    PID   USER     COMMAND
        1 root     init
        2 root     [kthreadd]
        3 root     [ksoftirqd/0]
        5 root     [kworker/0:0H]
        6 root     [kworker/u2:0]
        7 root     [lru-add-drain]
        8 root     [kdevtmpfs]
        9 root     [oom_reaper]
       10 root     [writeback]
       11 root     [kcompactd0]
       12 root     [crypto]
       13 root     [bioset]
       14 root     [kblockd]
       15 root     [cfg80211]
       16 root     [kworker/0:1]
       17 root     [watchdogd]
       18 root     [rpciod]
       19 root     [xprtiod]
       20 root     [kswapd0]
       21 root     [nfsiod]
       47 root     [bioset]
       48 root     [spi0]
       49 root     [kworker/u2:1]
       51 root     [bioset]
       52 root     [bioset]
       53 root     [bioset]
       54 root     [bioset]
       55 root     [bioset]
       56 root     [bioset]
       57 root     [spi1]
       59 root     [ipv6_addrconf]
       60 root     [kworker/0:2]
       61 root     [kworker/0:1H]
       75 root     /sbin/syslogd -n
       77 root     /sbin/klogd -n
      105 root     /usr/sbin/xinetd -pidfile /var/run/xinetd.pid
      111 root     [ubi_bgt0d]
      115 root     [ubifs_bgt0_0]
      197 root     ./rtsps -c stream_server_config.ini
      198 root     ./kp_firmware_host_stream
      199 root     -/bin/sh
      215 root     [sensor_queue]
      216 root     [sensor_queue]
      226 root     telnetd
      227 root     -sh
      236 root     watch free -m
      261 root     telnetd
      262 root     -sh
      304 root     watch ps
      407 root     telnetd
      408 root     -sh
      427 root     /sbin/watchdog -T 3 -t 2 /dev/watchdog
      452 root     /mnt/flash//plus/kp_daemon/bin/kp_daemon
      972 root     telnetd
      973 root     -sh
     1041 root     watch cat /sys/class/vpl_edmc/footprint
     1515 root     [kp_firmware]
     1572 root     /bin/sh -c ps
     1573 root     ps
    

    2. cat /sys/class/vpl_edmc/footprint

    DRAM 0 Forward allocated size: 61384702 bytes, Backward allocated size: 69771892 bytes, Total allocated size 131156594 bytes
    

    3. free -m

                 total       used       free     shared    buffers     cached
    Mem:            52         36         16          5          1         15
    -/+ buffers/cache:         19         33
    Swap:            0          0          0
    


  • Hi FU-SYUAN,

    有注意到您同時執行了kp_daemon及kp_firmware_host_stream,這會造成記憶體不足,

    如果您是要跑kneron plus的範例程式,建議重新燒入KL630_96board_firmware_for_kneron_plus_sdk2.5.5.zip的FW,

    該FW開機後預設只會執行plus所需的程式,因此不會碰到記憶體不足問題,

    請再試試看,如有任何問題請隨時聯繫我們。


    謝謝!

  • edited August 2024

    您好,我重刷SDK並測試結果還是102,下面是我測試的過程,再麻煩您協助,如我操作有誤再麻煩您告知

    我透過KL630_96board_User_Manual.pdf這份文件的 1.15 Firmware Update 透過SD卡完成更新,UART 輸出如附件:

    完成更新後,我開機就調出相關log,結果如下:


    DRAM 0 Forward allocated size: 61384510 bytes, Backward allocated size: 69771892 bytes, Total allocated size 131156402 bytes
    
                 total       used       free     shared    buffers     cached
    Mem:            52         34         18          0          1         15
    -/+ buffers/cache:         17         35
    Swap:            0          0          0
    


    透過KL630_96board_User_Manual.pdf這份文件的1.9 USB Device – PC (Kneron Plus)與電腦連接,再次調出相關log

    DRAM 0 Forward allocated size: 61384510 bytes, Backward allocated size: 69771892 bytes, Total allocated size 131156402 bytes
    
                 total       used       free     shared    buffers     cached
    Mem:            52         35         17          0          1         15
    -/+ buffers/cache:         18         34
    Swap:            0          0          0
    


    執行ScanDevices.py確認設備已連接

    scanning kneron devices ...
    number of Kneron devices found: 1
    listing devices infomation as follows:
    
    
    [0] USB scan index: '0'
    [0] USB port ID: '4329621'
    [0] Product ID: '0x630 (KL630)'
    [0] USB link speed: 'UsbSpeed.KP_USB_SPEED_HIGH'
    [0] USB port path: '1-5-1-1-1-1'
    [0] KN number: '0xA8B105C'
    [0] Connectable: 'True'
    [0] Firmware: 'KDP2 Loader/L'
    


    執行KL630DemoGenericDataInference.py測試推理

    [Connect Device]
     - Success
    [Upload Firmware]
     - Success
    [Set Device Timeout]
     - Success
    [Upload Model]
     - Success
    [Prepare NPU Inference Data]
     - Success
    [Starting Inference Work]
     - Starting inference loop 100 times
     -  - Error: inference failed, error = Error raised in function: generic_data_inference_receive. Error code: 102. Description: ApiReturnCode.KP_FW_DDR_MALLOC_FAILED_102
    


    這時候調用的log如下:

    DRAM 0 Forward allocated size: 61384510 bytes, Backward allocated size: 69771892 bytes, Total allocated size 131156402 bytes
    
                  total       used       free     shared    buffers     cached
    Mem:            52         47          5         11          1         21
    -/+ buffers/cache:         24         28
    Swap:            0          0          0
    


  • Hi FU-SYUAN,

    根據您提供的資訊應該是KL630燒錯firmware了,請再確認燒入的firmware是這包。


    謝謝!

  • 了解了,但我在https://www.kneron.com/en/support/developers/ 找不到相關的檔案

    請問我應該在那邊找到該檔案?

  • Hi FU-SYUAN,

    權限問題需要您聯繫最初接洽的業務處理,

    或是直接修改rc.loacl如下,修改後重新開機即會自動執行kneron plus所需程式,而不會另外執行host_stream。

    # cat /mnt/flash/etc/rc.local 
    #!/bin/sh
    cd /mnt/flash/vienna/drivers/;
    sh driver.sh;
    #cd /mnt/flash/vienna/;
    #sh ./start.sh;
    
    # "PLUS FW PART"
    # enable auto reboot when kernel panic
    echo 3 > /proc/sys/kernel/panic
    /sbin/watchdog -T 3 -t 2 /dev/watchdog
    
    #echo "plus_init"
    sh /mnt/flash/etc/plus_usb_companion_init.sh
    
  • 可正常運作了,感謝您

The discussion has been closed due to inactivity. To continue with the topic, please feel free to post a new discussion.