Skip to content

Random tips

Maksim Levental edited this page Aug 21, 2024 · 3 revisions

Table of contents generated with markdown-toc

Git submodules

If something changes wrt submodules (someone changes a commit we're pinned to) then do

git submodule update --init --recursive

Run all CI tests locally

From build_tools/ci:

#!/bin/bash

set -eo pipefail

rm -rf test_matmuls test_aie_vs_cpu print_ir_aie2xclbin_results

IREE_BUILD_DIR=...
IREE_INSTALL=...
PEANO_INSTALL_DIR=...
XRT_DIR=/opt/xilinx/xrt
VITIS_DIR=/opt/Xilinx/Vitis/2024.1
MLIR_INSTALL_DIR=...
export XILINXD_LICENSE_FILE=$HOME/.Xilinx/aie.lic
PEANO_INSTALL_DIR=...

export GITHUB_ACTIONS=true
export PATH=$MLIR_INSTALL_DIR/bin:$PATH

rm -rf $IREE_INSTALL
pushd $IREE_BUILD_DIR
ninja clean
ninja
ctest -R amd-aie --output-on-failure -j
ninja install
popd

./run_matmul_test.sh test_matmuls $IREE_INSTALL $PEANO_INSTALL_DIR $XRT_DIR $VITIS_DIR
./cpu_comparison/run_test.py test_aie_vs_cpu $IREE_INSTALL $PEANO_INSTALL_DIR $XRT_DIR $VITIS_DIR
./print_ir_aie2xclbin/print_ir_aie2xclbin.sh $IREE_INSTALL print_ir_aie2xclbin_results $PEANO_INSTALL_DIR $XRT_DIR $VITIS_DIR

Driver

If you built xdna-driver from source and everything went smoothly but /opt/xilinx/xrt/bin/xrt-smi examine is still showing 0 devices then try sudo dmesg | grep amdxdna and look for something like

[1.789628] amdxdna 0000:c5:00.1: aie2_init: failed to request_firmware amdnpu/1502_00/npu.sbin, ret -2

which indicates you're missing the firmware at /usr/lib/firmware/amdnpu/1502_00. Possibly this is because you don't have jq installed and their script failed to download the firmware. You can find the full links/paths at xdna-driver/tools/info.json and thus you can just download and place/copy to the right place by hand.

Clone this wiki locally