Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OpenMPI builds with CUDA and OpenCL dependency even with --with-cuda=no option #4219

Closed
PavelStishenko opened this issue Sep 17, 2017 · 10 comments
Assignees

Comments

@PavelStishenko
Copy link

Background information

Tested on version 2.1.1 from source tarball.


Details of the problem

I tried to build OpenMPI from source with the following script:

shell$ ./configure --enable-mpi-thread-multiple CC=clang-3.9 CXX=clang++-3.9 --prefix=/home/user/openmpi2 --without-cuda  --with-cuda=no --disable-vt
shell$ make -j8 all
shell$ make -j8 install

Then I checked mpiexec dependecies with ldd command and found, that there are still dependencies on libOpenCL.so and libcudart.so. Of course on the server without these libraries this program do not work.

@jsquyres
Copy link
Member

@sjeaugey Can you look into this?

@sjeaugey
Copy link
Member

There is no reference to OpenCL in the CUDA-aware code. My only guess as to where those dependencies are coming from is hwloc. @bgoglin do you think it's possible that hwloc within Open MPI is compiling some CUDA and OpenCL support, creating this dependency ?

@bgoglin
Copy link
Contributor

bgoglin commented Sep 18, 2017

A quick look in opal/mca/hwloc/hwloc*/configure.m4 tells me that OMPI's configure doesn't prevent hwloc from enabling everything it finds except NVML.

@jsquyres jsquyres added the bug label Sep 21, 2017
@jsquyres
Copy link
Member

Seems like a bug -- we should have the hwloc component honor the top-level Open MPI --without-cuda CLI option.

I'm guessing that this issue is present in most (all?) versions of Open MPI.

@bgoglin
Copy link
Contributor

bgoglin commented Sep 21, 2017

Yes, very likely present forever. Note that hwloc's OpenCL code is actually only useful for AMD GPU, not for NVIDIA. But it builds whenever OpenCL is detected.
Anyway, if OMPI doesn't care about OpenCL hwloc osdevs (and likely GL too), just apply something like this:

--- a/opal/mca/hwloc/hwloc2a/configure.m4
+++ b/opal/mca/hwloc/hwloc2a/configure.m4
@@ -122,6 +122,10 @@ AC_DEFUN([MCA_opal_hwloc_hwloc2a_CONFIG],[
     AS_IF([test "$opal_check_cuda_happy" != "yes"],
           [enable_nvml=no])
 
+    # GL and OpenCL osdevs aren't used in OMPI
+    enable_gl=no
+    enable_opencl=no
+
     # hwloc checks for compiler visibility, and its needs to do
     # this without "picky" flags.
     opal_hwloc_hwloc2a_save_cflags=$CFLAGS

@jsquyres
Copy link
Member

@bgoglin Have a look at #4245 -- is your solution or my solution better? I'm happy to update #4245 with your solution if it's better.

@bgoglin
Copy link
Contributor

bgoglin commented Sep 21, 2017

I'd say apply both. I don't think your patch will disable OpenCL because hwloc's configure options for CUDA and OpenCL are independent.

@jsquyres
Copy link
Member

@bgoglin Oh, good point -- I missed that distinction (CL vs. CUDA). Ok, I'll add your patch to #4245; thanks.

@jsquyres
Copy link
Member

#4245 updated.

@sjeaugey
Copy link
Member

@jsquyres @bgoglin 👍 this is exactly what I was looking for, just didn't find where to cleanly set those variables.

In general, we should only build what we're using. So we shouldn't need CUDA support in hwloc (inside Open MPI). That could apply to anything hwloc has support for.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants