Skip to content

Commit 723fa85

Browse files
committed
core/hmem: Fix missing rocr dlopen function assignments
When libfabric is configured with "--with-rocr=$ROCM_PATH --enable-rocr-dlopen", three functions ("hsa_ops.hsa_signal_store_screlease", "hsa_ops.hsa_signal_load_scacquire", "hsa_ops.hsa_amd_agents_allow_access") are not mapped to their associated symbols from "libhsa-runtime64.so" in the initialization routine "rocr_hmem_dl_init()". This can lead to a segmentation violation and application crash. Resolves issue ofiwg#10797 Signed-off-by: Michael Lough <[email protected]> Signed-off-by: Steve Welch <[email protected]>
1 parent b136180 commit 723fa85

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

src/hmem_rocr.c

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -830,6 +830,30 @@ static int rocr_hmem_dl_init(void)
830830
goto err;
831831
}
832832

833+
hsa_ops.hsa_signal_store_screlease = dlsym(hsa_handle,
834+
"hsa_signal_store_screlease");
835+
if (!hsa_ops.hsa_signal_store_screlease) {
836+
FI_WARN(&core_prov, FI_LOG_CORE,
837+
"Failed to find hsa_signal_store_screlease\n");
838+
goto err;
839+
}
840+
841+
hsa_ops.hsa_signal_load_scacquire = dlsym(hsa_handle,
842+
"hsa_signal_load_scacquire");
843+
if (!hsa_ops.hsa_signal_load_scacquire) {
844+
FI_WARN(&core_prov, FI_LOG_CORE,
845+
"Failed to find hsa_signal_load_scacquire\n");
846+
goto err;
847+
}
848+
849+
hsa_ops.hsa_amd_agents_allow_access = dlsym(hsa_handle,
850+
"hsa_amd_agents_allow_access");
851+
if (!hsa_ops.hsa_amd_agents_allow_access) {
852+
FI_WARN(&core_prov, FI_LOG_CORE,
853+
"Failed to find hsa_amd_agents_allow_access\n");
854+
goto err;
855+
}
856+
833857
hsa_ops.hsa_signal_create = dlsym(hsa_handle, "hsa_signal_create");
834858
if (!hsa_ops.hsa_signal_create) {
835859
FI_WARN(&core_prov, FI_LOG_CORE,

0 commit comments

Comments
 (0)