AIESW-32262: Fix xrt::bo::get_memory_group() for cross-device imported BOs#9926
Open
svup-xilinx wants to merge 1 commit into
Open
AIESW-32262: Fix xrt::bo::get_memory_group() for cross-device imported BOs#9926svup-xilinx wants to merge 1 commit into
svup-xilinx wants to merge 1 commit into
Conversation
… BOs xrt::bo::get_memory_group() returned a stale memory bank index for a BO imported from another device. bo_impl::get_bo_properties() took grpid directly from the shim-reported xcl_bo_flags.bank, which for an imported BO reflects the exporting device's bank assignment and is meaningless on the importing device. The BO's physical address (prop.paddr), however, is valid in the importing device's address space even for imported BOs. Recompute grpid from that address against the importing device's own GROUP_TOPOLOGY, using the existing address_to_memidx() helper. The recompute is gated on is_imported() so allocation-path behavior for normal BOs is unchanged, and falls back to the original flags.bank value if the device has no core device, no loaded topology section, or the address doesn't map to any bank. Tested with a cross-device dma-buf export/import repro on VEK385 (NPU device 0 -> PL device 1); get_memory_group() now returns the correct bank index on the importing device. Signed-off-by: Srikanth Vuppala <120363307+svup-xilinx@users.noreply.github.com>
Contributor
|
clang-tidy review says "All clean, LGTM! 👍" |
stsoe
approved these changes
Jul 17, 2026
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.
Problem solved by the commit
get_memory_group() returned the wrong bank index for a BO imported
from another device — it used the exporting device's stale bank flag
instead of a value valid on the importing device.
Bug / issue (if any) fixed, which PR introduced the bug, how it was discovered
AIESW-32262
How problem was solved, alternative solutions (if any) and why they were rejected
bo_impl::get_bo_properties() now recomputes grpid for imported BOs
(gated by is_imported()) from the BO's physical address, which is
valid on the importing device, using the already-existing but unused
address_to_memidx() helper against the importing device's own
GROUP_TOPOLOGY.
Risks (if any) associated the changes in the commit
Low
What has been tested and how, request additional testing if necessary
Tested on telluride board with provided test in the ticket AIESW-32262
Documentation impact (if any)
NA