Skip to content

Commit e0254d5

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 e0254d5

File tree

1 file changed

+52
-45
lines changed

1 file changed

+52
-45
lines changed

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

Lines changed: 52 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -9,56 +9,63 @@ 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+
]) # "x$with_doca_gpunetio" != "xguess"
38+
]) # "x$with_doca_gpunetio" != "xno"
1839
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-
])
40+
save_CPPFLAGS="$CPPFLAGS"
41+
save_LDFLAGS="$LDFLAGS"
42+
CPPFLAGS="$CPPFLAGS $CUDA_CFLAGS $GPUNETIO_CFLAGS"
43+
LDFLAGS="$LDFLAGS $CUDA_LDFLAGS $GPUNETIO_LDFLAGS"
44+
AS_IF([test -n "$CUDA_LIB_DIR"],
45+
[LDFLAGS="$LDFLAGS -Wl,-rpath-link,$CUDA_LIB_DIR"])
4246
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"
47+
gpunetio_happy=yes
48+
AC_CHECK_HEADERS([doca_gpunetio.h], [], [gpunetio_happy=no])
49+
AC_CHECK_LIB([doca_gpunetio], [doca_gpu_verbs_bridge_export_qp],
50+
[], [gpunetio_happy=no], [$GPUNETIO_LIBS])
4751
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])
52+
CPPFLAGS="$save_CPPFLAGS"
53+
LDFLAGS="$save_LDFLAGS"
54+
],
55+
[gpunetio_happy=no])
5156

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-
])
57+
AS_IF([test "x$gpunetio_happy" = "xyes"],
58+
[
59+
uct_ib_mlx5_modules="${uct_ib_mlx5_modules}:gda"
60+
AC_SUBST(GPUNETIO_CFLAGS)
61+
AC_SUBST(GPUNETIO_LDFLAGS)
62+
AC_SUBST(GPUNETIO_LIBS)
63+
],
64+
[
65+
# gpunetio was requested but not found
66+
AS_IF([test "x$with_doca_gpunetio" != "xno" -a "x$with_doca_gpunetio" != "xguess"],
67+
[AC_MSG_ERROR([doca_gpunetio not found])])
68+
])
6269

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

0 commit comments

Comments
 (0)