Skip to content

Commit

Permalink
Explicitly load xdp_core library before all XDP Plugin in Client Flow. (
Browse files Browse the repository at this point in the history
  • Loading branch information
IshitaGhosh authored May 1, 2024
1 parent 8065e20 commit 29e2c96
Showing 1 changed file with 33 additions and 0 deletions.
33 changes: 33 additions & 0 deletions src/runtime_src/core/common/xdp/profile.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,24 @@
// to the corresponding xdp plugins. It is responsible for loading all of
// modules.

namespace xrt_core::xdp::core {
void
register_callbacks(void*)
{}

void
warning_callbacks()
{}

void
load_core()
{
static xrt_core::module_loader xdp_core_loader("xdp_core",
register_callbacks,
warning_callbacks);
}
}

namespace xrt_core::xdp::aie::profile {

std::function<void (void*)> update_device_cb;
Expand Down Expand Up @@ -271,6 +289,21 @@ update_device(void* handle)
/* Adding the macro guard as the static instances of the following plugins
* get created unnecessarily when the configs are enabled on Edge.
*/

if (xrt_core::config::get_ml_timeline()
|| xrt_core::config::get_aie_profile()
|| xrt_core::config::get_aie_trace()
|| xrt_core::config::get_aie_debug()) {
/* All the above plugins are dependent on xdp_core library. So,
* explicitly load it to avoid library search issue in implicit loading.
*/
try {
xrt_core::xdp::core::load_core();
} catch (...) {
return;
}
}

if (xrt_core::config::get_aie_profile()) {
try {
xrt_core::xdp::aie::profile::load();
Expand Down

0 comments on commit 29e2c96

Please sign in to comment.