wiki:kinaraai

Version 2 (modified by Ryan Erbstoesser, 8 hours ago) ( diff )

update with new info.

Kinara AI

Create an account at https://support.kinara.ai/

Hardware

Download the ara2-sdk onto your host and extract it. It should create a folder named 'art'

Instructions are in the README_linux_aarch64.txt file inside the extracted folder.

Copy the 'art' folder to the Gateworks SBC with something like scp.

Verify the Kinara card is detected on the PCIe bus:

root@noble-venice:~/art/linux/aarch64/hw_utils# lspci
81:00.0 Processing accelerators: Device 1e58:0002 (rev 02)

Insert the uiodma module:

insmod art/linux/drivers/uiodma/uiodma.ko  
sudo echo "1e58 0002" > /sys/bus/pci/drivers/uiodma/new_id

Get Chip info:

root@noble-venice:~/art/linux# ./aarch64/hw_utils/bins/chip_info_aarch64 -e 0
Kinara Inc. Silicon utilities version 0.5.9

Run directory: /root/art/linux
./aarch64/hw_utils/bins/chip_info_aarch64 -e 0 

[I:20260123:00:02:36:178031] [] [kinara_main_635][IODeviceManager] enumerate ara2 pci devices
[I:20260123:00:02:36:405024] [] [kinara_main_635][IODeviceManager] path= /sys/devices/platform/soc@0/33800000.pcie/pci0000:00/0000:00:00.0/0000:01:00.0/0000:02:03.0/0000:81:00.0/
[I:20260123:00:02:36:405187] [] [kinara_main_635][IODeviceManager] instance name: IODeviceManager, found an ara2 pci device at: /sys/devices/platform/soc@0/33800000.pcie/pci0000:00/0000:00:00.0/0000:01:00.0/0000:02:03.0/0000:81:00.0/
[I:20260123:00:02:36:405372] [] [kinara_main_635][pci_io_00:81.0] cache management 0
[I:20260123:00:02:36:405398] [] [kinara_main_635][pci_io_00:81.0] instance name: Ara2PcieIO_0, ara2 pci device folder path: /sys/devices/platform/soc@0/33800000.pcie/pci0000:00/0000:00:00.0/0000:01:00.0/0000:02:03.0/0000:81:00.0/
[I:20260123:00:02:36:405521] [] [kinara_main_635][pci_io_00:81.0] instance name: Ara2PcieIO_0, phy0=0x18700000 phy1=0x18500000 phy2=0x18600000
[I:20260123:00:02:36:411041] [] [kinara_main_635][pci_io_00:81.0] enabling pcie_ste_dma for device 
[W:20260123:00:02:36:411150] [] [kinara_main_635][pci_io_00:81.0] instance name: Ara2PcieIO_0, uiodma addr is : 0x7b000000
[I:20260123:00:02:36:411293] [] [kinara_main_635][pci_io_00:81.0] successfully enabled pcie_ste_dma for pcie device
[I:20260123:00:02:36:421550] [] [kinara_main_635][pci_io_00:81.0] instance name: Ara2PcieIO_0, vendor=0x1e58 product=0x2
[I:20260123:00:02:36:422136] [] [kinara_main_635][pci_io_00:81.0] Calling pcie tl clock programming, removing pcie clock from bypass
[W:20260123:00:02:36:425541] [ChipInfo] [kinara_main_635][ChipInfo] ara_physical_id:  0
[I:20260123:00:02:36:426262] [] [task_request_queue_processing_task_runner0_640][ChipInfoRequest] BOOT SUCCESS
[I:20260123:00:02:36:426304] [] [task_request_queue_processing_task_runner0_640][ChipInfoRequest] HIF IS ENABLED
[I:20260123:00:02:36:527551] [ChipInfo] [kinara_main_635][ChipInfo] Request Done 
[I:20260123:00:02:36:532629] [ChipInfo] [kinara_main_635][ChipInfo] chip info for the devices connected
 +-----------+---------------+----------------------------------------------+
| Tool      | Device Number | Info                                         |
+-----------+---------------+----------------------------------------------+
| Chip Info | 0, strap:0    | +-----------------------------+------------+ |
|           |               | | Parameter                   | Value      | |
|           |               | +-----------------------------+------------+ |
|           |               | | chip_id                     | Ara2 A01   | |
|           |               | | bus_id                      | 0:129:0    | |
|           |               | | if_type                     | PCIE       | |
|           |               | | chip_physical_id            | 0          | |
|           |               | | pcie_present                | 1          | |
|           |               | | usb_present                 | 0          | |
|           |               | | ddr_present                 | 1          | |
|           |               | | jtag_present                |            | |
|           |               | | sys_frequency               | 25 MHz     | |
|           |               | | neural_processor_frequency  | 25 MHz     | |
|           |               | | control_processor_frequency | 25 MHz     | |
|           |               | | ddr_frequency               | 25 MHz     | |
|           |               | | ddr_mfr                     |            | |
|           |               | | ddr_size                    | NA         | |
|           |               | | flash_mfr                   | NA         | |
|           |               | | flash_size                  | NA         | |
|           |               | | num_flash_images            | NA         | |
|           |               | | dev_temp1                   | 21.07 C    | |
|           |               | | voltage1                    | 0.788796 V | |
|           |               | | last power state            | NA         | |
|           |               | | current power state         | L1         | |
|           |               | | boot_status                 | 1          | |
|           |               | | internal_mem_size           | 8 MB       | |
|           |               | | life_cycle                  | TESTED     | |
|           |               | | firmware_version(raw)       | 32779      | |
|           |               | | firmware_version            | 0.128.11   | |
|           |               | +-----------------------------+------------+ |
|           |               |                                              |
+-----------+---------------+----------------------------------------------+

root@noble-venice:~/art/linux# 

Program the Flash (one time only):

./bins/program_flash_aarch64 -e 0 -f ./boot_img/willow_therm.hex
<reboot the host/ reset ara device to get new firmware loaded on ara device>

Activate the chip:

root@noble-venice:~/art/linux/aarch64/hw_utils# ./bins/active_enable_aarch64 -e 0 -m 2
Kinara Inc. Silicon utilities version 0.5.9

Run directory: /root/art/linux/aarch64/hw_utils
./bins/active_enable_aarch64 -e 0 -m 2 

[I:20260129:17:16:09:595108] [] [kinara_main_678][Active_Enable] In run phase of Flash image
[I:20260129:17:16:09:595458] [] [kinara_main_678][Active_Enable] Device Found Done ara-physical-id= 0
[I:20260129:17:16:09:595487] [] [kinara_main_678][IODeviceManager] enumerate ara2 pci devices
[I:20260129:17:16:09:794621] [] [kinara_main_678][IODeviceManager] path= /sys/devices/platform/soc@0/33800000.pcie/pci0000:00/0000:00:00.0/0000:01:00.0/
[I:20260129:17:16:09:794732] [] [kinara_main_678][IODeviceManager] instance name: IODeviceManager, found an ara2 pci device at: /sys/devices/platform/soc@0/33800000.pcie/pci0000:00/0000:00:00.0/0000:01:00.0/
[I:20260129:17:16:09:794880] [] [kinara_main_678][pci_io_00:01.0] cache management 0
[I:20260129:17:16:09:794901] [] [kinara_main_678][pci_io_00:01.0] instance name: Ara2PcieIO_0, ara2 pci device folder path: /sys/devices/platform/soc@0/33800000.pcie/pci0000:00/0000:00:00.0/0000:01:00.0/
[I:20260129:17:16:09:795008] [] [kinara_main_678][pci_io_00:01.0] instance name: Ara2PcieIO_0, phy0=0x18300000 phy1=0x18100000 phy2=0x18200000
[I:20260129:17:16:09:798594] [] [kinara_main_678][pci_io_00:01.0] enabling pcie_ste_dma for device 
[W:20260129:17:16:09:798675] [] [kinara_main_678][pci_io_00:01.0] instance name: Ara2PcieIO_0, uiodma addr is : 0xf0a00000
[I:20260129:17:16:09:798777] [] [kinara_main_678][pci_io_00:01.0] successfully enabled pcie_ste_dma for pcie device
[I:20260129:17:16:09:805173] [] [kinara_main_678][pci_io_00:01.0] instance name: Ara2PcieIO_0, vendor=0x1e58 product=0x2
[I:20260129:17:16:09:807783] [] [kinara_main_678][pci_io_00:01.0] Calling pcie tl clock programming, removing pcie clock from bypass
[I:20260129:17:16:09:808154] [] [kinara_main_678][Active_Enable] [CTEST]: SBP Ready for Runtime Command

[I:20260129:17:16:09:808182] [] [kinara_main_678][Active_Enable] [CTEST]: HIF is SETUP
[I:20260129:17:16:09:808197] [] [kinara_main_678][Active_Enable] Entering State Full PRD 2
[I:20260129:17:16:09:808214] [] [kinara_main_678][Active_Enable] {} 4
[I:20260129:17:16:09:808251] [] [kinara_main_678][Active_Enable] [CTEST]: Pushed HIF req Type :   211 1 1
[I:20260129:17:16:09:808265] [] [kinara_main_678][Active_Enable] [CTEST]: Pushed HIF req occ :  32
[I:20260129:17:16:09:808629] [] [kinara_main_678][Active_Enable] {} 4
[I:20260129:17:16:09:808673] [] [kinara_main_678][Active_Enable] [CTEST]: HIF response 0
[I:20260129:17:16:09:808693] [] [kinara_main_678][Active_Enable] [CTEST]: CMD_TYPE   211
[I:20260129:17:16:09:808711] [] [kinara_main_678][Active_Enable] [CTEST]: CMD_ID     1
[I:20260129:17:16:09:808728] [] [kinara_main_678][Active_Enable] [CTEST]: QID_ID     1
[I:20260129:17:16:09:808746] [] [kinara_main_678][Active_Enable] [CTEST]: HIF PS Read Response
[I:20260129:17:16:09:808765] [] [kinara_main_678][Active_Enable] [CTEST]: Status :   0
[I:20260129:17:16:09:808782] [] [kinara_main_678][Active_Enable] [CTEST]: PS Response Data Status :   0
[I:20260129:17:16:09:808799] [] [kinara_main_678][Active_Enable] [CTEST]: PS Response Data Current Power State :   2
[I:20260129:17:16:09:808816] [] [kinara_main_678][Active_Enable] [CTEST]: PS Response Data PVT_LOCK :  0
[I:20260129:17:16:09:808836] [] [kinara_main_678][Active_Enable] [CTEST]: TEST PASSED 

Configure the DRAM:

root@noble-venice:~/art/linux/aarch64/hw_utils# ./bins/ddr_unified_config_aarch64 -e 0 -s 1 -g 1 -l 3 -w 2 -f 0 -n 0 -u 0 -m 0 -r 0 -b willow -o ./ddr_config/ddr_cfg_35.bin
Kinara Inc. Silicon utilities version 0.5.9

Run directory: /root/art/linux/aarch64/hw_utils
./bins/ddr_unified_config_aarch64 -e 0 -s 1 -g 1 -l 3 -w 2 -f 0 -n 0 -u 0 -m 0 -r 0 -b willow -o ./ddr_config/ddr_cfg_35.bin 

[I:20260129:17:17:05:155740] [] [kinara_main_706][IODeviceManager] enumerate ara2 pci devices
[I:20260129:17:17:05:343281] [] [kinara_main_706][IODeviceManager] path= /sys/devices/platform/soc@0/33800000.pcie/pci0000:00/0000:00:00.0/0000:01:00.0/
[I:20260129:17:17:05:343392] [] [kinara_main_706][IODeviceManager] instance name: IODeviceManager, found an ara2 pci device at: /sys/devices/platform/soc@0/33800000.pcie/pci0000:00/0000:00:00.0/0000:01:00.0/
[I:20260129:17:17:05:343538] [] [kinara_main_706][pci_io_00:01.0] cache management 0
[I:20260129:17:17:05:343558] [] [kinara_main_706][pci_io_00:01.0] instance name: Ara2PcieIO_0, ara2 pci device folder path: /sys/devices/platform/soc@0/33800000.pcie/pci0000:00/0000:00:00.0/0000:01:00.0/
[I:20260129:17:17:05:343663] [] [kinara_main_706][pci_io_00:01.0] instance name: Ara2PcieIO_0, phy0=0x18300000 phy1=0x18100000 phy2=0x18200000
[I:20260129:17:17:05:346269] [] [kinara_main_706][pci_io_00:01.0] enabling pcie_ste_dma for device 
[W:20260129:17:17:05:346327] [] [kinara_main_706][pci_io_00:01.0] instance name: Ara2PcieIO_0, uiodma addr is : 0xf0a00000
[I:20260129:17:17:05:346428] [] [kinara_main_706][pci_io_00:01.0] successfully enabled pcie_ste_dma for pcie device
[I:20260129:17:17:05:351159] [] [kinara_main_706][pci_io_00:01.0] instance name: Ara2PcieIO_0, vendor=0x1e58 product=0x2
[I:20260129:17:17:05:353537] [] [kinara_main_706][pci_io_00:01.0] Calling pcie tl clock programming, removing pcie clock from bypass
[I:20260129:17:17:05:353868] [] [kinara_main_706][ddr_unified_config] Configuring DDR now. Approxmiate time to complete: 60 seconds.
[I:20260129:17:17:05:353894] [] [kinara_main_706][ddr_unified_config] UNIFIED CFG BIN LOADING
[I:20260129:17:17:36:009795] [] [kinara_main_706][ddr_unified_config] DDR configuation successful. DDR BIST: PASSED

Activate Proxy: (change config/proxy_config.yaml if you want to run in background)

root@noble-venice:~/art/linux/aarch64/proxy# sudo ./proxy_aarch64 -c ../../config/proxy_config.yaml

Kinara Inc. Silicon utilities version 0.5.9

Run directory: /root/art/linux/aarch64/proxy
./proxy_aarch64 -c ../../config/proxy_config.yaml 

[I:20260129:17:23:04:425472] [] [kinara_main_764][GlobalLogger] 
root@noble-venice:~/art/linux/aarch64/proxy# ps -aef | grep prox
root         766       1  9 17:23 ?        00:00:00 ./proxy_aarch64 -c ../../config/proxy_config.yaml

Download a sample yolov8n model (.dvm file) and untar:

  • Download URL (may require access to support.kinara.ai portal)
  • Transfer to Gateworks SBC and untar:
    root@noble-venice:~/art/linux/aarch64/nnapp# wget 172.24.20.26/kinara/sdk_model_compile.tar.gz
    --2026-01-29 17:26:52--  http://192.168.1.1/kinara/sdk_model_compile.tar.gz
    Connecting to 172.24.20.26:80... connected.
    HTTP request sent, awaiting response... 200 OK
    Length: 23754978 (23M) [application/x-gtar-compressed]
    Saving to: ‘sdk_model_compile.tar.gz’
    
    sdk_model_compile.tar.gz                        100%[=====================================================================================================>]  22.65M   112MB/s    in 0.2s    
    
    2026-01-29 17:26:52 (112 MB/s) - ‘sdk_model_compile.tar.gz’ saved [23754978/23754978]
    root@noble-venice:~/art/linux/aarch64/nnapp# tar -xvf sdk_model_compile.tar.gz
    

Either change the input path to the model, or move the model to /tmp

Modify the ../../config/nnapp_config.yaml and change the input_path in the async section:

async:
        # if this flag is TRUE, then the input directory of each model is iterated only once.
        # else, the input directory is iterated for model_param.batch_size * model_param.iterations times
        run_once_and_for_all: False
        utilization_stats: False
        # dump outputs with timestamp
        dump_with_timestamp: False
        # this section contains all the model related params for infer async mode
        models:
          0:
            name: "model1"
            path: "/tmp/model.dvm"
            input_path: ""
            output_path: ""

Execute the sample model run:

root@noble-venice:~/art/linux/aarch64/nnapp# ./nnapp_aarch64 --config ../../config/nnapp_config.yaml
[W:20260129:17:29:41:832406] [] [n/a_-1][config] default YAML file not found  ./config.yaml , specify yaml path
Kinara, Inc.

*---------------------------------------------------------------*
*              Neural Network Inference Application             *
*    Copyright(c) 2018-23, Kinara, Inc. All rights reserved.    *
*---------------------------------------------------------------*

Run: 
working directory: /root/art/linux/aarch64/nnapp
./nnapp_aarch64 --config ../../config/nnapp_config.yaml 
the app expects the inputs as raw tensors. The inputs are assumed to be preprocessed and written to a file
the inputs have to be in the below format:
<input_image_name>/quantized/layer<layer_id>-<blob_name>-<blob_id>_input_dv.dat
and the golden inputs in the below format:
<input_image_name>/quantized/<layer_name>-<layer_id>-<blob_name>-<blob_id>
[I:20260129:17:29:41:898866] [] [main_807][model_parameters] empty input_path for model= model1 , setting output_path and golden_output_path to none
[I:20260129:17:29:41:903483] [] [main_807][BaseApp] connected to proxy socket: IP_Address= 127.0.0.1  port= 5000
[I:20260129:17:29:41:904161] [] [main_807][BaseApp] 
 +------------+-----------------+
| Product    | Current Version |
+------------+-----------------+
| client_lib | 1.3.0.0         |
| firmware   | 0.128.11.0      |
| proxy      | 1.3.0.0         |
| sysapi     | 1.1.61.0        |
+------------+-----------------+

[I:20260129:17:29:41:904950] [] [main_807][BaseApp] 
 +------------+--------------------+
| Product    | Supported Versions |
+------------+--------------------+
| client_lib | 1.0.0.0            |
| client_lib | 1.1.1.0            |
| client_lib | 1.1.2.0            |
| client_lib | 1.3.0.0            |
| cnn_model  | 2.0.0.0            |
| cnn_model  | 2.1.0.0            |
| firmware   | 0.5.2.0            |
| firmware   | 1.1.2.0            |
| llm_model  | 3.0.0.0            |
| llm_model  | 3.1.0.0            |
| pci_driver | 1.0.4.0            |
| pci_driver | 1.0.6.6            |
| proxy      | 0.8.0.0            |
| proxy      | 0.9.0.0            |
| proxy      | 1.1.1.0            |
| proxy      | 1.3.0.0            |
+------------+--------------------+

[I:20260129:17:29:41:905463] [] [main_807][BaseApp] found endpoints: count= 1
[I:20260129:17:29:41:905908] [] [main_807][BaseApp] creation of endpoint group successful: model= model1
[I:20260129:17:29:41:984637] [] [main_807][BaseApp] model load successful: model= model1
[I:20260129:17:29:42:011215] [] [task_print_device_stats_812][Stats] temperature= 36.2557 ep status:  DV_ENDPOINT_STATE_ACTIVE  0x1000608c:   15d0200
[I:20260129:17:29:42:072253] [] [main_807][AsyncApp] completed iteration= 1
[I:20260129:17:29:42:145357] [] [main_807][AsyncApp] completed iteration= 2
[I:20260129:17:29:42:218729] [] [main_807][AsyncApp] completed iteration= 3
[I:20260129:17:29:42:291966] [] [main_807][AsyncApp] completed iteration= 4
[I:20260129:17:29:42:365203] [] [main_807][AsyncApp] completed iteration= 5
[I:20260129:17:29:42:437872] [] [main_807][AsyncApp] completed iteration= 6
[I:20260129:17:29:42:510537] [] [main_807][AsyncApp] completed iteration= 7
[I:20260129:17:29:42:584005] [] [main_807][AsyncApp] completed iteration= 8
[I:20260129:17:29:42:656563] [] [main_807][AsyncApp] completed iteration= 9
[I:20260129:17:29:42:729354] [] [main_807][AsyncApp] completed iteration= 10
[I:20260129:17:29:42:802121] [] [main_807][AsyncApp] completed iteration= 11
[I:20260129:17:29:42:874931] [] [main_807][AsyncApp] completed iteration= 12
[I:20260129:17:29:42:947354] [] [main_807][AsyncApp] completed iteration= 13
[I:20260129:17:29:43:012893] [] [task_print_device_stats_812][Stats] temperature= 36.2557 ep status:  DV_ENDPOINT_STATE_ACTIVE  0x1000608c:   15d0200
[I:20260129:17:29:43:020108] [] [main_807][AsyncApp] completed iteration= 14
[I:20260129:17:29:43:094043] [] [main_807][AsyncApp] completed iteration= 15
[I:20260129:17:29:43:166269] [] [main_807][AsyncApp] completed iteration= 16
[I:20260129:17:29:43:238760] [] [main_807][AsyncApp] completed iteration= 17
[I:20260129:17:29:43:311065] [] [main_807][AsyncApp] completed iteration= 18
[I:20260129:17:29:43:383388] [] [main_807][AsyncApp] completed iteration= 19
[I:20260129:17:29:43:455880] [] [main_807][AsyncApp] completed iteration= 20
[I:20260129:17:29:43:456773] [] [main_807][Stats] summary stats 
 ╔════════╤════════════════════════════╤═════════════════════════╤═══════════════════════════╤══════════════════╗
║ Model  │        hw_time (ms)        │      ip_time (ms)       │       op_time (ms)        │  app_time (ms)   ║
╠════════╪════════╤═════════╤═════════╪═══════╤═══════╤═════════╪════════╤════════╤═════════╪═════╤═════╤══════╣
║        │ max    │ min     │ mean    │ max   │ min   │ mean    │ max    │ min    │ mean    │ max │ min │ mean ║
╟────────┼────────┼─────────┼─────────┼───────┼───────┼─────────┼────────┼────────┼─────────┼─────┼─────┼──────╢
║ model1 │ 3.1052 │ 3.08395 │ 3.09515 │ 4.365 │ 2.346 │ 3.17945 │ 12.187 │ 10.369 │ 11.3023 │ 76  │ 71  │ 71.9 ║
╚════════╧════════╧═════════╧═════════╧═══════╧═══════╧═════════╧════════╧════════╧═════════╧═════╧═════╧══════╝
 
  model_name=model1 iteration=20 batch_size=5 num_ip=1 num_op=1 total_ip_size=122880000 total_op_size=120960000 num_inferences=100

[I:20260129:17:29:43:457176] [] [main_807][Stats] endpoint load distribution:  [0,100] 
[I:20260129:17:29:43:457195] [] [main_807][Stats] total number of inferences:  100
[I:20260129:17:29:43:457221] [] [main_807][Stats] Performance: HW IPS= 323.086  App IPS= 69.541
root@noble-venice:~/art/linux/aarch64/nnapp#

Note the final line that shows Performance: HW IPS= 323.086.

Note: See TracWiki for help on using the wiki.