@@ -124,14 +124,36 @@ AC_DEFUN([MCA_opal_hwloc_hwloc2a_CONFIG],[
124
124
125
125
# Per https://github.com/open-mpi/ompi/issues/4219, if
126
126
# --without-cuda was specified, be sure to disable it in hwloc,
127
- # too. Note that hwloc uses --disable-cuda, so just set
128
- # enable_cuda=$with_cuda to get the same value that was passed in
129
- # via the top-level --with-cuda CLI option.
130
- enable_cuda= $with_cuda
131
-
132
- # Disable NVML support if CUDA support is not built
133
- AS_IF([test " $opal_check_cuda_happy " != " yes" ],
134
- [enable_nvml= no])
127
+ # too. Note that hwloc uses --disable-cuda (i.e., a yes or no
128
+ # value), whereas we use --with-cuda here in Open MPI (i.e., a
129
+ # yes, no, or path value). Need to translate appropriately.
130
+ #
131
+ # Set enable_cuda to yes if:
132
+ #
133
+ # 1. --with-cuda was specified (i.e., a human specifically asked
134
+ # for it)
135
+ # 2. --with-cuda=blah was specified (i.e., a human specifically
136
+ # asked for it)
137
+ # 3. --with-cuda was not specified, but Open MPI is building CUDA
138
+ # support
139
+ #
140
+ # Set enable_cuda to no in all other cases. This logic could be
141
+ # compressed into a smaller set of if tests, but for readability /
142
+ # clarity, I left it expanded.
143
+ AC_MSG_CHECKING([for hwloc --enable-cuda value])
144
+ enable_cuda= no
145
+ AS_IF([test " $with_cuda " = " yes" ],
146
+ [enable_cuda= yes],
147
+ [AS_IF([test -n " $with_cuda " && test " $with_cuda " != " no" ],
148
+ [enable_cuda= yes],
149
+ [AS_IF([test " $opal_check_cuda_happy " = " yes" ],
150
+ [enable_cuda= yes])
151
+ ])
152
+ ])
153
+ AC_MSG_RESULT([" $enable_cuda " ])
154
+
155
+ # Open MPI currently does not use hwloc's NVML support
156
+ enable_nvml= no
135
157
136
158
# hwloc checks for compiler visibility, and its needs to do
137
159
# this without "picky" flags.
0 commit comments