Ultra96-V2とVitis-AIをAventのplatformsで動かすメモ

本サイトはアフィリエイト広告を利用しています。
AI

Ultra96-V2でVitis-AI 2.0を動かしてみました。

Aventが提供しているプラットフォーム使えばデモ程度は簡単に動作できます。

手順を紹介します。

 

スポンサーリンク

Ultra96-V2とVitis-AIをAventのplatformsで動かすメモ

Aventのプラットフォームを使えば、簡単にUltra96-v2でVitis-AIのデモを動かせます。

細かい(Runtimeなどの)インストール作業も不要でテストできます。

自身への忘備録兼ねて、簡単に手順を紹介します。

 

hackster.ioの記事をテストしただけ

元のルーツ記事は下記です。一番最初の冒頭の箇所です。

Vitis-AI 2.0 Flow for Avnet VITIS Platforms
This guide provides detailed instructions for targeting the Xilinx Vitis-AI 2.0 flow for Avnet Vitis 2021.2 platforms. B...

ネットワークの設定などを簡単にメモレベルで追記しています。

 

Ultra96-v2とUART接続の仕方

今回、初期設定にはUltra96-v2にUARTを使って設定しています。

PCからUSBシリアル接続で対応できます。

同様に実施する方は下記記事をご参考下さい。(リンク先はこちら)

Ultra96-V2のuart1にUSBシリアル通信で接続してみた

Ultra96-V2のuart1にUSBシリアル通信で接続してみた
Ultra96-V2にUSBシリアル通信ケーブルから直接接続してみました。 専用の中継ボードが無くても、市販のケーブルでシリアル通信が可能です。 何処のピンに接続すれば良いのか含めて紹介します。

 

Vitis AIを慣れるために

今回記事を書いた背景としては、下記コンテスト時にVitis AIで苦戦していたためです。

サンプル・デモを弄って、少しずつですが経験を積んでいます。

AIエッジコンテストが勉強になった(難しかった)件

AIエッジコンテストが勉強になった(難しかった)件
第5回AIエッジコンテストに参加していました。 (筆者の力量では)コンテストの課題が難しく、最後の実装まで到達できませんでした。 ただ貴重な勉強の機会になりましたし、自身への忘備録としても内容を紹介します。

 

AvnetのイメージをSDカードに焼く

下記からUltra96-v2のSDカード用のイメージをダウンロードします。

ZIPで4GB、解凍すると10GB以上ありますのでご注意下さい。

 http://avnet.me/avnet-u96v2_sbc_base-vitis-ai-2.0-image

 

解凍したimgファイルをSDカードライターなどを使ってmicroSDカードに書き込みします。

筆者はbalenaEtcherというソフトを使っています。

 

Ultra96-v2にSDカードを挿して起動する

Ultra96-v2にSDカードを挿入して、USBシリアル通信ケーブル接続した状態で起動します。

12V電源を入れて、SW4をONします。

 

TeraTermなどでボーレート115200bpsで接続すれば、立ち上がり時のログから確認できます。

立ち上がり時のログは下記のようになります。

Xilinx Zynq MP First Stage Boot Loader
Release 2021.2   Oct 13 2021  -  07:15:53
NOTICE:  BL31: v2.4(release):xlnx_rebase_v2.4_2021.1_update1-23-g9188496b9
NOTICE:  BL31: Built : 07:41:24, Oct 13 2021


U-Boot 2021.01 (Oct 12 2021 - 09:28:42 +0000)

CPU:   ZynqMP
Silicon: v3
Board: Xilinx ZynqMP
DRAM:  2 GiB
PMUFW:  v1.1
EL Level:       EL2
Chip ID:        zu3eg
NAND:  0 MiB
MMC:   mmc@ff160000: 0, mmc@ff170000: 1
Loading Environment from FAT... *** Warning - bad CRC, using default environment

In:    serial
Out:   serial
Err:   serial
Bootmode: SD_MODE
Reset reason:   EXTERNAL
Net:   No ethernet found.
Hit any key to stop autoboot:  2
 0
switch to partitions #0, OK
mmc0 is current device
Scanning mmc 0:1...
Found U-Boot script /boot.scr
2710 bytes read in 16 ms (165 KiB/s)
## Executing script at 20000000
Trying to load boot images from mmc0
9532424 bytes read in 702 ms (12.9 MiB/s)
## Loading kernel from FIT Image at 10000000 ...
   Using 'conf-system-top.dtb' configuration
   Trying 'kernel-1' kernel subimage
     Description:  Linux kernel
     Created:      2021-10-12   9:30:57 UTC
     Type:         Kernel Image
     Compression:  gzip compressed
     Data Start:   0x100000f4
     Data Size:    9467776 Bytes = 9 MiB
     Architecture: AArch64
     OS:           Linux
     Load Address: 0x00200000
     Entry Point:  0x00200000
     Hash algo:    sha256
     Hash value:   95ad1b8447a6c2d0a55e4638720ce9b801bfbeb2d995e8ebbf5f50dd3e859ff4
   Verifying Hash Integrity ... sha256+ OK
## Loading fdt from FIT Image at 10000000 ...
   Using 'conf-system-top.dtb' configuration
   Trying 'fdt-system-top.dtb' fdt subimage
     Description:  Flattened Device Tree blob
     Created:      2021-10-12   9:30:57 UTC
     Type:         Flat Device Tree
     Compression:  uncompressed
     Data Start:   0x10907984
     Data Size:    62747 Bytes = 61.3 KiB
     Architecture: AArch64
     Hash algo:    sha256
     Hash value:   31d2dd13588a12384c12860e97c665a3c818a329f66713a8e2d8f3c7fb61e60b
   Verifying Hash Integrity ... sha256+ OK
   Booting using the fdt blob at 0x10907984
   Uncompressing Kernel Image
   Loading Device Tree to 000000007dcfa000, end 000000007dd0c51a ... OK

Starting kernel ...

[    0.000000] Booting Linux on physical CPU 0x0000000000 [0x410fd034]
[    0.000000] Linux version 5.10.0-xilinx-v2021.2 (oe-user@oe-host) (aarch64-xilinx-linux-gcc (GCC) 10.2.0, GNU ld (GNU Binutils) 2.35.1) #1 SMP Tue Oct 12 09:30:57 UTC 2021
[    0.000000] Machine model: xlnx,zynqmp
[    0.000000] earlycon: cdns0 at MMIO 0x00000000ff010000 (options '115200n8')
[    0.000000] printk: bootconsole [cdns0] enabled
[    0.000000] efi: UEFI not found.
[    0.000000] cma: Reserved 512 MiB at 0x000000005dc00000
[    0.000000] Zone ranges:
[    0.000000]   DMA32    [mem 0x0000000000000000-0x000000007fefffff]
[    0.000000]   Normal   empty
[    0.000000] Movable zone start for each node
[    0.000000] Early memory node ranges
[    0.000000]   node   0: [mem 0x0000000000000000-0x000000003ecfffff]
[    0.000000]   node   0: [mem 0x000000003ee48000-0x000000007fefffff]
[    0.000000] Zeroed struct page in unavailable ranges: 512 pages
[    0.000000] Initmem setup node 0 [mem 0x0000000000000000-0x000000007fefffff]
[    0.000000] psci: probing for conduit method from DT.
[    0.000000] psci: PSCIv1.1 detected in firmware.
[    0.000000] psci: Using standard PSCI v0.2 function IDs
[    0.000000] psci: MIGRATE_INFO_TYPE not supported.
[    0.000000] psci: SMC Calling Convention v1.2
[    0.000000] percpu: Embedded 22 pages/cpu s49624 r8192 d32296 u90112
[    0.000000] Detected VIPT I-cache on CPU0
[    0.000000] CPU features: detected: ARM erratum 845719
[    0.000000] Built 1 zonelists, mobility grouping on.  Total pages: 515516
[    0.000000] Kernel command line: earlycon console=ttyPS0,115200 clk_ignore_unused root=/dev/mmcblk0p2 rw rootwait cma=512M
[    0.000000] Dentry cache hash table entries: 262144 (order: 9, 2097152 bytes, linear)
[    0.000000] Inode-cache hash table entries: 131072 (order: 8, 1048576 bytes, linear)
[    0.000000] mem auto-init: stack:off, heap alloc:off, heap free:off
[    0.000000] Memory: 1508044K/2094816K available (14144K kernel code, 996K rwdata, 3944K rodata, 2112K init, 589K bss, 62484K reserved, 524288K cma-reserved)
[    0.000000] rcu: Hierarchical RCU implementation.
[    0.000000] rcu:     RCU event tracing is enabled.
[    0.000000] rcu: RCU calculated value of scheduler-enlistment delay is 25 jiffies.
[    0.000000] NR_IRQS: 64, nr_irqs: 64, preallocated irqs: 0
[    0.000000] GIC: Adjusting CPU interface base to 0x00000000f902f000
[    0.000000] GIC: Using split EOI/Deactivate mode
[    0.000000] irq-xilinx: mismatch in kind-of-intr param
[    0.000000] irq-xilinx: /amba_pl@0/interrupt-controller@a0090000: num_irq=32, sw_irq=0, edge=0x1
[    0.000000] random: get_random_bytes called from start_kernel+0x31c/0x524 with crng_init=0
[    0.000000] arch_timer: cp15 timer(s) running at 100.00MHz (phys).
[    0.000000] clocksource: arch_sys_counter: mask: 0xffffffffffffff max_cycles: 0x171024e7e0, max_idle_ns: 440795205315 ns
[    0.000005] sched_clock: 56 bits at 100MHz, resolution 10ns, wraps every 4398046511100ns
[    0.008506] Console: colour dummy device 80x25
[    0.012494] Calibrating delay loop (skipped), value calculated using timer frequency.. 200.00 BogoMIPS (lpj=400000)
[    0.022839] pid_max: default: 32768 minimum: 301
[    0.027632] Mount-cache hash table entries: 4096 (order: 3, 32768 bytes, linear)
[    0.034789] Mountpoint-cache hash table entries: 4096 (order: 3, 32768 bytes, linear)
[    0.044212] rcu: Hierarchical SRCU implementation.
[    0.047633] EFI services will not be available.
[    0.052009] smp: Bringing up secondary CPUs ...
[    0.056791] Detected VIPT I-cache on CPU1
[    0.056858] CPU1: Booted secondary processor 0x0000000001 [0x410fd034]
[    0.057321] Detected VIPT I-cache on CPU2
[    0.057347] CPU2: Booted secondary processor 0x0000000002 [0x410fd034]
[    0.057758] Detected VIPT I-cache on CPU3
[    0.057782] CPU3: Booted secondary processor 0x0000000003 [0x410fd034]
[    0.057833] smp: Brought up 1 node, 4 CPUs
[    0.091777] SMP: Total of 4 processors activated.
[    0.096451] CPU features: detected: 32-bit EL0 Support
[    0.101553] CPU features: detected: CRC32 instructions
[    0.106701] CPU: All CPU(s) started at EL2
[    0.110736] alternatives: patching kernel code
[    0.116442] devtmpfs: initialized
[    0.125664] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 7645041785100000 ns
[    0.129772] futex hash table entries: 1024 (order: 4, 65536 bytes, linear)
[    0.156707] pinctrl core: initialized pinctrl subsystem
[    0.157497] DMI not present or invalid.
[    0.160385] NET: Registered protocol family 16
[    0.166544] DMA: preallocated 256 KiB GFP_KERNEL pool for atomic allocations
[    0.171644] DMA: preallocated 256 KiB GFP_KERNEL|GFP_DMA32 pool for atomic allocations
[    0.179453] audit: initializing netlink subsys (disabled)
[    0.184880] audit: type=2000 audit(0.124:1): state=initialized audit_enabled=0 res=1
[    0.185360] hw-breakpoint: found 6 breakpoint and 4 watchpoint registers.
[    0.199282] ASID allocator initialised with 65536 entries
[    0.204694] Serial: AMBA PL011 UART driver
[    0.239049] HugeTLB registered 1.00 GiB page size, pre-allocated 0 pages
[    0.240115] HugeTLB registered 32.0 MiB page size, pre-allocated 0 pages
[    0.246791] HugeTLB registered 2.00 MiB page size, pre-allocated 0 pages
[    0.253452] HugeTLB registered 64.0 KiB page size, pre-allocated 0 pages
[    1.305622] cryptd: max_cpu_qlen set to 1000
[    1.334504] DRBG: Continuing without Jitter RNG
[    1.412949] raid6: neonx8   gen()  2139 MB/s
[    1.481012] raid6: neonx8   xor()  1597 MB/s
[    1.549080] raid6: neonx4   gen()  2188 MB/s
[    1.617140] raid6: neonx4   xor()  1565 MB/s
[    1.685214] raid6: neonx2   gen()  2078 MB/s
[    1.753270] raid6: neonx2   xor()  1438 MB/s
[    1.821354] raid6: neonx1   gen()  1773 MB/s
[    1.889408] raid6: neonx1   xor()  1219 MB/s
[    1.957478] raid6: int64x8  gen()  1437 MB/s
[    2.025543] raid6: int64x8  xor()   771 MB/s
[    2.093619] raid6: int64x4  gen()  1601 MB/s
[    2.161683] raid6: int64x4  xor()   816 MB/s
[    2.229757] raid6: int64x2  gen()  1398 MB/s
[    2.297821] raid6: int64x2  xor()   750 MB/s
[    2.365892] raid6: int64x1  gen()  1031 MB/s
[    2.433949] raid6: int64x1  xor()   517 MB/s
[    2.433990] raid6: using algorithm neonx4 gen() 2188 MB/s
[    2.437937] raid6: .... xor() 1565 MB/s, rmw enabled
[    2.442874] raid6: using neon recovery algorithm
[    2.448809] iommu: Default domain type: Translated
[    2.452612] SCSI subsystem initialized
[    2.456224] usbcore: registered new interface driver usbfs
[    2.461500] usbcore: registered new interface driver hub
[    2.466776] usbcore: registered new device driver usb
[    2.471830] mc: Linux media interface: v0.10
[    2.476021] videodev: Linux video capture interface: v2.00
[    2.481504] EDAC MC: Ver: 3.0.0
[    2.485040] zynqmp-ipi-mbox mailbox@ff990400: Registered ZynqMP IPI mbox with TX/RX channels.
[    2.493290] zynqmp-ipi-mbox mailbox@ff990600: Registered ZynqMP IPI mbox with TX/RX channels.
[    2.501663] FPGA manager framework
[    2.505038] Advanced Linux Sound Architecture Driver Initialized.
[    2.511356] Bluetooth: Core ver 2.22
[    2.514518] NET: Registered protocol family 31
[    2.518907] Bluetooth: HCI device and connection manager initialized
[    2.525226] Bluetooth: HCI socket layer initialized
[    2.530067] Bluetooth: L2CAP socket layer initialized
[    2.535091] Bluetooth: SCO socket layer initialized
[    2.540301] clocksource: Switched to clocksource arch_sys_counter
[    2.546192] VFS: Disk quotas dquot_6.6.0
[    2.549933] VFS: Dquot-cache hash table entries: 512 (order 0, 4096 bytes)
[    2.561300] NET: Registered protocol family 2
[    2.561826] tcp_listen_portaddr_hash hash table entries: 1024 (order: 2, 16384 bytes, linear)
[    2.569538] TCP established hash table entries: 16384 (order: 5, 131072 bytes, linear)
[    2.577488] TCP bind hash table entries: 16384 (order: 6, 262144 bytes, linear)
[    2.585117] TCP: Hash tables configured (established 16384 bind 16384)
[    2.591277] UDP hash table entries: 1024 (order: 3, 32768 bytes, linear)
[    2.597835] UDP-Lite hash table entries: 1024 (order: 3, 32768 bytes, linear)
[    2.605043] NET: Registered protocol family 1
[    2.609615] RPC: Registered named UNIX socket transport module.
[    2.615108] RPC: Registered udp transport module.
[    2.619768] RPC: Registered tcp transport module.
[    2.624441] RPC: Registered tcp NFSv4.1 backchannel transport module.
[    2.631510] PCI: CLS 0 bytes, default 64
[    2.662012] Initialise system trusted keyrings
[    2.662192] workingset: timestamp_bits=46 max_order=19 bucket_order=0
[    2.668140] NFS: Registering the id_resolver key type
[    2.672279] Key type id_resolver registered
[    2.676406] Key type id_legacy registered
[    2.680411] nfs4filelayout_init: NFSv4 File Layout Driver Registering...
[    2.687072] jffs2: version 2.2. (NAND) (SUMMARY)  c 2001-2006 Red Hat, Inc.
[    2.730724] NET: Registered protocol family 38
[    2.730775] xor: measuring software checksum speed
[    2.738471]    8regs           :  2363 MB/sec
[    2.742129]    32regs          :  2799 MB/sec
[    2.747071]    arm64_neon      :  2380 MB/sec
[    2.747262] xor: using function: 32regs (2799 MB/sec)
[    2.752290] Key type asymmetric registered
[    2.756351] Asymmetric key parser 'x509' registered
[    2.761224] Block layer SCSI generic (bsg) driver version 0.4 loaded (major 247)
[    2.768549] io scheduler mq-deadline registered
[    2.773044] io scheduler kyber registered
[    2.779710] ps_pcie_dma init()
[    2.807438] Serial: 8250/16550 driver, 4 ports, IRQ sharing disabled
[    2.810422] a0060000.serial: ttyS3 at MMIO 0xa0061000 (irq = 58, base_baud = 6250000) is a 16550A
[    2.817624] a0070000.serial: ttyS2 at MMIO 0xa0071000 (irq = 59, base_baud = 6250000) is a 16550A
[    2.826064] Serial: AMBA driver
[    2.832235] cacheinfo: Unable to detect cache hierarchy for CPU 0
[    2.840639] brd: module loaded
[    2.846934] loop: module loaded
[    2.848143] mtdoops: mtd device (mtddev=name/number) must be supplied
[    2.852781] libphy: Fixed MDIO Bus: probed
[    2.856343] tun: Universal TUN/TAP device driver, 1.6
[    2.860036] CAN device driver interface
[    2.864739] usbcore: registered new interface driver rtl8150
[    2.869392] usbcore: registered new interface driver r8152
[    2.874838] usbcore: registered new interface driver asix
[    2.880196] usbcore: registered new interface driver ax88179_178a
[    2.886250] usbcore: registered new interface driver cdc_ether
[    2.892049] usbcore: registered new interface driver net1080
[    2.897671] usbcore: registered new interface driver cdc_subset
[    2.903550] usbcore: registered new interface driver zaurus
[    2.909102] usbcore: registered new interface driver cdc_ncm
[    2.915973] usbcore: registered new interface driver uas
[    2.920010] usbcore: registered new interface driver usb-storage
[    2.926144] gadgetfs: USB Gadget filesystem, version 24 Aug 2004
[    2.932614] rtc_zynqmp ffa60000.rtc: registered as rtc0
[    2.937117] rtc_zynqmp ffa60000.rtc: setting system clock to 1970-01-01T00:00:05 UTC (5)
[    2.945196] i2c /dev entries driver
[    2.950539] usbcore: registered new interface driver uvcvideo
[    2.954307] USB Video Class driver (1.1.1)
[    2.959172] Bluetooth: HCI UART driver ver 2.3
[    2.962787] Bluetooth: HCI UART protocol H4 registered
[    2.967886] Bluetooth: HCI UART protocol BCSP registered
[    2.973182] Bluetooth: HCI UART protocol LL registered
[    2.978266] Bluetooth: HCI UART protocol ATH3K registered
[    2.983643] Bluetooth: HCI UART protocol Three-wire (H5) registered
[    2.989896] Bluetooth: HCI UART protocol Intel registered
[    2.995234] Bluetooth: HCI UART protocol QCA registered
[    3.000436] usbcore: registered new interface driver bcm203x
[    3.006060] usbcore: registered new interface driver bpa10x
[    3.011597] usbcore: registered new interface driver bfusb
[    3.017044] usbcore: registered new interface driver btusb
[    3.022511] usbcore: registered new interface driver ath3k
[    3.028012] EDAC MC: ECC not enabled
[    3.031634] EDAC DEVICE0: Giving out device to module edac controller cache_err: DEV edac (POLLED)
[    3.040564] EDAC DEVICE1: Giving out device to module zynqmp-ocm-edac controller zynqmp_ocm: DEV ff960000.memory-controller (INTERRUPT)
[    3.052744] pwrseq_simple sdio-pwrseq: mmc failed to get default resetn GPIO
[    3.059498] pwrseq_simple sdio-pwrseq: mmc failed to get default chip_en GPIO
[    3.066729] sdhci: Secure Digital Host Controller Interface driver
[    3.072723] sdhci: Copyright(c) Pierre Ossman
[    3.077049] sdhci-pltfm: SDHCI platform and OF driver helper
[    3.083171] ledtrig-cpu: registered to indicate activity on CPUs
[    3.088656] SMCCC: SOC_ID: ARCH_SOC_ID not implemented, skipping ....
[    3.095086] zynqmp_firmware_probe Platform Management API v1.1
[    3.100840] zynqmp_firmware_probe Trustzone version v1.0
[    3.139942] zynqmp-pinctrl firmware:zynqmp-firmware:pinctrl: zynqmp pinctrl initialized
[    3.189230] securefw securefw: securefw probed
[    3.189696] alg: No test for xilinx-zynqmp-aes (zynqmp-aes)
[    3.193719] zynqmp_aes firmware:zynqmp-firmware:zynqmp-aes: AES Successfully Registered
[    3.201855] alg: No test for xilinx-keccak-384 (zynqmp-keccak-384)
[    3.207976] alg: No test for xilinx-zynqmp-rsa (zynqmp-rsa)
[    3.213548] usbcore: registered new interface driver usbhid
[    3.218846] usbhid: USB HID core driver
[    3.222923] xlnk xlnk: Major 243
[    3.225989] xlnk xlnk: xlnk driver loaded
[    3.229828] xlnk xlnk: xlnk_pdev is not null
[    3.237055] ARM CCI_400_r1 PMU driver probed
[    3.237610] fpga_manager fpga0: Xilinx ZynqMP FPGA Manager registered
[    3.245262] usbcore: registered new interface driver snd-usb-audio
[    3.251913] pktgen: Packet Generator for packet performance testing. Version: 2.75
[    3.259277] Initializing XFRM netlink socket
[    3.262708] NET: Registered protocol family 10
[    3.267598] Segment Routing with IPv6
[    3.270889] sit: IPv6, IPv4 and MPLS over IPv4 tunneling driver
[    3.276996] NET: Registered protocol family 17
[    3.280965] NET: Registered protocol family 15
[    3.285373] can: controller area network core
[    3.289727] NET: Registered protocol family 29
[    3.294097] can: raw protocol
[    3.297038] can: broadcast manager protocol
[    3.301192] can: netlink gateway - max_hops=1
[    3.305622] Bluetooth: RFCOMM TTY layer initialized
[    3.310368] Bluetooth: RFCOMM socket layer initialized
[    3.315493] Bluetooth: RFCOMM ver 1.11
[    3.319202] Bluetooth: BNEP (Ethernet Emulation) ver 1.3
[    3.324455] Bluetooth: BNEP filters: protocol multicast
[    3.329654] Bluetooth: BNEP socket layer initialized
[    3.334576] Bluetooth: HIDP (Human Interface Emulation) ver 1.2
[    3.340461] Bluetooth: HIDP socket layer initialized
[    3.345586] 9pnet: Installing 9P2000 support
[    3.349663] Key type dns_resolver registered
[    3.354061] registered taskstats version 1
[    3.357932] Loading compiled-in X.509 certificates
[    3.364328] Btrfs loaded, crc32c=crc32c-generic
[    3.379590] ff000000.serial: ttyPS1 at MMIO 0xff000000 (irq = 49, base_baud = 6249999) is a xuartps
[    3.383786] ff010000.serial: ttyPS0 at MMIO 0xff010000 (irq = 50, base_baud = 6249999) is a xuartps
[    3.397631] printk: console [ttyPS0] enabled
[    3.397631] printk: console [ttyPS0] enabled
[    3.401934] printk: bootconsole [cdns0] disabled
[    3.401934] printk: bootconsole [cdns0] disabled
[    3.412101] of-fpga-region fpga-full: FPGA Region probed
[    3.421587] xilinx-zynqmp-dma fd500000.dma: ZynqMP DMA driver Probe success
[    3.428810] xilinx-zynqmp-dma fd510000.dma: ZynqMP DMA driver Probe success
[    3.436016] xilinx-zynqmp-dma fd520000.dma: ZynqMP DMA driver Probe success
[    3.443252] xilinx-zynqmp-dma fd530000.dma: ZynqMP DMA driver Probe success
[    3.450460] xilinx-zynqmp-dma fd540000.dma: ZynqMP DMA driver Probe success
[    3.457676] xilinx-zynqmp-dma fd550000.dma: ZynqMP DMA driver Probe success
[    3.464881] xilinx-zynqmp-dma fd560000.dma: ZynqMP DMA driver Probe success
[    3.472084] xilinx-zynqmp-dma fd570000.dma: ZynqMP DMA driver Probe success
[    3.479356] xilinx-zynqmp-dma ffa80000.dma: ZynqMP DMA driver Probe success
[    3.486560] xilinx-zynqmp-dma ffa90000.dma: ZynqMP DMA driver Probe success
[    3.493775] xilinx-zynqmp-dma ffaa0000.dma: ZynqMP DMA driver Probe success
[    3.500966] xilinx-zynqmp-dma ffab0000.dma: ZynqMP DMA driver Probe success
[    3.508177] xilinx-zynqmp-dma ffac0000.dma: ZynqMP DMA driver Probe success
[    3.515366] xilinx-zynqmp-dma ffad0000.dma: ZynqMP DMA driver Probe success
[    3.522569] xilinx-zynqmp-dma ffae0000.dma: ZynqMP DMA driver Probe success
[    3.529767] xilinx-zynqmp-dma ffaf0000.dma: ZynqMP DMA driver Probe success
[    3.537225] xilinx-zynqmp-dpdma fd4c0000.dma-controller: Xilinx DPDMA engine is probed
[    3.546397] zynqmp-display fd4a0000.display: vtc bridge property not present
[    3.555652] xilinx-dp-snd-codec fd4a0000.display:zynqmp_dp_snd_codec0: Xilinx DisplayPort Sound Codec probed
[    3.565847] xilinx-dp-snd-pcm zynqmp_dp_snd_pcm0: Xilinx DisplayPort Sound PCM probed
[    3.574000] xilinx-dp-snd-pcm zynqmp_dp_snd_pcm1: Xilinx DisplayPort Sound PCM probed
[    3.583219] xilinx-dp-snd-card fd4a0000.display:zynqmp_dp_snd_card: ASoC: no DMI vendor name!
[    3.592149] xilinx-dp-snd-card fd4a0000.display:zynqmp_dp_snd_card: Xilinx DisplayPort Sound Card probed
[    3.601737] OF: graph: no port node found in /axi/display@fd4a0000
[    3.608454] xlnx-drm xlnx-drm.0: bound fd4a0000.display (ops 0xffff800010eab8c8)
[    4.692325] zynqmp-display fd4a0000.display: [drm] Cannot find any crtc or sizes
[    4.700079] [drm] Initialized xlnx 1.0.0 20130509 for fd4a0000.display on minor 0
[    4.707577] zynqmp-display fd4a0000.display: ZynqMP DisplayPort Subsystem driver probed
[    4.717915] xilinx-axipmon ffa00000.perf-monitor: Probed Xilinx APM
[    4.724551] xilinx-axipmon fd0b0000.perf-monitor: Probed Xilinx APM
[    4.731110] xilinx-axipmon fd490000.perf-monitor: Probed Xilinx APM
[    4.737684] xilinx-axipmon ffa10000.perf-monitor: Probed Xilinx APM
[    4.767532] xhci-hcd xhci-hcd.1.auto: xHCI Host Controller
[    4.773064] xhci-hcd xhci-hcd.1.auto: new USB bus registered, assigned bus number 1
[    4.780871] xhci-hcd xhci-hcd.1.auto: hcc params 0x0238f625 hci version 0x100 quirks 0x0000000002010010
[    4.790284] xhci-hcd xhci-hcd.1.auto: irq 96, io mem 0xfe300000
[    4.796530] usb usb1: New USB device found, idVendor=1d6b, idProduct=0002, bcdDevice= 5.10
[    4.804797] usb usb1: New USB device strings: Mfr=3, Product=2, SerialNumber=1
[    4.812023] usb usb1: Product: xHCI Host Controller
[    4.816893] usb usb1: Manufacturer: Linux 5.10.0-xilinx-v2021.2 xhci-hcd
[    4.823587] usb usb1: SerialNumber: xhci-hcd.1.auto
[    4.828870] hub 1-0:1.0: USB hub found
[    4.832641] hub 1-0:1.0: 1 port detected
[    4.836782] xhci-hcd xhci-hcd.1.auto: xHCI Host Controller
[    4.842276] xhci-hcd xhci-hcd.1.auto: new USB bus registered, assigned bus number 2
[    4.849934] xhci-hcd xhci-hcd.1.auto: Host supports USB 3.0 SuperSpeed
[    4.856515] usb usb2: We don't know the algorithms for LPM for this host, disabling LPM.
[    4.864671] usb usb2: New USB device found, idVendor=1d6b, idProduct=0003, bcdDevice= 5.10
[    4.872934] usb usb2: New USB device strings: Mfr=3, Product=2, SerialNumber=1
[    4.880146] usb usb2: Product: xHCI Host Controller
[    4.885019] usb usb2: Manufacturer: Linux 5.10.0-xilinx-v2021.2 xhci-hcd
[    4.891715] usb usb2: SerialNumber: xhci-hcd.1.auto
[    4.896861] hub 2-0:1.0: USB hub found
[    4.900633] hub 2-0:1.0: 1 port detected
[    4.906964] i2c i2c-0: Added multiplexed i2c bus 2
[    4.911900] i2c i2c-0: Added multiplexed i2c bus 3
[    4.916844] i2c i2c-0: Added multiplexed i2c bus 4
[    4.921779] i2c i2c-0: Added multiplexed i2c bus 5
[    4.989996] random: fast init done
[    5.172303] usb 1-1: new high-speed USB device number 2 using xhci-hcd
[    5.324812] usb 1-1: New USB device found, idVendor=0424, idProduct=2744, bcdDevice= 2.21
[    5.332988] usb 1-1: New USB device strings: Mfr=1, Product=2, SerialNumber=0
[    5.340116] usb 1-1: Product: USB2744
[    5.343770] usb 1-1: Manufacturer: Microchip Tech
[    5.400618] hub 1-1:1.0: USB hub found
[    5.404411] hub 1-1:1.0: 4 ports detected
[    5.464486] usb 2-1: new SuperSpeed Gen 1 USB device number 2 using xhci-hcd
[    5.488678] usb 2-1: New USB device found, idVendor=0424, idProduct=5744, bcdDevice= 2.21
[    5.496858] usb 2-1: New USB device strings: Mfr=2, Product=3, SerialNumber=0
[    5.503986] usb 2-1: Product: USB5744
[    5.507639] usb 2-1: Manufacturer: Microchip Tech
[    5.544606] hub 2-1:1.0: USB hub found
[    5.548389] hub 2-1:1.0: 3 ports detected
[    5.756299] usb 1-1.4: new high-speed USB device number 3 using xhci-hcd
[    5.800354] zynqmp-display fd4a0000.display: [drm] Cannot find any crtc or sizes
[    5.861030] usb 1-1.4: New USB device found, idVendor=0424, idProduct=2740, bcdDevice= 2.00
[    5.869386] usb 1-1.4: New USB device strings: Mfr=1, Product=2, SerialNumber=0
[    5.876688] usb 1-1.4: Product: Hub Controller
[    5.881123] usb 1-1.4: Manufacturer: Microchip Tech
[    5.908577] tps65086 6-005e: Failed to read revision register
[    5.914436] i2c i2c-0: Added multiplexed i2c bus 6
[    5.919919] ina2xx_adc 7-0040: error configuring the device
[    5.925536] i2c i2c-0: Added multiplexed i2c bus 7
[    5.930468] i2c i2c-0: Added multiplexed i2c bus 8
[    5.935396] i2c i2c-0: Added multiplexed i2c bus 9
[    5.940195] pca954x 0-0075: registered 8 multiplexed busses for I2C switch pca9548
[    5.947854] cdns-i2c ff030000.i2c: 100 kHz mmio ff030000 irq 39
[    5.955352] cdns-wdt fd4d0000.watchdog: Xilinx Watchdog Timer with timeout 60s
[    5.962915] cdns-wdt ff150000.watchdog: Xilinx Watchdog Timer with timeout 10s
[    5.970407] pwrseq_simple sdio-pwrseq: mmc succesfully got gpio_resetn
[    5.976947] pwrseq_simple sdio-pwrseq: mmc succesfully got gpio_chip_en
[    5.995949] sdhci-arasan ff170000.mmc: allocated mmc-pwrseq
[    5.999131] of_cfs_init
[    6.004008] of_cfs_init: OK
[    6.007019] cfg80211: Loading compiled-in X.509 certificates for regulatory database
[    6.027800] mmc0: SDHCI controller on ff160000.mmc [ff160000.mmc] using ADMA 64-bit
[    6.052300] mmc1: SDHCI controller on ff170000.mmc [ff170000.mmc] using ADMA 64-bit
[    6.072805] mmc0: new high speed SDHC card at address 5048
[    6.076646] mmc1: new high speed SDIO card at address 0001
[    6.078912] mmcblk0: mmc0:5048 DDINC 14.9 GiB
[    6.089741]  mmcblk0: p1 p2
[    6.142841] cfg80211: Loaded X.509 cert 'sforshee: 00b28ddf47aef9cea7'
[    6.149384] clk: Not disabling unused clocks
[    6.153886] ALSA device list:
[    6.156844]   #0: DisplayPort monitor
[    6.161090] platform regulatory.0: Direct firmware load for regulatory.db failed with error -2
[    6.169707] cfg80211: failed to load regulatory.db
[    6.841138] EXT4-fs (mmcblk0p2): mounted filesystem with ordered data mode. Opts: (null)
[    6.849269] VFS: Mounted root (ext4 filesystem) on device 179:2.
[    6.862887] devtmpfs: mounted
[    6.867043] Freeing unused kernel memory: 2112K
[    6.871665] Run /sbin/init as init process
INIT: version 2.97 booting
Starting udev
[    7.489443] udevd[267]: starting version 3.2.9
[    7.514981] random: udevd: uninitialized urandom read (16 bytes read)
[    7.522289] random: udevd: uninitialized urandom read (16 bytes read)
[    7.528761] random: udevd: uninitialized urandom read (16 bytes read)
[    7.589971] udevd[268]: starting eudev-3.2.9
[    7.778841] zocl: loading out-of-tree module taints kernel.
[    7.789685] [drm] Probing for xlnx,zocl
[    7.793989] zocl-drm amba_pl@0:zyxclmm_drm: IRQ index 32 not found
[    7.800578] [drm] FPGA programming device pcap founded.
[    7.805849] [drm] PR Isolation addr 0x0
[    7.806743] [drm] Initialized zocl 0.0.0 00000 for amba_pl@0:zyxclmm_drm on minor 1
[    8.458360] FAT-fs (mmcblk0p1): Volume was not properly unmounted. Some data may be corrupt. Please run fsck.
[    8.595750] EXT4-fs (mmcblk0p2): re-mounted. Opts: (null)
bootlogd: /dev/ttyPS0Sun May  1 03:55:10 UTC 2022
Starting Ultra96 AP setup daemon... [   13.658443] power up request for already powered up source Wifi
done.
   WIFI LED GPIO = 501
   BT   LED GPIO = 502
Turning Ultra96 WiFi & Bluetooth LEDs ON...done.

Starting Flask server deamon to serve Ultra96 startup page.
INIT: Entering runlevel: 5
Starting system message bus: dbus.
Configuring network interfaces... Successfully initialized wpa_supplicant
done.
Starting random number generator daemon.
Starting Connection Manager
Starting haveged: haveged: command socket is listening at fd 3
haveged: haveged starting up


haveged: haveged: ver: 1.9.13; arch: generic; vend: ; build: (gcc 10.2.0 CTV); collect: 128K

haveged: haveged: cpu: (VC); data: 16K (D); inst: 16K (D); idx: 11/40; sz: 15456/64452

haveged: haveged: tot tests(BA8): A:1/1 B:1/1 continuous tests(B):  last entropy estimate 7.99786

haveged: haveged: fills: 0, generated: 0

Starting OpenBSD Secure Shell server: sshd
done.
Starting Xserver
Starting rpcbind daemon...
done.
starting statd:
X.Org X Server 1.20.9
X Protocol Version 11, Revision 0
Build Operating System: Linux
Current Operating System: Linux u96v2-sbc-base-2021-2 5.10.0-xilinx-v2021.2 #1 SMP Tue Oct 12 09:30:57 UTC 2021 aarch64
Kernel command line: earlycon console=ttyPS0,115200 clk_ignore_unused root=/dev/mmcblk0p2 rw rootwait cma=512M
Build Date: 25 August 2020  03:40:19PM

Current version of pixman: 0.40.0
        Before reporting problems, check http://wiki.x.org
        to make sure that you have the latest version.
Markers: (--) probed, (**) from config file, (==) default setting,
        (++) from command line, (!!) notice, (II) informational,
        (WW) warning, (EE) error, (NI) not implemented, (??) unknown.
(==) Log file: "/var/log/Xorg.0.log", Time: Sun May  1 03:55:20 2022
done
(==) Using config file: "/etc/X11/xorg.conf"
(==) Using system config directory "/usr/share/X11/xorg.conf.d"
Starting bluetooth: bluetoothd.
Starting internet superserver: inetd.
NFS daemon support not enabled in kernel
Starting ntpd: done
Starting syslogd/klogd: done
Starting internet superserver: xinetd.
 * Starting Avahi mDNS/DNS-SD Daemon: avahi-daemon                       [ ok ]
Starting Telephony daemon
Starting watchdog daemon...done
Starting Linux NFC daemon
Starting tcf-agent: OK

PetaLinux 2021.2 u96v2-sbc-base-2021-2 ttyPS0


root@u96v2-sbc-base-2021-2:~# D-BUS per-session daemon address is: unix:abstract=/tmp/dbus-GFaw5KaJOb,guid=ae2962efe6fdb5eed678b1a4626e04ab
matchbox: Cant find a keycode for keysym 269025056
matchbox: ignoring key shortcut XF86Calendar=!$contacts

matchbox: Cant find a keycode for keysym 2809
matchbox: ignoring key shortcut telephone=!$dates

matchbox: Cant find a keycode for keysym 269025050
matchbox: ignoring key shortcut XF86Start=!matchbox-remote -desktop

[settings daemon] Forking. run with -n to prevent fork
dbus-daemon[877]: Activating service name='org.a11y.atspi.Registry' requested by ':1.0' (uid=0 pid=873 comm="matchbox-panel --start-applets showdesktop,windows")
dbus-daemon[877]: Successfully activated service 'org.a11y.atspi.Registry'
SpiRegistry daemon is running with well-known name - org.a11y.atspi.Registry

** (matchbox-desktop:872): WARNING **: 03:55:25.911: Error loading icon: Icon 'terminal' not present in theme Sato

root@u96v2-sbc-base-2021-2:~#

 

Avnetのスクリプトを走らせる

Avnetが用意している、Vitis AIのデモを動かす準備のスクリプトを動かします。

cd dpu_sw_optimize/zynqmp/
source ./zynqmp_dpu_optimize.sh

 

下記のようなログ・実行結果になります。

root@u96v2-sbc-base-2021-2:~#
root@u96v2-sbc-base-2021-2:~# cd dpu_sw_optimize/zynqmp/
root@u96v2-sbc-base-2021-2:~/dpu_sw_optimize/zynqmp# source ./zynqmp_dpu_optimize.sh
dirname: invalid option -- 's'
Try 'dirname --help' for more information.
Auto resize ext4 partition ...[?]
Start QoS config ...[?]
root@u96v2-sbc-base-2021-2:~/dpu_sw_optimize/zynqmp#

 

Ultra96-v2のWifiの設定をする

重いデータをUltra96-v2に転送するときのためにWifiの設定をしておきます。

またUltra96-v2のディスプレイポートに接続しなくとも、画面の確認が可能となります。

(ディスプレイの接続切り替えが無くなり、結構楽になります。)

 

「""」箇所のssidとパスワード(psk)をご自宅の無線LANに設定しときます。

vim wpa_supplicant.conf
ctrl_interface=/var/run/wpa_supplicant
ctrl_interface_group=0
update_config=1

network={
        key_mgmt=WPA-PSK
        ssid=""
        psk=""
}

 

設定後はWifi用のスクリプトを動作させれば、IPアドレスが割り振られます。

筆者のケースだと192.168.11.7となりました。

./wifi.sh
root@u96v2-sbc-base-2021-2:~# ls
Vitis-AI  bt.sh  dpu_sw_optimize  pmic-prog  usb_gadget_ethernet.sh  wifi.sh  wpa_supplicant.conf  wpa_supplicant.conf~  xilinx_developer
root@u96v2-sbc-base-2021-2:~# ./wifi.sh
Stopping Connection Manager
ifconfig: SIOCGIFFLAGS: No such device
Successfully initialized wpa_supplicant
[  587.615153] power up request for already powered up source Wifi
udhcpc: started, v1.32.0
udhcpc: sending discover
udhcpc: sending discover
udhcpc: sending select for 192.168.11.7
udhcpc: lease of 192.168.11.7 obtained, lease time 172800
/etc/udhcpc.d/50default: Adding DNS 192.168.11.1

 

MobaXtermなどを使うことで、PCから無線での接続が簡単にできます。

 

USB-LAN変換アダプタを使う場合

Wifiではなく、USB-LAN変換アダプタを使って有線LANでも対応できます。

 

PCとUSB-LAN接続した状態で下記で出来ました。

modprobe g_ether
ifconfig

 

IPアドレスを確認して、PC側から接続すればOKです。

root@u96v2-sbc-base-2021-2:~# modprobe g_ether
root@u96v2-sbc-base-2021-2:~# ifconfig
eth0      Link encap:Ethernet  HWaddr C4:36:C0:EA:D5:D4
          inet addr:169.254.191.222  Bcast:169.254.255.255  Mask:255.255.0.0
          inet6 addr: fe80::c636:c0ff:feea:d5d4/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:92 errors:0 dropped:0 overruns:0 frame:0
          TX packets:48 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:6941 (6.7 KiB)  TX bytes:10088 (9.8 KiB)

 

Vitis AIのデモ・サンプルを動かしてみる

後はhackster.ioの記事を参考にデモ・サンプルを動かせばOKです。

車の検出、人の姿勢を検出するデモなどが入っています。

cd ~/Vitis-AI/demo/VART/adas_detection
./adas_detection ./video/adas.avi /usr/share/vitis_ai_library/models/yolov3_adas_pruned_0_9/yolov3_adas_pruned_0_9.xmodel

 

cd ~/Vitis-AI/demo/VART/pose_detection
./pose_detection ./video/pose.mp4 /usr/share/vitis_ai_library/models/sp_net/sp_net.xmodel /usr/share/vitis_ai_library/models/ssd_pedestrian_pruned_0_97/ssd_pedestrian_pruned_0_97.xmodel

 

まとめ

Aventのプラットフォームを使えば、簡単にUltra96-v2でVitis-AIのデモを動かせます。

是非皆さまも試してみて下さい。

コメント