Summary
The top-level CMakeLists.txt shipped in the source tarball asset of release
2.21.75 (2.21.75.tar.gz)
unconditionally adds the xdna/ subdirectory, which builds the AMD XDNA SHIM
(libxrt_driver_xdna.so) — a PCIe / NPU client component. On -DXRT_EDGE=ON
builds the PCIe support in xrt_core is intentionally not built, so linking
the XDNA shim fails. This breaks edge (Zynq / arm64) consumers of the release
tarball.
Reproduction
From the release tarball:
$ wget https://github.com/Xilinx/XRT/releases/download/2.21.75/2.21.75.tar.gz
$ tar xf 2.21.75.tar.gz && cd <extracted>
$ cmake -S . -B build -DXRT_EDGE=ON -DXRT_AIE_BUILD=ON
$ cmake --build build
...
[ 92%] Linking CXX shared library libxrt_driver_xdna.so
/usr/bin/ld: ...: undefined reference to `xrt_core::pci::register_driver(std::shared_ptr<xrt_core::pci::drv>)'
/usr/bin/ld: ...: undefined reference to `vtable for xrt_core::device_pcie'
/usr/bin/ld: ...: undefined reference to `xrt_core::pci::dev::~dev()'
/usr/bin/ld: ...: undefined reference to `xrt_core::pci::get_dev(unsigned int, bool)'
... (many more)
collect2: error: ld returned 1 exit status
make[3]: *** [xdna/xdna-driver/src/shim/CMakeFiles/xrt_driver_xdna.dir/build.make:426: ...] Error 1
Root cause
The XRT-UPSTREAM wrapper at the root of the release tarball adds xdna/
without checking the build mode:
CMakeLists.txt:11: add_subdirectory(xdna)
xdna/xdna-driver/CMake/upstream.cmake then unconditionally adds
src/shim/, which links against the xrt_core::pci::* symbols (e.g.
xrt_core::pci::register_driver, xrt_core::pci::dev,
xrt_core::device_pcie). Those are PCIe-only and are not built when
XRT_EDGE is set — see the if (NOT XRT_EDGE) guards in
xrt/XRT/src/runtime_src/CMakeLists.txt. Result: the XDNA shim is
compiled on an edge build but cannot link.
Impact
- Build (link) failure for anyone consuming the release tarball with
-DXRT_EDGE=ON (i.e. embedded / Zynq / arm64 targets).
- Hits Debian/Ubuntu packaging that ships an edge build alongside the
native amd64 build from the same source tree.
- amd64 builds are unaffected because
xrt_core::pci::* is present
there.
Suggested fix
Skip the xdna subdirectory on edge builds — the XDNA SHIM targets
AMD client NPU PCIe devices and has no meaning on Zynq edge platforms:
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -8,4 +8,9 @@ set(XRT_UPSTREAM_DEBIAN 1)
set(XRT_UPSTREAM 1)
add_subdirectory(xrt)
-add_subdirectory(xdna)
+# The xdna subdirectory builds the AMD XDNA SHIM, which is a PCIe
+# (Ryzen-AI NPU) component and depends on xrt_core PCIe symbols that
+# are not built on edge / Zynq targets.
+if (NOT XRT_EDGE)
+ add_subdirectory(xdna)
+endif()
Alternatively, the same guard could live in xdna-driver/CMake/upstream.cmake
so the xdna subproject self-guards.
Environment
- Distro: Ubuntu 26.04 LTS (arm64)
- cmake: 4.2.3-2ubuntu2
- g++: 15.2.0-5ubuntu1
- XRT release tarball: 2.21.75 (
2.21.75.tar.gz); also reproduces against
the xrt/ contents replaced with the 202610.2.23.0_Canonical tag.
Reported while packaging XRT for Ubuntu (source package xrt).
Summary
The top-level
CMakeLists.txtshipped in the source tarball asset of release2.21.75 (
2.21.75.tar.gz)unconditionally adds the
xdna/subdirectory, which builds the AMD XDNA SHIM(
libxrt_driver_xdna.so) — a PCIe / NPU client component. On-DXRT_EDGE=ONbuilds the PCIe support in
xrt_coreis intentionally not built, so linkingthe XDNA shim fails. This breaks edge (Zynq / arm64) consumers of the release
tarball.
Reproduction
From the release tarball:
Root cause
The
XRT-UPSTREAMwrapper at the root of the release tarball addsxdna/without checking the build mode:
CMakeLists.txt:11:add_subdirectory(xdna)xdna/xdna-driver/CMake/upstream.cmakethen unconditionally addssrc/shim/, which links against thexrt_core::pci::*symbols (e.g.xrt_core::pci::register_driver,xrt_core::pci::dev,xrt_core::device_pcie). Those are PCIe-only and are not built whenXRT_EDGEis set — see theif (NOT XRT_EDGE)guards inxrt/XRT/src/runtime_src/CMakeLists.txt. Result: the XDNA shim iscompiled on an edge build but cannot link.
Impact
-DXRT_EDGE=ON(i.e. embedded / Zynq / arm64 targets).native amd64 build from the same source tree.
xrt_core::pci::*is presentthere.
Suggested fix
Skip the
xdnasubdirectory on edge builds — the XDNA SHIM targetsAMD client NPU PCIe devices and has no meaning on Zynq edge platforms:
Alternatively, the same guard could live in
xdna-driver/CMake/upstream.cmakeso the xdna subproject self-guards.
Environment
2.21.75.tar.gz); also reproduces againstthe
xrt/contents replaced with the202610.2.23.0_Canonicaltag.Reported while packaging XRT for Ubuntu (source package
xrt).