Skip to content

Nexus: lazy KernelDB loading for code objects#111

Draft
mawad-amd wants to merge 2 commits intomainfrom
muhaawad/nexus-lazy-kerneldb
Draft

Nexus: lazy KernelDB loading for code objects#111
mawad-amd wants to merge 2 commits intomainfrom
muhaawad/nexus-lazy-kerneldb

Conversation

@mawad-amd
Copy link
Copy Markdown
Member

Summary

  • Switch Nexus to use KernelDB's lazy loading API (addFile + ensureKernelLoaded) so code objects are indexed at load time but only disassembled on demand when a kernel is dispatched.
  • Point CPMAddPackage at the muhaawad/lazy-addfile KernelDB branch which adds the lazy loading support.
  • Add a POST_BUILD step to copy libkernelDB64.so next to libnexus.so so the $ORIGIN RPATH works in the build tree without LD_LIBRARY_PATH.

Depends on: https://github.com/AMDResearch/KernelDB/tree/muhaawad/lazy-addfile

🤖 Generated with Claude Code

mawad-amd and others added 2 commits March 22, 2026 22:24
Switch addFile() to lazy=true so nexus only indexes kernel names from
ELF .symtab at code-object registration time, deferring full
disassembly until a kernel is actually dispatched and traced. This
avoids the startup cost of eagerly disassembling every kernel in large
binaries (e.g. libtorch_hip.so with 56K+ kernels).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The $ORIGIN RPATH on libnexus.so resolves to build/lib/, but
libkernelDB64.so is built in build/_deps/kerneldb-build/. Without
LD_LIBRARY_PATH or a full install step, the runtime linker cannot
find it. Add a post-build copy so the build tree works out of the box.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@mawad-amd mawad-amd requested review from rwvo and removed request for rwvo April 1, 2026 08:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant