Skip to content

Commit

Permalink
xrt/zocl split for faster build times
Browse files Browse the repository at this point in the history
* xrt is now build as a stage3 package in the board agnostic image, config can be found in sdbuild/ubuntu/jammy/aarch64/config
* xrt_zocl is a new package that builds the zocl kernel module using the petalinux project specific to the board -- it should be included in the .spec file of each board folder
  • Loading branch information
skalade committed Sep 28, 2022
1 parent 5512aff commit b23f3f6
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 13 deletions.
19 changes: 7 additions & 12 deletions sdbuild/packages/xrt/qemu.sh
Original file line number Diff line number Diff line change
@@ -1,38 +1,33 @@
# Set up some environment variables as /etc/environment
# isn't sourced in chroot

set -e
set -x


# build and install
cd /root
mkdir xrt-git
git clone https://github.com/Xilinx/XRT xrt-git
cd xrt-git
git checkout -b temp tags/202020.2.8.726
git checkout -b temp tags/202210.2.13.466

# An incorrect format specifier causes a crash on armhf
sed -i 's:%ld bytes):%lld bytes):' src/runtime_src/tools/xclbinutil/XclBinClass.cxx


cd build
chmod 755 build.sh
XRT_NATIVE_BUILD=no ./build.sh -dbg
XRT_NATIVE_BUILD=no ./build.sh -dbg -noctest
cd Debug
make install

cd ..
# Build and install xclbinutil
cd ../../
mkdir xclbinutil_build
sed -i 's/xdp_hw_emu_device_offload_plugin xdp_core xrt_coreutil xrt_hwemu/xdp_core xrt_coreutil/g' ./src/runtime_src/xdp/CMakeLists.txt
cd xclbinutil_build/
cmake ../../src/
cmake ../src/
make install -C runtime_src/tools/xclbinutil
mv /opt/xilinx/xrt/bin/unwrapped/xclbinutil /usr/local/bin/xclbinutil
rm -rf /opt/xilinx/xrt

# put platform name for xrt app
echo ${PYNQ_BOARD} > /etc/xocl.txt

# cleanup
cd /root
rm -rf xrt-git

Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,5 @@ sudo cp -f $script_dir/xrt_setup.sh $target/etc/profile.d
cd $BUILD_ROOT/${PYNQ_BOARD}/petalinux_project
petalinux-build -c zocl
sudo cp -rf $BUILD_ROOT/${PYNQ_BOARD}/petalinux_project/build/tmp/sysroots-components/*/zocl/usr $target
sudo cp -rf $BUILD_ROOT/${PYNQ_BOARD}/petalinux_project/build/tmp/sysroots-components/*/zocl/lib $target
sudo cp -rf $BUILD_ROOT/${PYNQ_BOARD}/petalinux_project/build/tmp/sysroots-components/*/zocl/lib $target/usr/

2 changes: 2 additions & 0 deletions sdbuild/packages/xrt_zocl/qemu.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# put platform name for xrt app
echo ${PYNQ_BOARD} > /etc/xocl.txt
File renamed without changes.

0 comments on commit b23f3f6

Please sign in to comment.