Skip to content

Commit 9684337

Browse files
committed
btl/ofi: use libfabric 1.18 API if available
This patch try to use 1.18 API when it is available. This is because 1.18 API clearly define provider's CUDA API behavior to be that provider can call CUDA API by default if application uses 1.18 API. When using older version of API, some libfabric will not claim support of FI_HMEM even if it is capable of supporting because the provider does not know whether CUDA calls are permitted. Signed-off-by: Wei Zhang <wzam@amazon.com>
1 parent df5a394 commit 9684337

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

opal/mca/btl/ofi/btl_ofi_component.c

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -350,8 +350,12 @@ static mca_btl_base_module_t **mca_btl_ofi_component_init(int *num_btl_modules,
350350
no_hmem:
351351
#endif
352352

353-
/* Do the query. The earliest version that supports FI_HMEM hints is 1.9 */
354-
rc = fi_getinfo(FI_VERSION(1, 9), NULL, NULL, 0, &hints, &info_list);
353+
/* Do the query. The earliest version that supports FI_HMEM hints is 1.9.
354+
* The earliest version the explictly allow provider to call CUDA API is 1.18 */
355+
rc = fi_getinfo(FI_VERSION(1, 18), NULL, NULL, 0, &hints, &info_list);
356+
if (FI_ENOSYS == -rc) {
357+
rc = fi_getinfo(FI_VERSION(1, 9), NULL, NULL, 0, &hints, &info_list);
358+
}
355359
if (0 != rc) {
356360
#if defined(FI_HMEM)
357361
if (hints.caps & FI_HMEM) {

0 commit comments

Comments
 (0)