Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
9 changes: 9 additions & 0 deletions easybuild/easyconfigs/o/OpenMPI/OpenMPI-4.1.1-GCC-10.3.0.eb
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ patches = [
'OpenMPI-4.1.1_fix-bufferoverflow-in-common_ofi.patch',
'OpenMPI-4.0.6_remove-pmix-check-in-pmi-switch.patch',
'OpenMPI-4.1.0-1-pml-ucx-datatype-memleak.patch',
'OpenMPI-4.1.1_build_with_internal_cuda_header.patch',
]
checksums = [
'e24f7a778bd11a71ad0c14587a7f5b00e68a71aa5623e2157bafee3d44c07cda', # openmpi-4.1.1.tar.bz2
Expand All @@ -24,10 +25,14 @@ checksums = [
'8acee6c9b2b4bf12873a39b85a58ca669de78e90d26186e52f221bb4853abc4d',
# OpenMPI-4.1.0-1-pml-ucx-datatype-memleak.patch
'a94a74b174ce783328abfd3656ff5196b89ef4c819fe4c8b8a0f1277123e76ea',
# OpenMPI-4.1.1_build_with_internal_cuda_header.patch
'1ceb82b19f62da2525357debaae694d7751b6352adae7ffa55c71e19a4d7101c',
]

builddependencies = [
('pkg-config', '0.29.2'),
('Perl', '5.32.1'),
('Autotools', '20210128'),
]

dependencies = [
Expand All @@ -39,6 +44,10 @@ dependencies = [
('PMIx', '3.2.3'),
]

preconfigopts = './autogen.pl --force && '

configopts = '--with-cuda=internal '

# disable MPI1 compatibility for now, see what breaks...
# configopts = '--enable-mpi1-compatibility '

Expand Down
9 changes: 9 additions & 0 deletions easybuild/easyconfigs/o/OpenMPI/OpenMPI-4.1.1-GCC-11.2.0.eb
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ patches = [
'OpenMPI-4.1.1_opal-pmix-package-rank.patch',
'OpenMPI-4.1.1_pmix3x-protection.patch',
'OpenMPI-4.1.0-1-pml-ucx-datatype-memleak.patch',
'OpenMPI-4.1.1_build_with_internal_cuda_header.patch',
]
checksums = [
'e24f7a778bd11a71ad0c14587a7f5b00e68a71aa5623e2157bafee3d44c07cda', # openmpi-4.1.1.tar.bz2
Expand All @@ -25,10 +26,14 @@ checksums = [
'384ef9f1fa803b0d71dae2ec0748d0f20295992437532afedf21478bda164ff8', # OpenMPI-4.1.1_pmix3x-protection.patch
# OpenMPI-4.1.0-1-pml-ucx-datatype-memleak.patch
'a94a74b174ce783328abfd3656ff5196b89ef4c819fe4c8b8a0f1277123e76ea',
# OpenMPI-4.1.1_build_with_internal_cuda_header.patch
'1ceb82b19f62da2525357debaae694d7751b6352adae7ffa55c71e19a4d7101c',
]

builddependencies = [
('pkg-config', '0.29.2'),
('Perl', '5.34.0'),
('Autotools', '20210726'),
]

dependencies = [
Expand All @@ -40,6 +45,10 @@ dependencies = [
('PMIx', '4.1.0'),
]

preconfigopts = './autogen.pl --force && '

configopts = '--with-cuda=internal '

# disable MPI1 compatibility for now, see what breaks...
# configopts = '--enable-mpi1-compatibility '

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
Allow building Open MPI with --with-cuda=internal, by providing an
internal minimal cuda.h header file. This eliminate the CUDA
(build)dependency; as long as the runtime CUDA version is 8.0+,
libcuda.so will be dlopen'ed and used successfully.

Author: Bart Oldeman <[email protected]>
--- openmpi-4.1.3.orig/config/opal_check_cuda.m4 2022-03-31 16:04:13.000000000 +0000
+++ openmpi-4.1.3/config/opal_check_cuda.m4 2022-05-04 17:37:57.576260311 +0000
@@ -45,6 +45,12 @@
# macro as that would error out after not finding it in the first directory.
# Note that anywhere CUDA aware code is in the Open MPI repository requires
# us to make use of AC_REQUIRE to ensure this check has been done.
+opal_check_cuda_internal=""
+AS_IF([test "$with_cuda" = "internal"],
+ [AC_MSG_RESULT([internal support requested])
+ with_cuda="${OPAL_TOP_SRCDIR}/opal/mca/common/cuda/cuda"
+ opal_check_cuda_internal=" (internal)"
+ ])
AS_IF([test "$with_cuda" = "no" || test "x$with_cuda" = "x"],
[opal_check_cuda_happy="no"
AC_MSG_RESULT([not set (--with-cuda=$with_cuda)])],
@@ -124,7 +130,7 @@
CUDA_SUPPORT=0
fi

-OPAL_SUMMARY_ADD([[Miscellaneous]],[[CUDA support]],[opal_cuda], [$opal_check_cuda_happy])
+OPAL_SUMMARY_ADD([[Miscellaneous]],[[CUDA support]],[opal_cuda], [$opal_check_cuda_happy$opal_check_cuda_internal])

AM_CONDITIONAL([OPAL_cuda_support], [test "x$CUDA_SUPPORT" = "x1"])
AC_DEFINE_UNQUOTED([OPAL_CUDA_SUPPORT],$CUDA_SUPPORT,
--- openmpi-4.1.3.orig/opal/mca/common/cuda/cuda/cuda.h 1970-01-01 00:00:00.000000000 +0000
+++ openmpi-4.1.3/opal/mca/common/cuda/cuda/cuda.h 2022-05-04 18:52:14.991300184 +0000
@@ -0,0 +1,60 @@
+/* This header provides minimal parts of the CUDA Driver API, without having to
+ rely on the proprietary CUDA toolkit.
+
+ References (to avoid copying from NVidia's proprietary cuda.h):
+ https://github.com/gcc-mirror/gcc/blob/master/include/cuda/cuda.h
+ https://github.com/Theano/libgpuarray/blob/master/src/loaders/libcuda.h
+ https://github.com/CPFL/gdev/blob/master/cuda/driver/cuda.h
+ https://github.com/CudaWrangler/cuew/blob/master/include/cuew.h
+*/
+
+#define CUDA_VERSION 8000
+
+typedef void *CUcontext;
+typedef int CUdevice;
+#if defined(__LP64__) || defined(_WIN64)
+typedef unsigned long long CUdeviceptr;
+#else
+typedef unsigned CUdeviceptr;
+#endif
+typedef void *CUevent;
+typedef void *CUstream;
+
+typedef enum {
+ CUDA_SUCCESS = 0,
+ CUDA_ERROR_NOT_INITIALIZED = 3,
+ CUDA_ERROR_DEINITIALIZED = 4,
+ CUDA_ERROR_ALREADY_MAPPED = 208,
+ CUDA_ERROR_NOT_READY = 600,
+} CUresult;
+
+enum {
+ CU_EVENT_DISABLE_TIMING = 0x2,
+ CU_EVENT_INTERPROCESS = 0x4,
+};
+
+enum {
+ CU_IPC_MEM_LAZY_ENABLE_PEER_ACCESS = 0x1,
+};
+
+typedef enum {
+ CU_POINTER_ATTRIBUTE_CONTEXT = 1,
+ CU_POINTER_ATTRIBUTE_MEMORY_TYPE = 2,
+ CU_POINTER_ATTRIBUTE_SYNC_MEMOPS = 6,
+ CU_POINTER_ATTRIBUTE_BUFFER_ID = 7,
+ CU_POINTER_ATTRIBUTE_IS_MANAGED = 8,
+} CUpointer_attribute;
+
+typedef enum {
+ CU_MEMORYTYPE_HOST = 0x01,
+} CUmemorytype;
+
+typedef struct CUipcEventHandle CUipcEventHandle;
+
+#define CU_IPC_HANDLE_SIZE 64
+typedef struct CUipcMemHandle_st {
+ char reserved[CU_IPC_HANDLE_SIZE];
+} CUipcMemHandle;
+
+CUresult cuPointerGetAttributes (unsigned int numAttributes,
+ CUpointer_attribute *attributes, void **data, CUdeviceptr ptr);