Skip to content

Commit 87e88f7

Browse files
jeynmannJeynmannZ
andauthored
BUILD: Add stub include path for gdaki (#10971)
* BULID: Add gdaki header to stub include path * BUILD: add stub into package path --------- Co-authored-by: Zihao Zhao <[email protected]>
1 parent 4b3747d commit 87e88f7

File tree

8 files changed

+138
-2
lines changed

8 files changed

+138
-2
lines changed

Makefile.am

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,8 @@ SUBDIRS = \
4141
src/ucm \
4242
src/ucs \
4343
src/uct \
44-
src/ucp
44+
src/ucp \
45+
stubs
4546

4647
if HAVE_UCG
4748
SUBDIRS += $(UCG_SUBDIR)

config/m4/cuda.m4

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -232,4 +232,10 @@ AS_IF([test "x$cuda_checked" != "xyes"],
232232
UCX_CUDA_CHECK_NVCC
233233
]) # "x$cuda_checked" != "xyes"
234234
235+
# Set stubs include path for pkg-config
236+
# e.g. UCX Device API headers include <uct/ib/mlx5/gdaki/gdaki.cuh>
237+
# from a separate package. Stubs provide fallback when not installed.
238+
STUB_CFLAGS="-I\${includedir}/stubs"
239+
AC_SUBST([STUB_CFLAGS])
240+
235241
]) # UCX_CHECK_CUDA

configure.ac

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -367,6 +367,7 @@ AC_SUBST([build_bindings], [${build_bindings}])
367367
# Final output
368368
#
369369
AC_CONFIG_FILES([Makefile
370+
stubs/Makefile
370371
docs/doxygen/header.tex
371372
src/uct/api/version.h
372373
])

stubs/Makefile.am

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
#
2+
# Copyright (c) NVIDIA CORPORATION & AFFILIATES, 2025. ALL RIGHTS RESERVED.
3+
# See file LICENSE for terms.
4+
#
5+
6+
# Stub headers: provide fallback if required package not installed.
7+
8+
stubincludedir = $(includedir)/stubs
9+
10+
# install gdaki stub headers in case of ucx-ib-mlx5-gda not installed.
11+
nobase_stubinclude_HEADERS = \
12+
uct/ib/mlx5/gdaki/gdaki.cuh \
13+
uct/ib/mlx5/gdaki/gdaki_dev.h

stubs/uct/ib/mlx5/gdaki/gdaki.cuh

Lines changed: 100 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,100 @@
1+
/**
2+
* Copyright (c) NVIDIA CORPORATION & AFFILIATES, 2025. ALL RIGHTS RESERVED.
3+
* See file LICENSE for terms.
4+
*/
5+
6+
#ifndef UCT_GDAKI_CUH_H
7+
#define UCT_GDAKI_CUH_H
8+
9+
/*
10+
* Stub implementation for GDAKI (GPU Direct Async Kernel Interface).
11+
* This file provides stub functions when DOCA GPUNetIO package is not available.
12+
* If DOCA GPUNetIO is installed, the real implementation from that package
13+
* will be used instead (via higher priority include path).
14+
*/
15+
16+
#include "gdaki_dev.h"
17+
#include <ucs/sys/device_code.h>
18+
#include <ucs/type/status.h>
19+
20+
/**
21+
* Stub implementation: put_single operation
22+
* Returns UCS_ERR_UNSUPPORTED as GDAKI is not available
23+
*/
24+
template<ucs_device_level_t level>
25+
UCS_F_DEVICE ucs_status_t uct_rc_mlx5_gda_ep_put_single(
26+
uct_device_ep_h tl_ep, const uct_device_mem_element_t *tl_mem_elem,
27+
const void *address, uint64_t remote_address, size_t length,
28+
uint64_t flags, uct_device_completion_t *comp)
29+
{
30+
return UCS_ERR_UNSUPPORTED;
31+
}
32+
33+
/**
34+
* Stub implementation: atomic_add operation
35+
* Returns UCS_ERR_UNSUPPORTED as GDAKI is not available
36+
*/
37+
template<ucs_device_level_t level>
38+
UCS_F_DEVICE ucs_status_t uct_rc_mlx5_gda_ep_atomic_add(
39+
uct_device_ep_h tl_ep, const uct_device_mem_element_t *tl_mem_elem,
40+
uint64_t value, uint64_t remote_address, uint64_t flags,
41+
uct_device_completion_t *comp)
42+
{
43+
return UCS_ERR_UNSUPPORTED;
44+
}
45+
46+
/**
47+
* Stub implementation: put_multi operation
48+
* Returns UCS_ERR_UNSUPPORTED as GDAKI is not available
49+
*/
50+
template<ucs_device_level_t level>
51+
UCS_F_DEVICE ucs_status_t uct_rc_mlx5_gda_ep_put_multi(
52+
uct_device_ep_h tl_ep, const uct_device_mem_element_t *tl_mem_list,
53+
unsigned mem_list_count, void *const *addresses,
54+
const uint64_t *remote_addresses, const size_t *lengths,
55+
uint64_t counter_inc_value, uint64_t counter_remote_address,
56+
uint64_t flags, uct_device_completion_t *tl_comp)
57+
{
58+
return UCS_ERR_UNSUPPORTED;
59+
}
60+
61+
/**
62+
* Stub implementation: put_multi_partial operation
63+
* Returns UCS_ERR_UNSUPPORTED as GDAKI is not available
64+
*/
65+
template<ucs_device_level_t level>
66+
UCS_F_DEVICE ucs_status_t uct_rc_mlx5_gda_ep_put_multi_partial(
67+
uct_device_ep_h tl_ep, const uct_device_mem_element_t *tl_mem_list,
68+
const unsigned *mem_list_indices, unsigned mem_list_count,
69+
void *const *addresses, const uint64_t *remote_addresses,
70+
const size_t *local_offsets, const size_t *remote_offsets,
71+
const size_t *lengths, unsigned counter_index,
72+
uint64_t counter_inc_value, uint64_t counter_remote_address,
73+
uint64_t flags, uct_device_completion_t *tl_comp)
74+
{
75+
return UCS_ERR_UNSUPPORTED;
76+
}
77+
78+
/**
79+
* Stub implementation: endpoint progress
80+
* No-op as GDAKI is not available
81+
*/
82+
template<ucs_device_level_t level>
83+
UCS_F_DEVICE void uct_rc_mlx5_gda_ep_progress(uct_device_ep_h tl_ep)
84+
{
85+
/* No-op stub */
86+
}
87+
88+
/**
89+
* Stub implementation: check completion
90+
* Returns UCS_ERR_UNSUPPORTED as GDAKI is not available
91+
*/
92+
template<ucs_device_level_t level>
93+
UCS_F_DEVICE ucs_status_t uct_rc_mlx5_gda_ep_check_completion(
94+
uct_device_ep_h tl_ep, uct_device_completion_t *tl_comp)
95+
{
96+
return UCS_ERR_UNSUPPORTED;
97+
}
98+
99+
#endif /* UCT_GDAKI_CUH_H */
100+
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
/**
2+
* Copyright (c) NVIDIA CORPORATION & AFFILIATES, 2025. ALL RIGHTS RESERVED.
3+
* See file LICENSE for terms.
4+
*/
5+
6+
#ifndef UCT_GDAKI_DEV_H
7+
#define UCT_GDAKI_DEV_H
8+
9+
#include <uct/api/device/uct_device_types.h>
10+
11+
typedef struct {
12+
} uct_rc_gda_completion_t;
13+
14+
#endif /* UCT_GDAKI_DEV_H */

ucx.pc.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ includedir = @includedir@
1313
Name: @PACKAGE@
1414
Description: Unified Communication X Library
1515
Version: @VERSION@
16-
Cflags: -I${includedir}
16+
Cflags: -I${includedir} @STUB_CFLAGS@
1717
Libs: -L${libdir} -lucp
1818
Libs.private: -Wl,--undefined=ucp_global_init
1919
Requires: @PACKAGE@-uct, @PACKAGE@-ucs

ucx.spec.in

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -166,6 +166,7 @@ rm -f %{buildroot}%{_libdir}/ucx/lib*.so
166166

167167
%files devel
168168
%{_includedir}/uc*
169+
%{_includedir}/stubs
169170
%{_libdir}/lib*.so
170171
%{_libdir}/pkgconfig/ucx.pc
171172
%{_libdir}/pkgconfig/ucx-uct.pc

0 commit comments

Comments
 (0)