diff --git a/ompi/mca/common/cuda/common_cuda.c b/ompi/mca/common/cuda/common_cuda.c index eb4c459102..70b2f71857 100644 --- a/ompi/mca/common/cuda/common_cuda.c +++ b/ompi/mca/common/cuda/common_cuda.c @@ -295,6 +295,12 @@ int mca_common_cuda_stage_one_init(void) mca_common_cuda_output = opal_output_open(NULL); opal_output_set_verbosity(mca_common_cuda_output, mca_common_cuda_verbose); + /* First check if the support is enabled. In the case that the user has + * turned it off, we do not need to continue with any CUDA specific + * initialization. Do this after MCA parameter registration. */ + if (!ompi_mpi_cuda_support) + return; + if (0 != (retval = opal_lt_dlinit())) { if (OPAL_ERR_NOT_SUPPORTED == retval) { opal_show_help("help-mpi-common-cuda.txt", "dlopen disabled", true); diff --git a/ompi/runtime/ompi_mpi_params.c b/ompi/runtime/ompi_mpi_params.c index 04cc856fb7..75a93b80ce 100644 --- a/ompi/runtime/ompi_mpi_params.c +++ b/ompi/runtime/ompi_mpi_params.c @@ -326,7 +326,7 @@ int ompi_mpi_register_params(void) "Whether CUDA GPU buffer support is enabled or not", MCA_BASE_VAR_TYPE_BOOL, NULL, 0, 0, OPAL_INFO_LVL_4, - MCA_BASE_VAR_SCOPE_LOCAL, + MCA_BASE_VAR_SCOPE_READONLY, &ompi_mpi_cuda_support); if (ompi_mpi_cuda_support && !ompi_mpi_built_with_cuda_support) { opal_show_help("help-mpi-runtime.txt", "no cuda support",