Skip to content

Commit b5b58be

Browse files
committed
AZP: integrate GPUNetIO detection from PR #10865
Why: GPU CI builds now require GPUNetIO; silently skipping it can pass CI and fail at runtime. Refs: #10861 #10865 Signed-off-by: Alexey Rivkin <[email protected]>
1 parent dc16de9 commit b5b58be

File tree

2 files changed

+56
-47
lines changed

2 files changed

+56
-47
lines changed

config/m4/cuda.m4

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ AS_IF([test "x$cuda_checked" != "xyes"],
8383
CUDART_STATIC_LIBS=""
8484
NVML_LIBS=""
8585
CUDA_BIN_PATH=""
86-
CUDA_LIB_DIR=""
86+
CUDA_LIB_DIRS=""
8787
8888
AS_IF([test ! -z "$with_cuda" -a "x$with_cuda" != "xyes" -a "x$with_cuda" != "xguess"],
8989
[ucx_check_cuda_dir="$with_cuda"
@@ -92,7 +92,7 @@ AS_IF([test "x$cuda_checked" != "xyes"],
9292
CUDA_CPPFLAGS="-I$with_cuda/include"
9393
CUDA_LDFLAGS="-L$ucx_check_cuda_libdir -L$ucx_check_cuda_libdir/stubs"
9494
CUDA_BIN_PATH="$with_cuda/bin"
95-
CUDA_LIB_DIR="$ucx_check_cuda_libdir"])
95+
CUDA_LIB_DIRS="$ucx_check_cuda_libdir $with_cuda/compat"])
9696
9797
CPPFLAGS="$CPPFLAGS $CUDA_CPPFLAGS"
9898
LDFLAGS="$LDFLAGS $CUDA_LDFLAGS"

src/uct/ib/mlx5/gdaki/configure.m4

Lines changed: 54 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -9,56 +9,65 @@ AC_ARG_WITH([doca-gpunetio],
99
[with_doca_gpunetio=$withval],
1010
[with_doca_gpunetio=guess])
1111

12-
AS_IF([test "x$cuda_happy" = "xyes"], [
1312

14-
# Default value
15-
GPUNETIO_CFLAGS=""
16-
GPUNETIO_LDFLAGS=""
17-
GPUNETIO_LIBS="-ldoca_gpunetio"
13+
AS_IF([test "x$cuda_happy" = "xyes"],
14+
[
15+
# Default value
16+
GPUNETIO_CFLAGS=""
17+
GPUNETIO_LDFLAGS=""
18+
GPUNETIO_LIBS="-ldoca_gpunetio"
19+
AS_IF([test "x$with_doca_gpunetio" != "xno"],
20+
[
21+
AS_IF([test "x$with_doca_gpunetio" = "xguess"],
22+
[
23+
AS_IF([$PKG_CONFIG --exists doca-gpunetio],
24+
[GPUNETIO_CFLAGS=$(pkg-config --cflags doca-gpunetio)
25+
GPUNETIO_LDFLAGS=$(pkg-config --libs-only-L doca-gpunetio)
26+
GPUNETIO_LIBS=$(pkg-config --libs-only-l doca-gpunetio)])
27+
],
28+
[
29+
GPUNETIO_CFLAGS="-I${with_doca_gpunetio}/include"
30+
for libdir in lib/x86_64-linux-gnu lib64; do
31+
if test -d "${with_doca_gpunetio}/${libdir}"; then
32+
GPUNETIO_LDFLAGS="$GPUNETIO_LDFLAGS -L${with_doca_gpunetio}/${libdir} "
33+
# Add rpath-link to search for doca_gpunetio dependencies
34+
GPUNETIO_LDFLAGS="$GPUNETIO_LDFLAGS -Wl,-rpath-link,${with_doca_gpunetio}/${libdir}"
35+
fi
36+
done
37+
# Add CUDA lib dirs to rpath-link for gpunetio
38+
for cuda_libdir in $CUDA_LIB_DIRS; do
39+
GPUNETIO_LDFLAGS="$GPUNETIO_LDFLAGS -Wl,-rpath-link,${cuda_libdir}"
40+
done
41+
]) # "x$with_doca_gpunetio" != "xguess"
42+
]) # "x$with_doca_gpunetio" != "xno"
1843
19-
AS_IF([test x$with_doca_gpunetio != xno], [
20-
AS_IF([test x$with_doca_gpunetio = xguess],
21-
[
22-
AS_IF([$PKG_CONFIG --exists doca-gpunetio],
23-
[
24-
# Guess from pkg-config
25-
GPUNETIO_CFLAGS=$(pkg-config --cflags doca-gpunetio)
26-
GPUNETIO_LDFLAGS=$(pkg-config --libs-only-L doca-gpunetio)
27-
GPUNETIO_LIBS=$(pkg-config --libs-only-l doca-gpunetio)
28-
])
29-
],
30-
[
31-
# User provided path
32-
GPUNETIO_CFLAGS="-I${with_doca_gpunetio}/include"
33-
for dir in lib lib64 lib/x86_64-linux-gnu; do
34-
if test -d "${with_doca_gpunetio}/${dir}"; then
35-
GPUNETIO_LDFLAGS="$GPUNETIO_LDFLAGS -L${with_doca_gpunetio}/${dir} "
36-
# Add rpath-link to search for doca_gpunetio dependencies
37-
GPUNETIO_LDFLAGS="$GPUNETIO_LDFLAGS -Wl,-rpath-link,${with_doca_gpunetio}/${dir}"
38-
fi
39-
done
40-
])
41-
])
44+
save_CPPFLAGS="$CPPFLAGS"
45+
save_LDFLAGS="$LDFLAGS"
46+
CPPFLAGS="$CPPFLAGS $CUDA_CFLAGS $GPUNETIO_CFLAGS"
47+
LDFLAGS="$LDFLAGS $CUDA_LDFLAGS $GPUNETIO_LDFLAGS"
4248
43-
save_CPPFLAGS="$CPPFLAGS"
44-
save_LDFLAGS="$LDFLAGS"
45-
CPPFLAGS="$CPPFLAGS $CUDA_CFLAGS $GPUNETIO_CFLAGS"
46-
LDFLAGS="$LDFLAGS $CUDA_LDFLAGS $GPUNETIO_LDFLAGS -Wl,-rpath-link,$CUDA_LIB_DIR"
49+
gpunetio_happy=yes
50+
AC_CHECK_HEADERS([doca_gpunetio.h], [], [gpunetio_happy=no])
51+
AC_CHECK_LIB([doca_gpunetio], [doca_gpu_verbs_bridge_export_qp],
52+
[], [gpunetio_happy=no], [$GPUNETIO_LIBS])
4753
48-
AC_CHECK_HEADERS([doca_gpunetio.h], [have_gpunetio=yes], [have_gpunetio=no])
49-
AC_CHECK_LIB([doca_gpunetio], [doca_gpu_verbs_bridge_export_qp],
50-
[true], [have_gpunetio=no], [$GPUNETIO_LIBS])
54+
CPPFLAGS="$save_CPPFLAGS"
55+
LDFLAGS="$save_LDFLAGS"
56+
],
57+
[gpunetio_happy=no])
5158

52-
CPPFLAGS="$save_CPPFLAGS"
53-
LDFLAGS="$save_LDFLAGS"
54-
55-
AS_IF([test x$have_gpunetio = xyes], [
56-
uct_ib_mlx5_modules="${uct_ib_mlx5_modules}:gda"
57-
AC_SUBST(GPUNETIO_CFLAGS)
58-
AC_SUBST(GPUNETIO_LDFLAGS)
59-
AC_SUBST(GPUNETIO_LIBS)
60-
])
61-
])
59+
AS_IF([test "x$gpunetio_happy" = "xyes"],
60+
[
61+
uct_ib_mlx5_modules="${uct_ib_mlx5_modules}:gda"
62+
AC_SUBST(GPUNETIO_CFLAGS)
63+
AC_SUBST(GPUNETIO_LDFLAGS)
64+
AC_SUBST(GPUNETIO_LIBS)
65+
],
66+
[
67+
# gpunetio was requested but not found
68+
AS_IF([test "x$with_doca_gpunetio" != "xno" -a "x$with_doca_gpunetio" != "xguess"],
69+
[AC_MSG_ERROR([doca_gpunetio not found])])
70+
])
6271

6372
AM_CONDITIONAL([HAVE_GPUNETIO], [test x$have_gpunetio = xyes])
6473
AC_CONFIG_FILES([src/uct/ib/mlx5/gdaki/Makefile

0 commit comments

Comments
 (0)