From 22ebab1f89c17bec965f59e8f8c19f55c8aec0b4 Mon Sep 17 00:00:00 2001 From: sunway513 Date: Mon, 22 Mar 2021 19:28:32 +0000 Subject: [PATCH] seperate base dockerfile and complete dockerfile with rocm-lib installed --- dev/Dockerfile-centos-7 | 2 +- dev/Dockerfile-centos-7-complete | 89 ++++++++++++++++++++++++++++ dev/Dockerfile-ubuntu-18.04 | 1 - dev/Dockerfile-ubuntu-18.04-complete | 21 +++++++ dev/Dockerfile-ubuntu-20.04-complete | 21 +++++++ 5 files changed, 132 insertions(+), 2 deletions(-) create mode 100644 dev/Dockerfile-centos-7-complete create mode 100644 dev/Dockerfile-ubuntu-18.04-complete create mode 100644 dev/Dockerfile-ubuntu-20.04-complete diff --git a/dev/Dockerfile-centos-7 b/dev/Dockerfile-centos-7 index a199e13..d5abcfc 100644 --- a/dev/Dockerfile-centos-7 +++ b/dev/Dockerfile-centos-7 @@ -76,7 +76,7 @@ RUN yum install -y devtoolset-7-libatomic-devel devtoolset-7-elfutils-libelf-dev RUN yum clean all RUN echo -e "[ROCm]\nname=ROCm\nbaseurl=http://repo.radeon.com/rocm/yum/$ROCM_VERSION\nenabled=1\ngpgcheck=0" >> /etc/yum.repos.d/rocm.repo -RUN yum install -y rocm-dev rocm-libs +RUN yum install -y rocm-dev # Set ENV to enable devtoolset7 by default ENV PATH=/opt/rh/devtoolset-7/root/usr/bin:/opt/rocm/hcc/bin:/opt/rocm/hip/bin:/opt/rocm/bin:/opt/rocm/hcc/bin:${PATH:+:${PATH}} diff --git a/dev/Dockerfile-centos-7-complete b/dev/Dockerfile-centos-7-complete new file mode 100644 index 0000000..a199e13 --- /dev/null +++ b/dev/Dockerfile-centos-7-complete @@ -0,0 +1,89 @@ +FROM centos:7 +LABEL maintainer=peng.sun@amd.com + +ARG ROCM_VERSION=4.1 + +# Base +RUN yum -y install git java-1.8.0-openjdk python; yum clean all + +# Enable epel-release repositories +RUN yum --enablerepo=extras install -y epel-release + +# Install required base build and packaging commands for ROCm +RUN yum -y install \ + bc \ + bridge-utils \ + cmake \ + cmake3 \ + devscripts \ + dkms \ + doxygen \ + dpkg \ + dpkg-dev \ + dpkg-perl \ + elfutils-libelf-devel \ + expect \ + file \ + gettext \ + gcc-c++ \ + libgcc \ + glibc.i686 \ + libcxx-devel \ + ncurses \ + ncurses-base \ + ncurses-libs \ + numactl-devel \ + numactl-libs \ + libssh \ + libunwind-devel \ + libunwind \ + llvm \ + llvm-libs \ + make \ + openssl \ + openssl-libs \ + openssh \ + openssh-clients \ + pciutils \ + pciutils-devel \ + pciutils-libs \ + python \ + python-pip \ + python-devel \ + pkgconfig \ + pth \ + qemu-kvm \ + re2c \ + kmod \ + file \ + rpm \ + rpm-build \ + subversion \ + wget + +# Enable the epel repository for fakeroot +RUN yum --enablerepo=extras install -y fakeroot +RUN yum clean all + +# On CentOS, install package centos-release-scl available in CentOS repository: +RUN yum install -y centos-release-scl + +# Install the devtoolset-7 collection: +RUN yum install -y devtoolset-7 +RUN yum install -y devtoolset-7-libatomic-devel devtoolset-7-elfutils-libelf-devel + +# Install the ROCm rpms +RUN yum clean all +RUN echo -e "[ROCm]\nname=ROCm\nbaseurl=http://repo.radeon.com/rocm/yum/$ROCM_VERSION\nenabled=1\ngpgcheck=0" >> /etc/yum.repos.d/rocm.repo + +RUN yum install -y rocm-dev rocm-libs + +# Set ENV to enable devtoolset7 by default +ENV PATH=/opt/rh/devtoolset-7/root/usr/bin:/opt/rocm/hcc/bin:/opt/rocm/hip/bin:/opt/rocm/bin:/opt/rocm/hcc/bin:${PATH:+:${PATH}} +ENV MANPATH=/opt/rh/devtoolset-7/root/usr/share/man:${MANPATH} +ENV INFOPATH=/opt/rh/devtoolset-7/root/usr/share/info${INFOPATH:+:${INFOPATH}} +ENV PCP_DIR=/opt/rh/devtoolset-7/root +ENV PERL5LIB=/opt/rh/devtoolset-7/root//usr/lib64/perl5/vendor_perl:/opt/rh/devtoolset-7/root/usr/lib/perl5:/opt/rh/devtoolset-7/root//usr/share/perl5/ +ENV LD_LIBRARY_PATH=/opt/rocm/lib:/usr/local/lib:/opt/rh/devtoolset-7/root$rpmlibdir$rpmlibdir32${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}} +ENV PYTHONPATH=/opt/rh/devtoolset-7/root/usr/lib64/python$pythonvers/site-packages:/opt/rh/devtoolset-7/root/usr/lib/python$pythonvers/ +ENV LDFLAGS="-Wl,-rpath=/opt/rh/devtoolset-7/root/usr/lib64 -Wl,-rpath=/opt/rh/devtoolset-7/root/usr/lib" diff --git a/dev/Dockerfile-ubuntu-18.04 b/dev/Dockerfile-ubuntu-18.04 index b018d4c..d51bc1e 100644 --- a/dev/Dockerfile-ubuntu-18.04 +++ b/dev/Dockerfile-ubuntu-18.04 @@ -15,7 +15,6 @@ RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y --no-ins kmod \ file \ rocm-dev \ - rocm-libs \ build-essential && \ apt-get clean && \ rm -rf /var/lib/apt/lists/* diff --git a/dev/Dockerfile-ubuntu-18.04-complete b/dev/Dockerfile-ubuntu-18.04-complete new file mode 100644 index 0000000..b018d4c --- /dev/null +++ b/dev/Dockerfile-ubuntu-18.04-complete @@ -0,0 +1,21 @@ +# This dockerfile is meant to serve as a rocm base image. It registers the debian rocm package repository, and +# installs the rocm-dev package. + +FROM ubuntu:18.04 +LABEL maintainer=peng.sun@amd.com + +# Register the ROCM package repository, and install rocm-dev package +ARG ROCM_VERSION=4.1 +RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends curl libnuma-dev gnupg \ + && curl -sL http://repo.radeon.com/rocm/rocm.gpg.key | apt-key add - \ + && printf "deb [arch=amd64] http://repo.radeon.com/rocm/apt/$ROCM_VERSION/ xenial main" | tee /etc/apt/sources.list.d/rocm.list \ + && apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \ + sudo \ + libelf1 \ + kmod \ + file \ + rocm-dev \ + rocm-libs \ + build-essential && \ + apt-get clean && \ + rm -rf /var/lib/apt/lists/* diff --git a/dev/Dockerfile-ubuntu-20.04-complete b/dev/Dockerfile-ubuntu-20.04-complete new file mode 100644 index 0000000..cac3408 --- /dev/null +++ b/dev/Dockerfile-ubuntu-20.04-complete @@ -0,0 +1,21 @@ +# This dockerfile is meant to serve as a rocm base image. It registers the debian rocm package repository, and +# installs the rocm-dev package. + +FROM ubuntu:20.04 +LABEL maintainer=peng.sun@amd.com + +# Register the ROCM package repository, and install rocm-dev package +ARG ROCM_VERSION=4.1 +RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends curl libnuma-dev gnupg \ + && curl -sL http://repo.radeon.com/rocm/rocm.gpg.key | apt-key add - \ + && printf "deb [arch=amd64] http://repo.radeon.com/rocm/apt/$ROCM_VERSION/ xenial main" | tee /etc/apt/sources.list.d/rocm.list \ + && apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \ + sudo \ + libelf1 \ + kmod \ + file \ + rocm-dev \ + rocm-libs \ + build-essential && \ + apt-get clean && \ + rm -rf /var/lib/apt/lists/*