npu: fix xdna/iron build on ROCm 7.2.2 base image#84
Open
poad42 wants to merge 4 commits into
Open
Conversation
The base image bump to the ROCm 7.2.2 PyTorch image broke the xdna and iron builds. This adapts them to the new toolchain and XRT: - xdna: install cmake/ninja-build/build-essential (no longer in base) - xdna: call xrtdeps.sh -docker directly instead of amdxdna_deps.sh, which does not forward -docker and so fails installing host kernel headers - xdna: build the userspace with -nokmod; the amdxdna kernel module is built and loaded on the host, not inside the container (host kernel != container) - iron/setup.sh: detect the NPU by AIE architecture (aie2/aie2p) since newer xrt-smi reports a generic device name instead of the marketing name - iron: drop the -l login-shell flag (consistency after conda removal) - xdna/ryzenai_cvml: drop hardcoded HSA_OVERRIDE_GFX_VERSION; ROCm 7.2.2 detects the Ryzen AI iGPUs natively (documented per-silicon in the README) - add .gitattributes to force LF on *.sh (CRLF breaks shebangs in containers) Co-authored-by: Cursor <cursoragent@cursor.com>
Keep the inline comments to short descriptions of the lines and move the rationale here. Build dependencies: amdxdna_deps.sh does not forward -docker to xrtdeps.sh, so xrtdeps tries to install linux-headers-$(uname -r) (the host kernel) and the whole apt batch fails, taking Boost and friends with it. We call xrtdeps.sh directly with -docker so kernel headers are skipped, and install jq (the only extra package amdxdna_deps.sh would add) ourselves. Userspace build (-nokmod): inside a container uname -r is the host kernel, so linux-headers are unavailable on non-Ubuntu hosts (Arch, Fedora, custom kernels) and the amdxdna module cannot be loaded from a container anyway. The kernel driver is installed and loaded on the host instead. Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Keep the inline comment short and move the rationale here. Newer xrt-smi (XRT >= 2.20, shipped with ROCm 7.2.x) reports the part by architecture and a generic device name (e.g. "RyzenAI-npu4", "aie2p") instead of the marketing name, so we match on the AIE architecture as the stable signal: aie2 -> Phoenix/Hawk Point -> npu1, aie2p -> Strix/Strix Halo/Krackan -> npu2. aie2p is checked first since "aie2p" also contains "aie2". Co-authored-by: Cursor <cursoragent@cursor.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The base image bump to the ROCm 7.2.2 PyTorch image broke the xdna and iron builds. This adapts them to the new toolchain and XRT: