Fix hw_context bitstream unlock on client exit - #9957
Merged
chvamshi-xilinx merged 1 commit intoAug 5, 2026
Conversation
Contributor
|
clang-tidy review says "All clean, LGTM! 👍" |
Contributor
There was a problem hiding this comment.
Pull request overview
This PR addresses an edge-driver cleanup gap where applications using xrt::hw_context could exit without fully releasing the slot/xclbin on DFX platforms, leaving the bitstream marked “in-use” and preventing subsequent runs from reloading a new xclbin without reboot.
Changes:
- Add a
zocl_fini_client_hw_ctxs()teardown path to release per-clienthw_ctx_listresources on client exit. - Invoke the new hw_context teardown from
zocl_destroy_client()prior tokds_fini_client().
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Signed-off-by: Takasi, Manoj <Manoj.Takasi@amd.com>
ManojTakasi
force-pushed
the
petalinux-xrt-v2026.2_06161249
branch
from
August 5, 2026 11:08
fd248f3 to
e6e3d88
Compare
Contributor
|
clang-tidy review says "All clean, LGTM! 👍" |
chvamshi-xilinx
approved these changes
Aug 5, 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
https://jira.xilinx.com/browse/CR-1276107 Legacy ctx_list cleanup did not cover xrt::hw_context apps. Add zocl_fini_client_hw_ctxs() in zocl_destroy_client().
Bug / issue (if any) fixed, which PR introduced the bug, how it was discovered
When a host application using the xrt::hw_context API exits on a DFX platform, the hw_context / xclbin is not fully released. Slot 0 remains in-use, so a subsequent run without reboot fails with [drm:zocl_xclbin_read_axlf [zocl]] ERROR Current xclbin is in-use, can't change
How problem was solved, alternative solutions (if any) and why they were rejected
Added zocl_fini_client_hw_ctxs() in zocl_kds.c and call it from zocl_destroy_client() before kds_fini_client(). On client exit this function:
Risks (if any) associated the changes in the commit
low
What has been tested and how, request additional testing if necessary
Tested on vck190 hw.
Documentation impact (if any)
NA