-
Notifications
You must be signed in to change notification settings - Fork 150
Fix plugin directory. #812
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
👋 Hi aoxy! Thank you for contributing to ai-dynamo/nixl. Your PR reviewers will review your contribution then trigger the CI to test your changes. 🚀 |
/ok to test 76cd8b0 |
/build |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will work for build directory, but it will break loading from installation directory
You're right. Blossom CI passed. So we seem to have a testing gap with wheels in CI. |
What?
This PR fixes a bug in the plugin directory resolution logic in
getPluginDir()
. Previously, the code attempted to locate plugins in a non-existentcore/plugins
directory. With certain build setups, this resulted in plugin loading failures, as reported when running./examples/cpp/nixl_example
:$ NIXL_LOG_LEVEL=DEBUG ./examples/cpp/nixl_example I0919 19:06:48.573057 96808 nixl_agent.cpp:122] NIXL ETCD is excluded I0919 19:06:48.573148 96808 nixl_agent.cpp:122] NIXL ETCD is excluded I0919 19:06:48.573169 96808 nixl_plugin_manager.cpp:197] Loading plugins from file: /home/aoxy/projs/nixl/my_build/pluginlist I0919 19:06:48.628053 96808 nixl_plugin_manager.cpp:206] Loading plugins from: /home/aoxy/projs/nixl/my_build/examples/cpp/../../src/core/plugins E0919 19:06:48.628149 96808 nixl_plugin_manager.cpp:297] Error accessing directory("/home/aoxy/projs/nixl/my_build/examples/cpp/../../src/core/plugins"): No such file or directory ...
Why?
The root cause of the bug is the logic for deriving the plugin directory path using
std::filesystem::path::parent_path
. The code snippet is:If
info.dli_fname
is/home/aoxy/projs/nixl/my_build/examples/cpp/../../src/core/libnixl.so
, thenstd::filesystem::path(info.dli_fname).parent_path()
results in/home/aoxy/projs/nixl/my_build/examples/cpp/../../src/core
. This means the code searches for plugins undercore/plugins
, which does not exist.Reference on how
parent_path
works:https://en.cppreference.com/w/cpp/filesystem/path/parent_path
List of the actual directory structure:
The correct plugin directory should be
/home/aoxy/projs/nixl/my_build/examples/cpp/../../src/plugins
.How?
The fix is to use
parent_path()
twice oninfo.dli_fname
before appending"plugins"
, so that the plugin directory is set to the correct location abovecore
(i.e., directly undersrc
). Specifically, changeto
This ensures the resolved path will be
/home/aoxy/projs/nixl/my_build/examples/cpp/../../src/plugins
, matching the actual project layout and fixing the loading error.