# A image for building paddle binaries # Use cuda devel base image for both cpu and gpu environment # When you modify it, please be aware of cudnn-runtime version FROM MAINTAINER PaddlePaddle Authors # ENV variables ARG WITH_GPU ARG WITH_AVX ENV WITH_GPU=${WITH_GPU:-ON} ENV WITH_AVX=${WITH_AVX:-ON} ENV DEBIAN_FRONTEND=noninteractive ENV HOME /root # Add bash enhancements COPY paddle/scripts/docker/root/ /root/ RUN chmod 777 /tmp RUN apt-key del 7fa2af80 RUN rm /etc/apt/sources.list.d/* RUN apt-key adv --fetch-keys https://developer.download.nvidia.cn/compute/cuda/repos/ubuntu2004/x86_64/3bf863cc.pub RUN apt-get update --allow-unauthenticated && \ apt-get install -y software-properties-common && \ add-apt-repository ppa:deadsnakes/ppa && \ apt-get update && \ apt-get install -y curl wget vim git unzip unrar tar xz-utils libssl-dev bzip2 gzip \ coreutils ntp language-pack-zh-hans libsm6 libxext6 libxrender-dev libgl1-mesa-glx \ bison graphviz libjpeg-dev zlib1g-dev automake locales swig net-tools libtool kmod # Downgrade gcc&&g++ WORKDIR /usr/bin COPY tools/dockerfile/build_scripts /build_scripts RUN bash /build_scripts/install_trt.sh # Older versions of patchelf limited the size of the files being processed and were fixed in this pr. # # https://github.com/NixOS/patchelf/commit/ba2695a8110abbc8cc6baf0eea819922ee5007fa # # So install a newer version here. RUN bash /build_scripts/install_patchelf.sh RUN bash /build_scripts/install_gcc.sh gcc121 RUN cp gcc gcc.bak && cp g++ g++.bak && rm gcc && rm g++ RUN ln -s /usr/local/gcc-12.1/bin/gcc /usr/local/bin/gcc RUN ln -s /usr/local/gcc-12.1/bin/g++ /usr/local/bin/g++ RUN ln -s /usr/local/gcc-12.1/bin/gcc /usr/bin/gcc RUN ln -s /usr/local/gcc-12.1/bin/g++ /usr/bin/g++ ENV PATH=/usr/local/gcc-12.1/bin:$PATH RUN bash /build_scripts/install_cudnn.sh cudnn841 ENV CUDNN_VERSION=8.4.1 #RUN bash /build_scripts/install_nccl2.sh RUN rm -rf /build_script # install cmake WORKDIR /home RUN wget -q https://cmake.org/files/v3.18/cmake-3.18.0-Linux-x86_64.tar.gz && tar -zxvf cmake-3.18.0-Linux-x86_64.tar.gz && rm cmake-3.18.0-Linux-x86_64.tar.gz ENV PATH=/home/cmake-3.18.0-Linux-x86_64/bin:$PATH RUN apt-get update && \ apt-get install -y python3.10 python3.10-dev python3.10-distutils && \ apt-get install python-is-python3 && \ rm /usr/bin/python && ln -s /usr/bin/python3.10 /usr/bin/python && \ rm /usr/bin/python3 && ln -s /usr/bin/python3.10 /usr/bin/python3 WORKDIR /home RUN wget https://files.pythonhosted.org/packages/ef/cc/93f7213b2ab5ed383f98ce8020e632ef256b406b8569606c3f160ed8e1c9/setuptools-68.2.2.tar.gz && tar xf setuptools-68.2.2.tar.gz WORKDIR /home/setuptools-68.2.2 RUN python3.10 setup.py build && python3.10 setup.py install WORKDIR /home RUN wget https://files.pythonhosted.org/packages/1f/7f/4da15e07ccd11c84c1ccc8f6e24288d5e76c99441bf80e315b33542db951/pip-23.3.1.tar.gz && tar -zxf pip-23.3.1.tar.gz WORKDIR pip-23.3.1 RUN python3.10 setup.py install WORKDIR /home RUN rm setuptools-68.2.2.tar.gz pip-23.3.1.tar.gz && \ rm -r setuptools-68.2.2 pip-23.3.1 # remove them when apt-get support 2.27 and higher version RUN wget -q https://ftp.gnu.org/gnu/binutils/binutils-2.33.1.tar.gz && \ tar -xzf binutils-2.33.1.tar.gz && \ cd binutils-2.33.1 && \ ./configure && make -j && make install && cd .. && rm -rf binutils-2.33.1 binutils-2.33.1.tar.gz # Install Go and glide RUN wget --no-check-certificate -qO- https://paddle-ci.gz.bcebos.com/go1.17.2.linux-amd64.tar.gz | \ tar -xz -C /usr/local && \ mkdir /root/gopath && \ mkdir /root/gopath/bin && \ mkdir /root/gopath/src ENV GOROOT=/usr/local/go GOPATH=/root/gopath # should not be in the same line with GOROOT definition, otherwise docker build could not find GOROOT. ENV PATH=${PATH}:${GOROOT}/bin:${GOPATH}/bin # install glide RUN apt-get install -y golang-glide # git credential to skip password typing RUN git config --global credential.helper store # Fix locales to en_US.UTF-8 RUN localedef -i en_US -f UTF-8 en_US.UTF-8 RUN rm -f /usr/local/bin/pip && ln -s /usr/local/bin/pip3.10 /usr/local/bin/pip && \ rm -f /usr/local/bin/pip3 && ln -s /usr/local/bin/pip3.10 /usr/local/bin/pip3 COPY ./python/requirements.txt /root/ RUN pip3.10 --no-cache-dir install -r /root/requirements.txt # ccache 4.2.0 RUN wget -q https://paddle-ci.gz.bcebos.com/ccache-4.8.2.tar.gz && \ tar xf ccache-4.8.2.tar.gz && mkdir /usr/local/ccache-4.8.2 && cd ccache-4.8.2 && \ mkdir build && cd build && \ cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/usr/local/ccache-4.8.2 .. && \ make -j8 && make install && \ ln -s /usr/local/ccache-4.8.2/bin/ccache /usr/local/bin/ccache && \ cd ../../ && rm -rf ccache-4.8.2.tar.gz # clang12 RUN apt-get update &&\ apt install -y clang-12 EXPOSE 22