From d25b3c7444e4433dbcb212ae9008ae410033cae6 Mon Sep 17 00:00:00 2001 From: Jeff Squyres Date: Thu, 21 Sep 2017 08:06:29 -0700 Subject: [PATCH 1/4] hwloc: do not build hwloc CUDA support if --without-cuda used (originally cherry picked from master, but since the hwloc component was updated between master and v2.0.x but are the same between v2.0.x and v2.x, I cherry picked from the v2.0.x branch for the v2.x branch) Signed-off-by: Jeff Squyres (cherry picked from commit f5d51dc2f5f373503dc099ee8fa52e1e34507cfd) (cherry picked from commit 3b01bbe028ef3e6d9f3a3fbfa45a3e45c45fb314) --- opal/mca/hwloc/hwloc1112/configure.m4 | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/opal/mca/hwloc/hwloc1112/configure.m4 b/opal/mca/hwloc/hwloc1112/configure.m4 index e103918a0b5..bffcfb9625e 100644 --- a/opal/mca/hwloc/hwloc1112/configure.m4 +++ b/opal/mca/hwloc/hwloc1112/configure.m4 @@ -111,6 +111,13 @@ AC_DEFUN([MCA_opal_hwloc_hwloc1112_CONFIG],[ enable_libxml2=no enable_xml=yes + # Per https://github.com/open-mpi/ompi/issues/4219, if + # --without-cuda was specified, be sure to disable it in hwloc, + # too. Note that hwloc uses --disable-cuda, so just set + # enable_cuda=$with_cuda to get the same value that was passed in + # via the top-level --with-cuda CLI option. + enable_cuda=$with_cuda + # hwloc checks for compiler visibility, and its needs to do # this without "picky" flags. opal_hwloc_hwloc1112_save_cflags=$CFLAGS From e6737cc4bdc21ef3d6d5b41bc7834e189c4b69b6 Mon Sep 17 00:00:00 2001 From: Brice Goglin Date: Thu, 21 Sep 2017 08:25:46 -0700 Subject: [PATCH 2/4] hwloc: disable GL and OpenCL in the hwloc component Open MPI doesn't use GL or OpenCL OS devices, so just disable them in hwloc. (originally cherry picked from master, but since the hwloc component was updated between master and v2.0.x but are the same between v2.0.x and v2.x, I cherry picked from the v2.0.x branch for the v2.x branch) Signed-off-by: Jeff Squyres (cherry picked from commit 84a721d17aed1b8843ec87f05d824f452f1e623e) (cherry picked from commit ca0973a0e67618dd22314f9fbf2be9b8376af26e) --- opal/mca/hwloc/hwloc1112/configure.m4 | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/opal/mca/hwloc/hwloc1112/configure.m4 b/opal/mca/hwloc/hwloc1112/configure.m4 index bffcfb9625e..0d576c6f35a 100644 --- a/opal/mca/hwloc/hwloc1112/configure.m4 +++ b/opal/mca/hwloc/hwloc1112/configure.m4 @@ -111,6 +111,10 @@ AC_DEFUN([MCA_opal_hwloc_hwloc1112_CONFIG],[ enable_libxml2=no enable_xml=yes + # GL and OpenCL OS devices aren't used in OMPI + enable_gl=no + enable_opencl=no + # Per https://github.com/open-mpi/ompi/issues/4219, if # --without-cuda was specified, be sure to disable it in hwloc, # too. Note that hwloc uses --disable-cuda, so just set From 59eabfdc73c9055a96a47c7c559d675964f2f187 Mon Sep 17 00:00:00 2001 From: Jeff Squyres Date: Sun, 24 Sep 2017 05:36:23 -0700 Subject: [PATCH 3/4] hwloc configure.m4: be more careful in with_cuda->enable_cuda Be a little more deliberate about convering OMPI's --with-cuda CLI value to hwloc's --enable-cuda configure option. Also, unconditionally disable hwloc NVML support (because Open MPI is not currently using it). Signed-off-by: Jeff Squyres (cherry picked from commit 2ec2a329dcfd5d3ec5decd681e2751397017c56f) --- opal/mca/hwloc/hwloc1112/configure.m4 | 34 +++++++++++++++++++++++---- 1 file changed, 30 insertions(+), 4 deletions(-) diff --git a/opal/mca/hwloc/hwloc1112/configure.m4 b/opal/mca/hwloc/hwloc1112/configure.m4 index 0d576c6f35a..7eba32ecc19 100644 --- a/opal/mca/hwloc/hwloc1112/configure.m4 +++ b/opal/mca/hwloc/hwloc1112/configure.m4 @@ -117,10 +117,36 @@ AC_DEFUN([MCA_opal_hwloc_hwloc1112_CONFIG],[ # Per https://github.com/open-mpi/ompi/issues/4219, if # --without-cuda was specified, be sure to disable it in hwloc, - # too. Note that hwloc uses --disable-cuda, so just set - # enable_cuda=$with_cuda to get the same value that was passed in - # via the top-level --with-cuda CLI option. - enable_cuda=$with_cuda + # too. Note that hwloc uses --disable-cuda (i.e., a yes or no + # value), whereas we use --with-cuda here in Open MPI (i.e., a + # yes, no, or path value). Need to translate appropriately. + # + # Set enable_cuda to yes if: + # + # 1. --with-cuda was specified (i.e., a human specifically asked + # for it) + # 2. --with-cuda=blah was specified (i.e., a human specifically + # asked for it) + # 3. --with-cuda was not specified, but Open MPI is building CUDA + # support + # + # Set enable_cuda to no in all other cases. This logic could be + # compressed into a smaller set of if tests, but for readability / + # clarity, I left it expanded. + AC_MSG_CHECKING([for hwloc --enable-cuda value]) + enable_cuda=no + AS_IF([test "$with_cuda" = "yes"], + [enable_cuda=yes], + [AS_IF([test -n "$with_cuda" && test "$with_cuda" != "no"], + [enable_cuda=yes], + [AS_IF([test "$opal_check_cuda_happy" = "yes"], + [enable_cuda=yes]) + ]) + ]) + AC_MSG_RESULT(["$enable_cuda"]) + + # Open MPI currently does not use hwloc's NVML support + enable_nvml=no # hwloc checks for compiler visibility, and its needs to do # this without "picky" flags. From afe9abcfb24587a4caf7bf7f967832002f7f18b6 Mon Sep 17 00:00:00 2001 From: Jeff Squyres Date: Tue, 10 Oct 2017 09:54:34 -0700 Subject: [PATCH 4/4] hwloc1112: always disable building CUDA support. There is no usage of CUDA hwloc objects in the v2.x branch, and linking in CUDA can cause problems (per https://github.com/open-mpi/ompi/pull/4257#issuecomment-332900393). Partially cherry-picked from c341b5347509037c145f0c3b8fd990d1511e6908. Signed-off-by: Jeff Squyres --- opal/mca/hwloc/hwloc1112/configure.m4 | 30 ++------------------------- 1 file changed, 2 insertions(+), 28 deletions(-) diff --git a/opal/mca/hwloc/hwloc1112/configure.m4 b/opal/mca/hwloc/hwloc1112/configure.m4 index 7eba32ecc19..db875a817e7 100644 --- a/opal/mca/hwloc/hwloc1112/configure.m4 +++ b/opal/mca/hwloc/hwloc1112/configure.m4 @@ -115,35 +115,9 @@ AC_DEFUN([MCA_opal_hwloc_hwloc1112_CONFIG],[ enable_gl=no enable_opencl=no - # Per https://github.com/open-mpi/ompi/issues/4219, if - # --without-cuda was specified, be sure to disable it in hwloc, - # too. Note that hwloc uses --disable-cuda (i.e., a yes or no - # value), whereas we use --with-cuda here in Open MPI (i.e., a - # yes, no, or path value). Need to translate appropriately. - # - # Set enable_cuda to yes if: - # - # 1. --with-cuda was specified (i.e., a human specifically asked - # for it) - # 2. --with-cuda=blah was specified (i.e., a human specifically - # asked for it) - # 3. --with-cuda was not specified, but Open MPI is building CUDA - # support - # - # Set enable_cuda to no in all other cases. This logic could be - # compressed into a smaller set of if tests, but for readability / - # clarity, I left it expanded. - AC_MSG_CHECKING([for hwloc --enable-cuda value]) + # Per https://github.com/open-mpi/ompi/pull/4257, ALWAYS + # disable cuda support enable_cuda=no - AS_IF([test "$with_cuda" = "yes"], - [enable_cuda=yes], - [AS_IF([test -n "$with_cuda" && test "$with_cuda" != "no"], - [enable_cuda=yes], - [AS_IF([test "$opal_check_cuda_happy" = "yes"], - [enable_cuda=yes]) - ]) - ]) - AC_MSG_RESULT(["$enable_cuda"]) # Open MPI currently does not use hwloc's NVML support enable_nvml=no