ompi4-cu11.def 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102
  1. Bootstrap: docker
  2. From: nvidia/cuda:11.4.2-cudnn8-devel-ubuntu18.04
  3. Stage: spython-base
  4. %post
  5. export SINGULARITY_BINDPATH=$SINGULARITY_BINDPATH,$(echo /usr/bin/ | sed -e 's/ /,/g')
  6. MLNX_ARCH=ubuntu18.04-x86_64
  7. MLNX_VERSION=5.2-1.0.4.0
  8. # Python 3.7 is supported by Ubuntu Bionic out of the box
  9. python=3.7
  10. PYTHON_VERSION=${python}
  11. # Set default shell to /bin/bash
  12. #SHELL ["/bin/bash", "-cu"]
  13. TZ="Europe/London"
  14. RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
  15. apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y --allow-downgrades --allow-change-held-packages --no-install-recommends \
  16. build-essential \
  17. cmake \
  18. g++-7 \
  19. git \
  20. curl \
  21. vim \
  22. wget \
  23. ca-certificates \
  24. python${PYTHON_VERSION} \
  25. python${PYTHON_VERSION}-dev \
  26. python${PYTHON_VERSION}-distutils \
  27. libpython-stdlib \
  28. python \
  29. udev \
  30. automake \
  31. gfortran \
  32. autotools-dev \
  33. chrpath \
  34. pkg-config \
  35. libnl-3-dev \
  36. tcl \
  37. pciutils \
  38. tk \
  39. libnl-route-3-dev \
  40. libltdl-dev \
  41. bison \
  42. autoconf \
  43. flex \
  44. graphviz \
  45. libssl1.0.0 \
  46. kmod \
  47. debhelper \
  48. libgfortran4 \
  49. ethtool \
  50. swig \
  51. lsof \
  52. libnl-route-3-200 \
  53. m4 \
  54. libnl-3-200 \
  55. dpatch \
  56. libnuma-dev \
  57. iputils-ping \
  58. iproute2 \
  59. apt-utils
  60. ln -sf /usr/bin/python${PYTHON_VERSION} /usr/bin/python
  61. curl -O https://bootstrap.pypa.io/get-pip.py && \
  62. python get-pip.py && \
  63. rm get-pip.py
  64. wget http://www.mellanox.com/downloads/ofed/MLNX_OFED-${MLNX_VERSION}/MLNX_OFED_LINUX-${MLNX_VERSION}-${MLNX_ARCH}.tgz && \
  65. tar -xzvf MLNX_OFED_LINUX-${MLNX_VERSION}-${MLNX_ARCH}.tgz --no-same-owner && \
  66. cd MLNX_OFED_LINUX-${MLNX_VERSION}-${MLNX_ARCH} && \
  67. ./mlnxofedinstall --user-space-only --without-fw-update --skip-repo --force && \
  68. cd .. && \
  69. rm -rf MLNX_OFED-LINUX-${MLNX_VERSION}-${MLNX_ARCH} && \
  70. rm -rf *.tgz
  71. # Install Open MPI version 4.1
  72. wget https://www.open-mpi.org/software/ompi/v4.1/downloads/openmpi-4.1.0.tar.gz && \
  73. tar zxf openmpi-4.1.0.tar.gz && \
  74. cd openmpi-4.1.0 && \
  75. ./configure --enable-mpirun-prefix-by-default \
  76. --enable-shared \
  77. --without-verbs && \
  78. make -j $(nproc) all && \
  79. make install && \
  80. ldconfig && \
  81. rm -rf /tmp/openmpi
  82. cd /
  83. pip --no-cache-dir --disable-pip-version-check install mpi4py
  84. LD_LIBRARY_PATH=/usr/local/lib/:/usr/local/lib/openmpi:$LD_LIBRARY_PATH
  85. %environment
  86. %runscript