Repository navigation
fix(rocr): load thunk libraries from the runtime directory - #8912
Conversation
❌ PR Check — Action Required
📖 Need help? See the Policy FAQ for details on every check and how to fix failures. |
|
🚫 Please fix the failed policies before requesting reviews. The following policy checks failed:
The |
kentrussell
left a comment
There was a problem hiding this comment.
Thunk part is fine. Will let David/Chris give the approval for the ROCr side
cfreeamd
left a comment
There was a problem hiding this comment.
🤖 AI-assisted pre-review (for @cfreeamd)
The adjacent-path loader fallback in thunk_loader.cpp and the new os::GetAdjacentLibraryPath implementations (Linux dladdr, Windows GetModuleHandleExA/GetModuleFileNameA) look correct — self-locating via the runtime's own address, with sane truncation handling on Windows and a null-guard on DlError(). Two inline notes below (one Question on the bundled .ver exports, one Nit on the success log). Noting the PR is labeled "Not ready to Review," so this is early feedback.
Signed-off-by: Flora Cui <flora.cui@amd.com>
5495cc3 to
ed7768a
Compare
cfreeamd
left a comment
There was a problem hiding this comment.
🤖 AI-assisted pre-review (for @cfreeamd) — follow-up after author update
Both prior items are resolved:
- [Question] bundled
.verABI additions — resolved. Confirmed by the author reply ("belongs to another PR and was included here by mistake") and the commit was dropped;libhsakmt.ver/librocdxg.verare no longer in the diff. The PR is now a single commit scoped to the adjacent-path loader. - [Nit] success log + typo — resolved. The success
debug_printnow logsloaded_path(so the log reveals when the adjacent fallback path was used), and thesuccessullytypo is corrected tosuccessfully.
No new concerns from the changes. The loader fallback and both os::GetAdjacentLibraryPath implementations remain correct.
Motivation
rocminfo
WSL environment detected.
Cannot load librocdxg.so, failed:librocdxg.so: cannot open shared object file: No such file or directory
GetExportAddress failed: /opt/venv/lib/python3.14/site-packages/_rocm_sdk_devel/bin/../lib/libhsa-runtime64.so.1: undefined symbol: hsaKmtOpenKFD
hsa_init Failed, possibly no supported GPU devices
Technical Details
Add a fallback path for loading thunk libraries when the normal platform library search fails.
The fallback locates the directory containing the currently loaded ROCR runtime library and attempts to load the thunk library from the same directory.
Issue Tracking
Test Plan
rocminfo pass without specified LD_LIBRARY_PATH setting
Test Result
rocminfo pass
Submission Checklist