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

Fix MPI on Ubuntu 18.04 with CUDA #2271

Merged
merged 2 commits into from
Sep 18, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 26 additions & 0 deletions src/core/communication.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -227,8 +227,34 @@ int mpi_check_runtime_errors(void);
* procedures
**********************************************/

#if defined(OPEN_MPI)
/*! Workaround for "Read -1, expected XXXXXXX, errno = 14" that sometimes
appears when CUDA is used. This is a bug in OpenMPI 2.0-2.1.2 and 3.0.0
according to
https://www.mail-archive.com/users@lists.open-mpi.org/msg32357.html,
so we set btl_vader_single_copy_mechanism = none.
*/
static void openmpi_fix_vader() {
if (OMPI_MAJOR_VERSION < 2 || OMPI_MAJOR_VERSION > 3)
return;
if (OMPI_MAJOR_VERSION == 2 && OMPI_MINOR_VERSION == 1 &&
OMPI_RELEASE_VERSION >= 3)
return;
if (OMPI_MAJOR_VERSION == 3 &&
(OMPI_MINOR_VERSION > 0 || OMPI_RELEASE_VERSION > 0))
return;

std::string varname = "btl_vader_single_copy_mechanism";
std::string varval = "none";

setenv((std::string("OMPI_MCA_") + varname).c_str(), varval.c_str(), 0);
}
#endif

void mpi_init() {
#ifdef OPEN_MPI
openmpi_fix_vader();

void *handle = 0;
int mode = RTLD_NOW | RTLD_GLOBAL;
#ifdef RTLD_NOLOAD
Expand Down