Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,8 @@ SUBDIRS = \
src/ucm \
src/ucs \
src/uct \
src/ucp
src/ucp \
stubs

if HAVE_UCG
SUBDIRS += $(UCG_SUBDIR)
Expand Down
6 changes: 6 additions & 0 deletions config/m4/cuda.m4
Original file line number Diff line number Diff line change
Expand Up @@ -232,4 +232,10 @@ AS_IF([test "x$cuda_checked" != "xyes"],
UCX_CUDA_CHECK_NVCC
]) # "x$cuda_checked" != "xyes"

# Set stubs include path for pkg-config
# e.g. UCX Device API headers include <uct/ib/mlx5/gdaki/gdaki.cuh>
# from a separate package. Stubs provide fallback when not installed.
STUB_CFLAGS="-I\${includedir}/stubs"
AC_SUBST([STUB_CFLAGS])

]) # UCX_CHECK_CUDA
1 change: 1 addition & 0 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -367,6 +367,7 @@ AC_SUBST([build_bindings], [${build_bindings}])
# Final output
#
AC_CONFIG_FILES([Makefile
stubs/Makefile
docs/doxygen/header.tex
src/uct/api/version.h
])
Expand Down
13 changes: 13 additions & 0 deletions stubs/Makefile.am
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#
# Copyright (c) NVIDIA CORPORATION & AFFILIATES, 2025. ALL RIGHTS RESERVED.
# See file LICENSE for terms.
#

# Stub headers: provide fallback if required package not installed.

stubincludedir = $(includedir)/stubs

# install gdaki stub headers in case of ucx-ib-mlx5-gda not installed.
nobase_stubinclude_HEADERS = \
uct/ib/mlx5/gdaki/gdaki.cuh \
uct/ib/mlx5/gdaki/gdaki_dev.h
100 changes: 100 additions & 0 deletions stubs/uct/ib/mlx5/gdaki/gdaki.cuh
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
/**
* Copyright (c) NVIDIA CORPORATION & AFFILIATES, 2025. ALL RIGHTS RESERVED.
* See file LICENSE for terms.
*/

#ifndef UCT_GDAKI_CUH_H
#define UCT_GDAKI_CUH_H

/*
* Stub implementation for GDAKI (GPU Direct Async Kernel Interface).
* This file provides stub functions when DOCA GPUNetIO package is not available.
* If DOCA GPUNetIO is installed, the real implementation from that package
* will be used instead (via higher priority include path).
*/

#include "gdaki_dev.h"
#include <ucs/sys/device_code.h>
#include <ucs/type/status.h>

/**
* Stub implementation: put_single operation
* Returns UCS_ERR_UNSUPPORTED as GDAKI is not available
*/
template<ucs_device_level_t level>
UCS_F_DEVICE ucs_status_t uct_rc_mlx5_gda_ep_put_single(
uct_device_ep_h tl_ep, const uct_device_mem_element_t *tl_mem_elem,
const void *address, uint64_t remote_address, size_t length,
uint64_t flags, uct_device_completion_t *comp)
{
return UCS_ERR_UNSUPPORTED;
}

/**
* Stub implementation: atomic_add operation
* Returns UCS_ERR_UNSUPPORTED as GDAKI is not available
*/
template<ucs_device_level_t level>
UCS_F_DEVICE ucs_status_t uct_rc_mlx5_gda_ep_atomic_add(
uct_device_ep_h tl_ep, const uct_device_mem_element_t *tl_mem_elem,
uint64_t value, uint64_t remote_address, uint64_t flags,
uct_device_completion_t *comp)
{
return UCS_ERR_UNSUPPORTED;
}

/**
* Stub implementation: put_multi operation
* Returns UCS_ERR_UNSUPPORTED as GDAKI is not available
*/
template<ucs_device_level_t level>
UCS_F_DEVICE ucs_status_t uct_rc_mlx5_gda_ep_put_multi(
uct_device_ep_h tl_ep, const uct_device_mem_element_t *tl_mem_list,
unsigned mem_list_count, void *const *addresses,
const uint64_t *remote_addresses, const size_t *lengths,
uint64_t counter_inc_value, uint64_t counter_remote_address,
uint64_t flags, uct_device_completion_t *tl_comp)
{
return UCS_ERR_UNSUPPORTED;
}

/**
* Stub implementation: put_multi_partial operation
* Returns UCS_ERR_UNSUPPORTED as GDAKI is not available
*/
template<ucs_device_level_t level>
UCS_F_DEVICE ucs_status_t uct_rc_mlx5_gda_ep_put_multi_partial(
uct_device_ep_h tl_ep, const uct_device_mem_element_t *tl_mem_list,
const unsigned *mem_list_indices, unsigned mem_list_count,
void *const *addresses, const uint64_t *remote_addresses,
const size_t *local_offsets, const size_t *remote_offsets,
const size_t *lengths, unsigned counter_index,
uint64_t counter_inc_value, uint64_t counter_remote_address,
uint64_t flags, uct_device_completion_t *tl_comp)
{
return UCS_ERR_UNSUPPORTED;
}

/**
* Stub implementation: endpoint progress
* No-op as GDAKI is not available
*/
template<ucs_device_level_t level>
UCS_F_DEVICE void uct_rc_mlx5_gda_ep_progress(uct_device_ep_h tl_ep)
{
/* No-op stub */
}

/**
* Stub implementation: check completion
* Returns UCS_ERR_UNSUPPORTED as GDAKI is not available
*/
template<ucs_device_level_t level>
UCS_F_DEVICE ucs_status_t uct_rc_mlx5_gda_ep_check_completion(
uct_device_ep_h tl_ep, uct_device_completion_t *tl_comp)
{
return UCS_ERR_UNSUPPORTED;
}

#endif /* UCT_GDAKI_CUH_H */

14 changes: 14 additions & 0 deletions stubs/uct/ib/mlx5/gdaki/gdaki_dev.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
/**
* Copyright (c) NVIDIA CORPORATION & AFFILIATES, 2025. ALL RIGHTS RESERVED.
* See file LICENSE for terms.
*/

#ifndef UCT_GDAKI_DEV_H
#define UCT_GDAKI_DEV_H

#include <uct/api/device/uct_device_types.h>

typedef struct {
} uct_rc_gda_completion_t;

#endif /* UCT_GDAKI_DEV_H */
2 changes: 1 addition & 1 deletion ucx.pc.in
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ includedir = @includedir@
Name: @PACKAGE@
Description: Unified Communication X Library
Version: @VERSION@
Cflags: -I${includedir}
Cflags: -I${includedir} @STUB_CFLAGS@
Libs: -L${libdir} -lucp
Libs.private: -Wl,--undefined=ucp_global_init
Requires: @PACKAGE@-uct, @PACKAGE@-ucs
1 change: 1 addition & 0 deletions ucx.spec.in
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,7 @@ rm -f %{buildroot}%{_libdir}/ucx/lib*.so

%files devel
%{_includedir}/uc*
%{_includedir}/stubs
%{_libdir}/lib*.so
%{_libdir}/pkgconfig/ucx.pc
%{_libdir}/pkgconfig/ucx-uct.pc
Expand Down
Loading