Xilinx Alveo U50LV を Ubuntu 20.04 上でセットアップした際のメモ。
概要
基本的にはオフィシャルのドキュメント通りやればよいはずだが、
今回 U50LV に限ったハマり方をしたようなのでその対処法も含めて記す。
XRT のダウンロード
公式からザイリンクスランタイム(XRT) をダウンロードする。
ページ下部から自分に合う環境を選ぶとダウンロードリンクが表示される。
プラットフォームのダウンロード
通常は、上記 XRT の下にある、ターゲットプラットフォームを合わせてダウンロードすれば良いが、
この中には U50LV 用のイメージが含まれていないため、セットアップが最後まで通らない。
そこで Vitis-AI 用の公式GitHub上の情報を参照する。
Alveo 用のセットアップファイル群などはコチラ。
自分のカードに対応した README.md を参照する。
セットアップスクリプトを用いても良いし、自分で手動インストールしてもよい。
今回は公式ページの XRT の方が新しかったので、プラットフォームだけリンクを参照したいので、
"Advanced" の項から U50LV 用のプラットフォームを選択してダウンロードした。
セットアップ
1 2 3 4 |
$ sudo apt install xrt*.deb $ tar zxvf xilinx*tar.gz $ sudo apt install xilinx*.deb # 次行(シェルイメージのフラッシュ)のコマンドが最後に出力される $ sudo /opt/xilinx/xrt/bin/xbmgmt flash --update --shell xilinx_u50lv_gen3x4_xdma_base_2 |
Status: shell needs updating
Current shell: xilinx_u50lv_recovery
Shell to be flashed: xilinx_u50lv_gen3x4_xdma_base_2
Are you sure you wish to proceed? [y/n]: y
Updating shell on card[0000:01:00.0]
Bitstream guard installed on flash @0x1002000
Persisted 451420 bytes of meta data to flash 0 @0x7f91c78
Extracting bitstream from MCS data:
...........................
Extracted 27649052 bytes from bitstream @0x1002000
Writing bitstream to flash 0:
...........................
Bitstream guard removed from flash
Successfully flashed Card[0000:01:00.0]
1 Card(s) flashed successfully.
Cold reboot machine to load the new image on card(s).
Current shell: xilinx_u50lv_recovery
Shell to be flashed: xilinx_u50lv_gen3x4_xdma_base_2
Are you sure you wish to proceed? [y/n]: y
Updating shell on card[0000:01:00.0]
Bitstream guard installed on flash @0x1002000
Persisted 451420 bytes of meta data to flash 0 @0x7f91c78
Extracting bitstream from MCS data:
...........................
Extracted 27649052 bytes from bitstream @0x1002000
Writing bitstream to flash 0:
...........................
Bitstream guard removed from flash
Successfully flashed Card[0000:01:00.0]
1 Card(s) flashed successfully.
Cold reboot machine to load the new image on card(s).
マシン再起動(Cold-Boot)。
1 |
$ sudo /opt/xilinx/xrt/bin/xbmgmt flash --update --shell xilinx_u50lv_gen3x4_xdma_base_2 |
Status: SC needs updating
Current SC: 5.0
SC to be flashed: 5.1.7
Are you sure you wish to proceed? [y/n]: y
Updating SC firmware on card[0000:01:00.0]
Stopping user function...
...............................
Successfully flashed Card[0000:01:00.0]
1 Card(s) flashed successfully.
Current SC: 5.0
SC to be flashed: 5.1.7
Are you sure you wish to proceed? [y/n]: y
Updating SC firmware on card[0000:01:00.0]
Stopping user function...
...............................
Successfully flashed Card[0000:01:00.0]
1 Card(s) flashed successfully.
Validation
1 |
$ sudo lspci -vd 10ee: |
01:00.0 Processing accelerators: Xilinx Corporation Device 5060
Subsystem: Xilinx Corporation Device 000e
Flags: bus master, fast devsel, latency 0, NUMA node 0
Memory at 38072000000 (64-bit, prefetchable) [size=32M]
Memory at 38074020000 (64-bit, prefetchable) [size=128K]
Capabilities: [40] Power Management version 3
Capabilities: [60] MSI-X: Enable+ Count=32 Masked-
Capabilities: [70] Express Endpoint, MSI 00
Capabilities: [100] Advanced Error Reporting
Capabilities: [1c0] Secondary PCI Express
Capabilities: [e00] Access Control Services
Capabilities: [e10] Resizable BAR >
Capabilities: [e80] Vendor Specific Information: ID=0020 Rev=0 Len=010 >
Kernel driver in use: xclmgmt
Kernel modules: xclmgmt
01:00.1 Processing accelerators: Xilinx Corporation Device 5061
Subsystem: Xilinx Corporation Device 000e
Flags: bus master, fast devsel, latency 0, IRQ 411, NUMA node 0
Memory at 38070000000 (64-bit, prefetchable) [size=32M]
Memory at 38074000000 (64-bit, prefetchable) [size=128K]
Memory at 38060000000 (64-bit, prefetchable) [size=256M]
Capabilities: [40] Power Management version 3
Capabilities: [60] MSI-X: Enable+ Count=32 Masked-
Capabilities: [70] Express Endpoint, MSI 00
Capabilities: [100] Advanced Error Reporting
Capabilities: [e00] Access Control Services
Capabilities: [e10] Resizable BAR >
Capabilities: [e80] Vendor Specific Information: ID=0020 Rev=0 Len=010 >
Kernel driver in use: xocl
Kernel modules: xocl
Subsystem: Xilinx Corporation Device 000e
Flags: bus master, fast devsel, latency 0, NUMA node 0
Memory at 38072000000 (64-bit, prefetchable) [size=32M]
Memory at 38074020000 (64-bit, prefetchable) [size=128K]
Capabilities: [40] Power Management version 3
Capabilities: [60] MSI-X: Enable+ Count=32 Masked-
Capabilities: [70] Express Endpoint, MSI 00
Capabilities: [100] Advanced Error Reporting
Capabilities: [1c0] Secondary PCI Express
Capabilities: [e00] Access Control Services
Capabilities: [e10] Resizable BAR >
Capabilities: [e80] Vendor Specific Information: ID=0020 Rev=0 Len=010 >
Kernel driver in use: xclmgmt
Kernel modules: xclmgmt
01:00.1 Processing accelerators: Xilinx Corporation Device 5061
Subsystem: Xilinx Corporation Device 000e
Flags: bus master, fast devsel, latency 0, IRQ 411, NUMA node 0
Memory at 38070000000 (64-bit, prefetchable) [size=32M]
Memory at 38074000000 (64-bit, prefetchable) [size=128K]
Memory at 38060000000 (64-bit, prefetchable) [size=256M]
Capabilities: [40] Power Management version 3
Capabilities: [60] MSI-X: Enable+ Count=32 Masked-
Capabilities: [70] Express Endpoint, MSI 00
Capabilities: [100] Advanced Error Reporting
Capabilities: [e00] Access Control Services
Capabilities: [e10] Resizable BAR >
Capabilities: [e80] Vendor Specific Information: ID=0020 Rev=0 Len=010 >
Kernel driver in use: xocl
Kernel modules: xocl
1 |
$ sudo /opt/xilinx/xrt/bin/xbmgmt flash --scan |
Card [0000:01:00.0]
Card type: u50lv
Flash type: SPI
Flashable partition running on FPGA:
xilinx_u50lv_gen3x4_xdma_base_2,[ID=0xca1bd5610169a52c],[SC=5.1.7]
Flashable partitions installed in system:
xilinx_u50lv_gen3x4_xdma_base_2,[ID=0xca1bd5610169a52c],[SC=5.1.7]
Card type: u50lv
Flash type: SPI
Flashable partition running on FPGA:
xilinx_u50lv_gen3x4_xdma_base_2,[ID=0xca1bd5610169a52c],[SC=5.1.7]
Flashable partitions installed in system:
xilinx_u50lv_gen3x4_xdma_base_2,[ID=0xca1bd5610169a52c],[SC=5.1.7]
1 |
$ sudo /opt/xilinx/xrt/bin/xbutil validate |
INFO: Found 1 cards
INFO: Validating card[0]: xilinx_u50lv_gen3x4_xdma_base_2
INFO: == Starting AUX power connector check:
AUX power connector not available. Skipping validation
INFO: == AUX power connector check SKIPPED
INFO: == Starting Power warning check:
INFO: == Power warning check PASSED
INFO: == Starting PCIE link check:
INFO: == PCIE link check PASSED
INFO: == Starting SC firmware version check:
INFO: == SC firmware version check PASSED
INFO: == Starting verify kernel test:
INFO: == verify kernel test PASSED
INFO: == Starting IOPS test:
..Maximum IOPS: 44690
INFO: == IOPS test PASSED
INFO: == Starting DMA test:
Host -> PCIe -> FPGA write bandwidth = 3312.072245 MB/s
Host <- PCIe <- FPGA read bandwidth = 3372.059327 MB/s
INFO: Validating card[0]: xilinx_u50lv_gen3x4_xdma_base_2
INFO: == Starting AUX power connector check:
AUX power connector not available. Skipping validation
INFO: == AUX power connector check SKIPPED
INFO: == Starting Power warning check:
INFO: == Power warning check PASSED
INFO: == Starting PCIE link check:
INFO: == PCIE link check PASSED
INFO: == Starting SC firmware version check:
INFO: == SC firmware version check PASSED
INFO: == Starting verify kernel test:
INFO: == verify kernel test PASSED
INFO: == Starting IOPS test:
..Maximum IOPS: 44690
INFO: == IOPS test PASSED
INFO: == Starting DMA test:
Host -> PCIe -> FPGA write bandwidth = 3312.072245 MB/s
Host <- PCIe <- FPGA read bandwidth = 3372.059327 MB/s
(つづき)
INFO: == DMA test PASSED
INFO: == Starting device memory bandwidth test:
............
Maximum throughput: 41907 MB/s
INFO: == device memory bandwidth test PASSED
INFO: == Starting PCIE peer-to-peer test:
P2P BAR is not enabled. Skipping validation
INFO: == PCIE peer-to-peer test SKIPPED
INFO: == Starting memory-to-memory DMA test:
M2M is not available. Skipping validation
INFO: == memory-to-memory DMA test SKIPPED
INFO: == Starting host memory bandwidth test:
Host_mem is not available. Skipping validation
INFO: == host memory bandwidth test SKIPPED
INFO: Card[0] validated successfully.
INFO: All cards validated successfully.
INFO: == Starting device memory bandwidth test:
............
Maximum throughput: 41907 MB/s
INFO: == device memory bandwidth test PASSED
INFO: == Starting PCIE peer-to-peer test:
P2P BAR is not enabled. Skipping validation
INFO: == PCIE peer-to-peer test SKIPPED
INFO: == Starting memory-to-memory DMA test:
M2M is not available. Skipping validation
INFO: == memory-to-memory DMA test SKIPPED
INFO: == Starting host memory bandwidth test:
Host_mem is not available. Skipping validation
INFO: == host memory bandwidth test SKIPPED
INFO: Card[0] validated successfully.
INFO: All cards validated successfully.