chore: import upstream snapshot with attribution

This commit is contained in:
wehub-resource-sync
2026-07-13 12:40:42 +08:00
commit e25996e7db
15472 changed files with 3536181 additions and 0 deletions
+72
View File
@@ -0,0 +1,72 @@
# NOTE The manylinux1 policy mandates CentOS-5. We replace it with CentOS-6 in
# order to satisfy the build of capnproto library (a nupic.core dependency),
# which requires some headers and symbols not present on CentOS-5 (e.g.,
# signalfd.h, pipe2, O_NONBLOCK, SOCK_NONBLOCK, etc.). See
# https://github.com/sandstorm-io/capnproto/issues/350.
FROM nvidia/cuda:<baseimg>
MAINTAINER Numenta, based on the ManyLinux project
ENV LC_ALL en_US.UTF-8
ENV LANG en_US.UTF-8
ENV LANGUAGE en_US.UTF-8
ENV PATH /opt/rh/devtoolset-2/root/usr/bin:$PATH
ENV LD_LIBRARY_PATH /usr/local/ssl/lib:/opt/rh/devtoolset-2/root/usr/lib64:/opt/rh/devtoolset-2/root/usr/lib:/usr/local/lib64:/usr/local/lib:${LD_LIBRARY_PATH}
ENV PKG_CONFIG_PATH=/usr/local/lib/pkgconfig
RUN yum update -y && yum install -y bzip2 gettext-devel sqlite-devel zlib-devel openssl-devel pcre-devel vim tk-devel libtool xz graphviz wget curl-devel patch perl swig
COPY build_scripts /build_scripts
RUN bash build_scripts/build.sh
#RUN bash build_scripts/install_nccl2.sh
RUN bash build_scripts/install_trt.sh
RUN rm -rf build_scripts
RUN ln -s /usr/local/ssl/include/openssl /usr/include
# git 2.17.1
RUN wget -q https://paddle-ci.gz.bcebos.com/git-2.17.1.tar.gz && \
tar -xvf git-2.17.1.tar.gz && \
cd git-2.17.1 && \
./configure --with-openssl CFLAGS="-Dsocklen_t=uint32_t" --prefix=/usr/local && \
make -j8 && make install
ENV SSL_CERT_FILE=/opt/_internal/certs.pem
ENV GOROOT=/usr/local/go GOPATH=/root/gopath
ENV PATH=/usr/local/ssl:${GOROOT}/bin:${GOPATH}/bin:${PATH}
ENV LIBRARY_PATH=/usr/local/ssl/lib:$LIBRARY_PATH
# for paddle
RUN wget --no-check-certificate -qO- https://paddle-ci.gz.bcebos.com/go1.15.12.linux-amd64.tar.gz | \
tar -xz -C /usr/local && \
mkdir /root/gopath && \
mkdir /root/gopath/bin && \
mkdir /root/gopath/src
RUN wget https://raw.githubusercontent.com/PaddlePaddle/Paddle/develop/python/requirements.txt -O /root/requirements.txt
RUN LD_LIBRARY_PATH=/opt/_internal/cpython-3.10.0/lib/:${LD_LIBRARY_PATH} /opt/_internal/cpython-3.10.0/bin/pip3 install setuptools -U && \
LD_LIBRARY_PATH=/opt/_internal/cpython-3.11.0/lib/:${LD_LIBRARY_PATH} /opt/_internal/cpython-3.11.0/bin/pip3 install setuptools -U && \
LD_LIBRARY_PATH=/opt/_internal/cpython-3.12.0/lib/:${LD_LIBRARY_PATH} /opt/_internal/cpython-3.12.0/bin/pip3 install setuptools -U
RUN LD_LIBRARY_PATH=/opt/_internal/cpython-3.10.0/lib/:${LD_LIBRARY_PATH} /opt/_internal/cpython-3.10.0/bin/pip3 install -r /root/requirements.txt && \
LD_LIBRARY_PATH=/opt/_internal/cpython-3.11.0/lib/:${LD_LIBRARY_PATH} /opt/_internal/cpython-3.11.0/bin/pip3 install -r /root/requirements.txt && \
LD_LIBRARY_PATH=/opt/_internal/cpython-3.12.0/lib/:${LD_LIBRARY_PATH} /opt/_internal/cpython-3.12.0/bin/pip3 install -r /root/requirements.txt && \
go get github.com/Masterminds/glide && \
rm -rf /root/requirements.txt
RUN LD_LIBRARY_PATH=/opt/_internal/cpython-3.10.0/lib/:${LD_LIBRARY_PATH} /opt/_internal/cpython-3.10.0/bin/pip3 install pre-commit 'ipython==5.3.0' && \
LD_LIBRARY_PATH=/opt/_internal/cpython-3.11.0/lib/:${LD_LIBRARY_PATH} /opt/_internal/cpython-3.11.0/bin/pip3 install pre-commit 'ipython==5.3.0' && \
LD_LIBRARY_PATH=/opt/_internal/cpython-3.12.0/lib/:${LD_LIBRARY_PATH} /opt/_internal/cpython-3.12.0/bin/pip3 install pre-commit 'ipython==5.3.0'
# ccache 4.8.2
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
CMD ["bash", "/paddle/paddle/scripts/docker/build.sh"]
+116
View File
@@ -0,0 +1,116 @@
# Docker Image for PaddlePaddle Hygon DCU2
FROM sugonhub/kylin:v10-dev
LABEL maintainer="PaddlePaddle Authors <paddle-dev@baidu.com>"
RUN yum install -y bzip2-devel openssh-server elfutils-devel diffutils libtool iproute \
blas-devel lapack-devel make git patch unzip bison hostname yasm libsndfile-devel \
automake which file net-tools zlib-devel libffi-devel vim tk-devel tkinter rpm-build \
sqlite-devel xz-devel wget curl-devel initscripts mesa-libGL numactl-devel pcre-devel \
openssl-devel libjpeg-turbo-devel libpng-devel ninja-build pciutils libzstd-devel zstd
COPY tools/dockerfile/build_scripts /build_scripts
RUN bash /build_scripts/install_gcc.sh gcc82
RUN ln -sf /usr/local/gcc-8.2/bin/gcc /usr/local/bin/gcc
RUN ln -sf /usr/local/gcc-8.2/bin/g++ /usr/local/bin/g++
RUN ln -sf /usr/local/gcc-8.2/bin/gcc /usr/bin/gcc
RUN ln -sf /usr/local/gcc-8.2/bin/g++ /usr/bin/g++
ENV PATH=/usr/local/gcc-8.2/bin:$PATH
# workdir
WORKDIR /opt
# cmake 3.27.7
RUN wget -q https://cmake.org/files/v3.27/cmake-3.27.7-linux-x86_64.sh && \
chmod +x cmake-3.27.7-linux-x86_64.sh && mkdir -p /opt/cmake-3.27.7 && \
./cmake-3.27.7-linux-x86_64.sh --prefix=/opt/cmake-3.27.7 --skip-license && \
rm -rf cmake-3.27.7-linux-x86_64.sh && rm -rf /opt/cmake
RUN rm -rf /usr/bin/cmake /usr/bin/cmake3 && \
ln -s /opt/cmake-3.27.7/bin/cmake /usr/bin/cmake && \
ln -s /opt/cmake-3.27.7/bin/cmake /usr/bin/cmake3
ENV PATH=/opt/cmake-3.27.7/bin:${PATH}
# Python 3.10
RUN wget -q https://www.python.org/ftp/python/3.10.14/Python-3.10.14.tgz && \
tar xzf Python-3.10.14.tgz && cd Python-3.10.14 && \
CFLAGS="-Wformat" ./configure --prefix=/usr/local/ --enable-shared > /dev/null && \
make -j16 > /dev/null && make altinstall > /dev/null && ldconfig && \
cd ../ && rm -rf Python-3.10.14 && rm -rf Python-3.10.14.tgz
ENV LD_LIBRARY_PATH=/usr/local/lib:${LD_LIBRARY_PATH}
# create venv and activate
RUN /usr/local/bin/python3.10 -m venv /opt/py310
# update env
ENV PATH=/opt/py310/bin:$PATH
# upgrade pip
RUN pip3.10 install --upgrade pip setuptools wheel
# install pylint and pre-commit
RUN pip3.10 install pre-commit==2.17.0 pylint pytest astroid isort coverage qtconsole distro
RUN pip3.10 install attrs pyyaml pathlib2 scipy requests psutil Cython clang-format==13.0.0 PyGithub
# install Paddle requirement
RUN wget https://raw.githubusercontent.com/PaddlePaddle/Paddle/develop/python/requirements.txt -O requirements.txt && \
pip3.10 install -r requirements.txt && rm -rf requirements.txt
RUN wget https://raw.githubusercontent.com/PaddlePaddle/Paddle/develop/python/unittest_py/requirements.txt -O requirements.txt && \
pip3.10 install -r requirements.txt && rm -rf requirements.txt
# git credential to skip password typing
RUN git config --global credential.helper store && \
git config --global pull.rebase false
# Fix locales to en_US.UTF-8
RUN yum -y install glibc-locale-source glibc-langpack-en
RUN localedef -i en_US -f UTF-8 en_US.UTF-8
# patchelf 0.14.5 - https://github.com/NixOS/patchelf/pull/216
RUN wget -q https://github.com/NixOS/patchelf/archive/refs/tags/0.14.5.tar.gz && \
tar xzf 0.14.5.tar.gz && cd patchelf-0.14.5 && \
./bootstrap.sh > /dev/null && ./configure > /dev/null && \
make -j16 > /dev/null && make install > /dev/null && \
cd .. && rm -rf patchelf-0.14.5 && rm -rf 0.14.5.tar.gz
# ccache 4.6.3
RUN wget -q https://github.com/ccache/ccache/releases/download/v4.6.3/ccache-4.6.3.tar.gz && \
tar xf ccache-4.6.3.tar.gz && mkdir /usr/local/ccache-4.6.3 && cd ccache-4.6.3 && \
mkdir build && cd build && \
cmake -DCMAKE_BUILD_TYPE=Release -DREDIS_STORAGE_BACKEND=OFF \
-DCMAKE_INSTALL_PREFIX=/usr/local/ccache-4.6.3 .. > /dev/null && \
make -j16 > /dev/null && make install > /dev/null && \
cd ../../ && rm -rf ccache-4.6.3.tar.gz && rm -rf ccache-4.6.3 && \
ln -s /usr/local/ccache-4.6.3/bin/ccache /usr/local/bin/ccache
ENV CCACHE_MAXSIZE=50G \
CCACHE_LIMIT_MULTIPLE=0.8 \
CCACHE_SLOPPINESS=clang_index_store,time_macros,include_file_mtime
# configure ssh
RUN sed -i "s/^#PermitRootLogin/PermitRootLogin/" /etc/ssh/sshd_config && \
sed -i "s/^#PubkeyAuthentication/PubkeyAuthentication/" /etc/ssh/sshd_config && \
sed -i "s/^#RSAAuthentication/RSAAuthentication/" /etc/ssh/sshd_config && \
sed -i "s/#UseDNS .*/UseDNS no/" /etc/ssh/sshd_config
RUN ssh-keygen -A
# yum clean
RUN yum clean all && \
rm -rf /var/cache/yum && \
rm -rf /var/lib/yum/yumdb && \
rm -rf /var/lib/yum/history
# Install DTK
RUN wget -q --no-proxy https://cancon.hpccube.com:65024/file/1/DTK-24.04.1/CentOS7.6/DTK-24.04.1-CentOS7.6-x86_64.tar.gz --no-check-certificate && \
tar zxf DTK-24.04.1-CentOS7.6-x86_64.tar.gz && rm -rf DTK-24.04.1-CentOS7.6-x86_64.tar.gz
# Replace if you use other device type, e.g. Z100, Z100L, K100
RUN wget -q https://paddle-device.bj.bcebos.com/dcu/hyhal-K100AI.tar.gz && \
tar zxf hyhal-K100AI.tar.gz && rm -rf hyhal-K100AI.tar.gz
RUN echo "source /opt/dtk-24.04.1/env.sh" >> /root/.bashrc
# Disable compile warnings
RUN sed -i '74d' /opt/dtk-24.04.1/include/rocrand/rocrand_common.h
# generate core dump
RUN echo "kernel.core_pattern=core_%e_%p_%t" >> /etc/sysctl.conf && \
echo "kernel.core_uses_pid=0" >> /etc/sysctl.conf
EXPOSE 22
+87
View File
@@ -0,0 +1,87 @@
# Docker Image for PaddlePaddle Ascend NPU
FROM registry.baidubce.com/device/paddle-cpu:ubuntu20-npu-base-x86_64-gcc84
LABEL maintainer="PaddlePaddle Authors <paddle-dev@baidu.com>"
ARG CANN_VERSION=8.0.T113
ARG SYSTEM=x86_64
ARG NPU_VERSION=910b
# HwHiAiUser
RUN groupadd -g 1000 HwHiAiUser && \
useradd -u 1000 -g 1000 -m -d /home/HwHiAiUser HwHiAiUser
RUN mkdir -p /usr/local/Ascend/driver
WORKDIR /usr/local/Ascend
# install CANN requirement
# https://www.hiascend.com/document/detail/zh/CANNCommunityEdition/700alpha003/softwareinstall/instg/instg_0026.html
RUN apt-get update -y && apt-get install -y zlib1g zlib1g-dev libsqlite3-dev openssl libssl-dev libffi-dev libbz2-dev \
libxslt1-dev unzip pciutils net-tools libblas-dev gfortran libblas3 liblapack-dev liblapack3 libopenblas-dev zstd
RUN pip3.10 install --upgrade pip setuptools wheel
RUN pip3.10 install 'numpy>=1.19.2' 'decorator>=4.4.0' 'sympy>=1.5.1' 'cffi>=1.12.3' 'protobuf>=3.13.0'
RUN pip3.10 install attrs pyyaml pathlib2 scipy requests psutil absl-py
# update envs for driver
ENV LD_LIBRARY_PATH=/usr/local/Ascend/driver/lib64:$LD_LIBRARY_PATH
ENV LD_LIBRARY_PATH=/usr/local/Ascend/driver/lib64/common:$LD_LIBRARY_PATH
ENV LD_LIBRARY_PATH=/usr/local/Ascend/driver/lib64/driver:$LD_LIBRARY_PATH
# Install Ascend toolkit
RUN wget -q --no-proxy https://paddle-ascend.bj.bcebos.com/cvmodel/ascend-materials/Ascend-cann-toolkit_${CANN_VERSION}_linux-${SYSTEM}.run --no-check-certificate && \
chmod +x Ascend-cann-toolkit_${CANN_VERSION}_linux-*.run && \
./Ascend-cann-toolkit_${CANN_VERSION}_linux-*.run --install --quiet && \
echo "source /usr/local/Ascend/ascend-toolkit/set_env.sh" >>~/.bashrc && \
rm -rf Ascend-cann-toolkit_${CANN_VERSION}_linux-*.run
# Install Ascend Kernels
ARG ASCEND_KLS=Ascend-cann-kernels-${NPU_VERSION}_${CANN_VERSION}_linux-${SYSTEM}.run
RUN wget -q --no-proxy https://paddle-ascend.bj.bcebos.com/cvmodel/ascend-materials/${ASCEND_KLS} --no-check-certificate && \
chmod +x ${ASCEND_KLS} && ./${ASCEND_KLS} --install --quiet && rm -rf ${ASCEND_KLS}
# Install Ascend nnal
RUN wget -q --no-proxy https://paddle-ascend.bj.bcebos.com/cvmodel/ascend-materials/Ascend-cann-nnal_${CANN_VERSION}_linux-${SYSTEM}.run --no-check-certificate && \
chmod +x Ascend-cann-nnal_${CANN_VERSION}_linux-${SYSTEM}.run && \
. /usr/local/Ascend/ascend-toolkit/set_env.sh && \
./Ascend-cann-nnal_${CANN_VERSION}_linux-${SYSTEM}.run --install --quiet &&\
rm -rf Ascend-cann-nnal_${CANN_VERSION}_linux-${SYSTEM}.run && \
echo "source /usr/local/Ascend/nnal/atb/set_env.sh" >> /root/.bashrc
# install post process ops
RUN wget -q --no-proxy https://paddle-ascend.bj.bcebos.com/code-share-master.zip --no-check-certificate && \
. /usr/local/Ascend/ascend-toolkit/set_env.sh && \
unzip code-share-master.zip && \
cd code-share-master/build && bash build_ops.sh > /dev/null && \
chmod +x aie_ops.run && ./aie_ops.run --extract=/usr/local/Ascend/ && \
rm -rf /usr/local/Ascend/code-share-master
# update env for ascendc
ENV ASCEND_CUSTOM_OPP_PATH=/usr/local/Ascend/vendors/aie_ascendc
# DEV image should open error level log
# 0 debug; 1 info; 2 warning; 3 error; 4 null
ENV ASCEND_GLOBAL_LOG_LEVEL=3
# environment for HCCL
ENV HCCL_CONNECT_TIMEOUT=7200
ENV HCCL_WHITELIST_DISABLE=1
ENV HCCL_SECURITY_MODE=1
ENV HCCL_BUFFSIZE=120
# environment for PaddlePaddle
ENV FLAGS_npu_storage_format=0
ENV FLAGS_use_stride_kernel=0
ENV FLAGS_allocator_strategy=naive_best_fit
ENV PADDLE_XCCL_BACKEND=npu
# map this folder in docker run
RUN rm -rf /usr/local/Ascend/driver
# Clean
RUN apt-get clean -y
RUN pip cache purge
EXPOSE 22
+126
View File
@@ -0,0 +1,126 @@
# Docker Image for PaddlePaddle Kunlun XPU
FROM ubuntu:20.04
LABEL maintainer="PaddlePaddle Authors <paddle-dev@baidu.com>"
RUN apt-get update && apt-get install -y apt-utils
RUN ln -snf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends tzdata
RUN apt-get update && apt-get install -y software-properties-common && add-apt-repository ppa:deadsnakes/ppa && add-apt-repository ppa:ubuntu-toolchain-r/test
RUN apt-get update && apt-get install -y curl wget vim git unzip unrar tar ntp xz-utils libssl-dev bzip2 gzip make automake \
coreutils language-pack-zh-hans libsm6 libxext6 libxrender-dev libgl1-mesa-glx libsqlite3-dev libopenblas-dev liblapack3 \
bison libjpeg-dev zlib1g zlib1g-dev swig locales net-tools libtool numactl libnuma-dev liblzma-dev libbz2-dev libblas-dev \
openssl openssh-server libffi-dev pciutils libblas3 liblapack-dev libzstd-dev default-jre libgcc-s1 gcc g++ gfortran gdb
# workdir
WORKDIR /opt
# GCC 8.4
RUN apt-get install -y gcc-8 g++-8 gfortran-8
RUN update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-8 90 && \
update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-8 90 && \
update-alternatives --install /usr/bin/gfortran gfortran /usr/bin/gfortran-8 90
# cmake 3.27.7
RUN wget -q https://cmake.org/files/v3.27/cmake-3.27.7-linux-x86_64.sh && \
chmod +x cmake-3.27.7-linux-x86_64.sh && mkdir -p /opt/cmake-3.27.7 && \
./cmake-3.27.7-linux-x86_64.sh --prefix=/opt/cmake-3.27.7 --skip-license && \
rm -rf cmake-3.27.7-linux-x86_64.sh
ENV PATH=/opt/cmake-3.27.7/bin:${PATH}
# default python version
ARG PY_VERSION=3.10
RUN apt-get update && apt-get install -y python3.10-distutils python3.10 python3.10-dev
# install pip
RUN curl -s -q https://bootstrap.pypa.io/get-pip.py | /usr/bin/python3.10
# set default python
RUN rm -rf /usr/bin/python3 && ln -s /usr/bin/python${PY_VERSION} /usr/bin/python3 && \
rm -rf /usr/bin/python && ln -s /usr/bin/python${PY_VERSION} /usr/bin/python
# install pylint and pre-commit
RUN pip3.10 install pre-commit==2.17.0 pylint pytest astroid isort coverage qtconsole distro
RUN pip3.10 install attrs pyyaml pathlib2 scipy requests psutil Cython clang-format==13.0.0 setuptools==76.1.0
# add more libs
RUN apt-get update && apt-get install libprotobuf-dev protobuf-compiler libprotoc-dev lsof libgeos-dev zstd \
pkg-config libhdf5-103 libhdf5-dev lrzsz libsndfile1 tree ninja-build -y
# install Paddle requirement
RUN wget --no-check-certificate https://raw.githubusercontent.com/PaddlePaddle/Paddle/develop/python/requirements.txt -O requirements.txt && \
pip3.10 install -r requirements.txt -i https://pypi.org/simple && rm -rf requirements.txt
RUN wget --no-check-certificate https://raw.githubusercontent.com/PaddlePaddle/Paddle/develop/python/unittest_py/requirements.txt -O requirements.txt && \
pip3.10 install -r requirements.txt -i https://pypi.org/simple && rm -rf requirements.txt
# 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
# patchelf 0.14.5 - https://github.com/NixOS/patchelf/pull/216
RUN wget -q --no-check-certificate https://github.com/NixOS/patchelf/archive/refs/tags/0.14.5.tar.gz && \
tar xzf 0.14.5.tar.gz && cd patchelf-0.14.5 && \
./bootstrap.sh > /dev/null && ./configure > /dev/null && \
make -j16 > /dev/null && make install > /dev/null && \
cd .. && rm -rf patchelf-0.14.5 && rm -rf 0.14.5.tar.gz
# ccache 4.6.3
RUN wget -q https://github.com/ccache/ccache/releases/download/v4.6.3/ccache-4.6.3.tar.gz && \
tar xf ccache-4.6.3.tar.gz && mkdir /usr/local/ccache-4.6.3 && cd ccache-4.6.3 && \
mkdir build && cd build && \
cmake -DCMAKE_BUILD_TYPE=Release -DREDIS_STORAGE_BACKEND=OFF \
-DCMAKE_INSTALL_PREFIX=/usr/local/ccache-4.6.3 .. > /dev/null && \
make -j16 > /dev/null && make install > /dev/null && \
cd ../../ && rm -rf ccache-4.6.3.tar.gz && rm -rf ccache-4.6.3 && \
ln -s /usr/local/ccache-4.6.3/bin/ccache /usr/local/bin/ccache
ENV CCACHE_MAXSIZE=80G \
CCACHE_LIMIT_MULTIPLE=0.8 \
CCACHE_SLOPPINESS=clang_index_store,time_macros,include_file_mtime
# Install XRE 5.0.21.21
WORKDIR /opt
ARG XRE_VERSION=5.0.21.21
ARG XRE_INSTALL=/usr/local/xpu-${XRE_VERSION}
RUN wget -q https://klx-sdk-release-public.su.bcebos.com/xre/kl3-release/${XRE_VERSION}/xre-ubuntu_2004-x86_64-${XRE_VERSION}.tar.gz --no-check-certificate && \
tar -zxf xre-ubuntu_2004-x86_64-${XRE_VERSION}.tar.gz && \
mkdir -p ${XRE_INSTALL} && \
mv -f /opt/xre-ubuntu_2004-x86_64-${XRE_VERSION}/* ${XRE_INSTALL}/ && \
ln -sf ${XRE_INSTALL} /usr/local/xpu && \
ln -sf ${XRE_INSTALL}/bin/xpu_smi /usr/local/bin/xpu_smi && \
rm -rf xre-ubuntu_2004-x86_64-${XRE_VERSION}.tar.gz
ENV PATH=${XRE_INSTALL}/bin:$PATH
# Update RDMA
RUN wget "https://su.bcebos.com/v1/klx-sdk-release-public/xccl/resource/MLNX_OFED_LINUX-24.10-2.1.8.0-ubuntu20.04-x86_64.tgz?authorization=bce-auth-v1%2FALTAKlxQapmxlH5xQFcp7rEkCr%2F2025-05-28T02%3A24%3A09Z%2F-1%2Fhost%2Fbaad25d036a6eb868dad8ab19468884e5016507fdd6879fe1259db4bbef694e6" --no-check-certificate \
-O MLNX_OFED_LINUX-24.10-2.1.8.0-ubuntu20.04-x86_64.tgz && \
tar -zxf MLNX_OFED_LINUX-24.10-2.1.8.0-ubuntu20.04-x86_64.tgz && \
cd MLNX_OFED_LINUX-24.10-2.1.8.0-ubuntu20.04-x86_64 && \
./mlnxofedinstall --user-space-only --skip-distro-check --without-fw-update --force && \
rm -rf MLNX_OFED_LINUX-24.10-2.1.8.0-ubuntu20.04-x86_64.tgz && \
rm -rf MLNX_OFED_LINUX-24.10-2.1.8.0-ubuntu20.04-x86_64
# Configure OpenSSH server. c.f. https://docs.docker.com/engine/examples/running_ssh_service
RUN mkdir /var/run/sshd && echo 'root:root' | chpasswd && \
sed -ri 's/^PermitRootLogin\s+.*/PermitRootLogin yes/' /etc/ssh/sshd_config && \
sed -ri 's/UsePAM yes/#UsePAM yes/g' /etc/ssh/sshd_config
# Set language environment in .bashrc
RUN echo "export LANG=en_US.UTF-8" >> /root/.bashrc && \
echo "export LANGUAGE=en_US.UTF-8" >> /root/.bashrc && \
echo "export LC_ALL=en_US.UTF-8" >> /root/.bashrc
CMD source ~/.bashrc
# /proc/sys/kernel/core_pattern
RUN mkdir -p /var/core
# Clean
RUN apt-get clean -y
RUN pip cache purge
EXPOSE 22
@@ -0,0 +1,158 @@
# Docker Image for PaddlePaddle Kunlun XPU P800
FROM ubuntu:22.04
LABEL maintainer="PaddlePaddle Authors <paddle-dev@baidu.com>"
RUN apt-get update && apt-get install -y apt-utils
RUN ln -snf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends tzdata
RUN apt-get update && \
apt-get install -y software-properties-common && \
add-apt-repository ppa:deadsnakes/ppa && \
add-apt-repository ppa:ubuntu-toolchain-r/test
RUN apt-get update && apt-get install -y curl wget vim git unzip unrar tar ntp xz-utils libssl-dev bzip2 gzip make automake \
coreutils language-pack-zh-hans libsm6 libxext6 libxrender-dev libgl1-mesa-glx libsqlite3-dev libopenblas-dev liblapack3 \
bison libjpeg-dev zlib1g zlib1g-dev swig locales net-tools libtool numactl libnuma-dev liblzma-dev libbz2-dev libblas-dev \
openssl openssh-server libffi-dev pciutils libblas3 liblapack-dev libzstd-dev default-jre libgcc-s1 gdb
# workdir
WORKDIR /opt
# GCC 12
RUN rm -f /usr/bin/gcc && rm -f /usr/bin/g++
RUN apt-get install -y gcc-12 g++-12 gfortran-12
RUN ln -s /usr/bin/gcc-12 /usr/bin/gcc
RUN ln -s /usr/bin/g++-12 /usr/bin/g++
RUN ln -s /usr/bin/gfortran-12 /usr/bin/gfortran
# patchelf 0.15.0 - https://github.com/NixOS/patchelf/pull/216
RUN wget -q --no-check-certificate https://github.com/NixOS/patchelf/archive/refs/tags/0.15.0.tar.gz && \
tar xzf 0.15.0.tar.gz && cd patchelf-0.15.0 && \
./bootstrap.sh > /dev/null && ./configure > /dev/null && \
make -j16 > /dev/null && make install > /dev/null && \
cd .. && rm -rf patchelf-0.15.0 && rm -rf 0.15.0.tar.gz
# install cmake && ccache
RUN apt-get remove --purge cmake && apt-get install -y cmake
# ccache version 4.9.1
RUN apt-get install -y ccache
# default python version
RUN apt-get update && apt-get install -y python3.10-distutils python3.10 python3.10-dev && \
apt-get install python-is-python3
# set default python
RUN rm -rf /usr/bin/python && ln -s /usr/bin/python3.10 /usr/bin/python && \
rm -rf /usr/bin/python3 && ln -s /usr/bin/python3.10 /usr/bin/python3
# install pip
RUN wget -q https://bootstrap.pypa.io/get-pip.py
RUN sed -i 's#"install", "--upgrade", "--force-reinstall"#"install", "--upgrade", "--force-reinstall", "--break-system-packages"#' get-pip.py
RUN python3.10 get-pip.py && \
rm -rf /opt/get-pip.py
RUN python3.10 -m pip install setuptools==68.2.0
# binutils >= 2.27
RUN apt-get install -y binutils
# 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
#For pre-commit
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
RUN python3.10 -m pip --no-cache-dir install ipython==5.3.0 && \
python3.10 -m pip --no-cache-dir install ipykernel==4.6.0 wheel
# install pylint and pre-commit
RUN python3.10 -m pip --no-cache-dir install pre-commit==2.17.0 pylint pytest astroid isort coverage qtconsole distro \
attrs pyyaml pathlib2 scipy requests psutil Cython clang-format==13.0.0
# add more libs
RUN apt-get update && apt-get install libprotobuf-dev protobuf-compiler libprotoc-dev lsof libgeos-dev zstd \
pkg-config libhdf5-103 libhdf5-dev lrzsz libsndfile1 tree ninja-build iproute2 iputils-ping -y
# install Paddle requirement
RUN wget --no-check-certificate https://raw.githubusercontent.com/PaddlePaddle/Paddle/develop/python/requirements.txt -O requirements.txt && \
python3.10 -m pip --no-cache-dir install -r requirements.txt -i https://pypi.org/simple && \
rm -rf requirements.txt
RUN wget --no-check-certificate https://raw.githubusercontent.com/PaddlePaddle/Paddle/develop/python/unittest_py/requirements.txt -O requirements.txt && \
python3.10 -m pip --no-cache-dir install -r requirements.txt --ignore-installed -i https://pypi.org/simple && \
rm -rf requirements.txt
# Install XRE 5.0.21.21
WORKDIR /opt
ARG XRE_VERSION=5.0.21.21
ARG XRE_INSTALL=/usr/local/xpu-${XRE_VERSION}
RUN wget -q https://klx-sdk-release-public.su.bcebos.com/xre/kl3-release/${XRE_VERSION}/xre-ubuntu_2004-x86_64-${XRE_VERSION}.tar.gz --no-check-certificate && \
tar -zxf xre-ubuntu_2004-x86_64-${XRE_VERSION}.tar.gz && \
mkdir -p ${XRE_INSTALL} && \
mv -f /opt/xre-ubuntu_2004-x86_64-${XRE_VERSION}/* ${XRE_INSTALL}/ && \
ln -sf ${XRE_INSTALL} /usr/local/xpu && \
ln -sf ${XRE_INSTALL}/bin/xpu_smi /usr/local/bin/xpu_smi && \
rm -rf xre-ubuntu_2004-x86_64-${XRE_VERSION}.tar.gz
ENV PATH=${XRE_INSTALL}/bin:$PATH
RUN wget "https://su.bcebos.com/v1/klx-sdk-release-public/xccl/resource/MLNX_OFED_LINUX-24.01-0.3.3.1-ubuntu22.04-x86_64.tgz" --no-check-certificate \
-O MLNX_OFED_LINUX-24.01-0.3.3.1-ubuntu22.04-x86_64.tgz && \
tar -zxf MLNX_OFED_LINUX-24.01-0.3.3.1-ubuntu22.04-x86_64.tgz && \
cd MLNX_OFED_LINUX-24.01-0.3.3.1-ubuntu22.04-x86_64 && \
./mlnxofedinstall --user-space-only --skip-distro-check --without-fw-update --force && \
rm -rf /opt/MLNX_OFED_LINUX-24.01-0.3.3.1-ubuntu22.04-x86_64.tgz && \
rm -rf /opt/MLNX_OFED_LINUX-24.01-0.3.3.1-ubuntu22.04-x86_64
# mpich 4.1a1
RUN wget https://www.mpich.org/static/downloads/4.1a1/mpich-4.1a1.tar.gz && \
tar -xvf mpich-4.1a1.tar.gz && \
cd mpich-4.1a1 && \
./configure \
--prefix=/opt/mpich \
--disable-fortran \
--with-hwloc=embedded \
--with-device=ch3:nemesis \
CC=gcc CXX=g++ && \
make -j$(nproc) && \
make install && \
rm -rf /opt/mpich-4.1a1.tar.gz /opt/mpich-4.1a1
ENV PATH=/opt/mpich/bin:$PATH
ENV LD_LIBRARY_PATH=/opt/mpich/lib:$LD_LIBRARY_PATH
# git env
ENV GIT_SSH_COMMAND="ssh -o HostKeyAlgorithms=+ssh-rsa -o PubkeyAcceptedAlgorithms=+ssh-rsa"
# Configure OpenSSH server. c.f. https://docs.docker.com/engine/examples/running_ssh_service
RUN mkdir /var/run/sshd && echo 'root:root' | chpasswd && \
sed -ri 's/^PermitRootLogin\s+.*/PermitRootLogin yes/' /etc/ssh/sshd_config && \
sed -ri 's/UsePAM yes/#UsePAM yes/g' /etc/ssh/sshd_config
# Set language environment in .bashrc
RUN echo "export LANG=en_US.UTF-8" >> /root/.bashrc && \
echo "export LANGUAGE=en_US.UTF-8" >> /root/.bashrc && \
echo "export LC_ALL=en_US.UTF-8" >> /root/.bashrc
CMD source ~/.bashrc
# /proc/sys/kernel/core_pattern
RUN mkdir -p /var/core
# clang14
RUN apt-get update &&\
apt install -y clang-14
# Clean
RUN apt-get clean -y
RUN pip cache purge
EXPOSE 22
+39
View File
@@ -0,0 +1,39 @@
ARG BASEIMAGE=registry.baidubce.com/paddleopen/fluiddoc-sphinx:20230828-py310-cuda11.8.0-cudnn8-runtime-ubuntu20.04-v3
FROM ${BASEIMAGE}
RUN apt-get update \
&& apt-get install -yq --no-install-recommends \
git \
jq \
wget \
pigz \
zstd \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*
ARG PYPI_MIRROR=https://pypi.tuna.tsinghua.edu.cn/simple
ARG no_proxy=127.0.0.1,localhost,bcebos.com,tuna.tsinghua.edu.cn,mirror.baidu.com,bce.baidu.com
#ARG PYPI_MIRROR=https://mirror.baidu.com/pypi/simple
RUN pip3 install --no-cache-dir -i ${PYPI_MIRROR} pylint && \
pip3 install --no-cache-dir -i ${PYPI_MIRROR} pre-commit && \
pip3 install --no-cache-dir -i ${PYPI_MIRROR} yapf==0.16.0 && \
pip3 install --no-cache-dir -i ${PYPI_MIRROR} importlib-metadata==4.11.0
RUN curl -o /entrypoint.sh -Lk https://paddle-dev-tools-open.bj.bcebos.com/fluiddoc-preview/entrypoint-paddle-docs-review.sh && \
chmod +x /entrypoint.sh && \
curl -o /tmp/linux-bcecmd-0.3.0.zip https://sdk.bce.baidu.com/console-sdk/linux-bcecmd-0.3.0.zip && \
python -m zipfile -e /tmp/linux-bcecmd-0.3.0.zip /opt && \
chmod +x /opt/linux-bcecmd-0.3.0/bcecmd && \
rm /tmp/linux-bcecmd-0.3.0.zip && \
curl -o /tmp/boscmdconfig.tgz https://paddle-dev-tools-open.bj.bcebos.com/fluiddoc-preview/boscmdconfig.tgz && \
tar xzf /tmp/boscmdconfig.tgz -C /opt/linux-bcecmd-0.3.0/ && \
rm /tmp/boscmdconfig.tgz
# COPY boscmdconfig /opt/linux-bcecmd-0.3.0/boscmdconfig/
ENV BCECMD=/opt/linux-bcecmd-0.3.0/bcecmd
ENV BCECMD_CONFIG=/opt/linux-bcecmd-0.3.0/boscmdconfig
# credentials file is empty, please build it if need.
WORKDIR /
ENTRYPOINT ["bash"]
+100
View File
@@ -0,0 +1,100 @@
# A image for building paddle binaries
# build docker image
# docker build -t paddlepaddle/paddle:latest-dev-ipu -f tools/dockerfile/Dockerfile.ipu .
# run a container
# docker run --ulimit memlock=-1:-1 --net=host --cap-add=IPC_LOCK --device=/dev/infiniband/ --ipc=host --rm -it paddlepaddle/paddle:latest-dev-ipu bash
FROM graphcore/poplar:3.0.0
MAINTAINER PaddlePaddle Authors <paddle-dev@baidu.com>
# ENV variables
ARG WITH_AVX
ENV HOME /root
ENV WITH_AVX=${WITH_AVX:-ON}
# install pkgs
RUN apt-get update && apt-get install -y apt-utils
RUN ln -snf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends tzdata
RUN apt-get update && apt-get install -y software-properties-common && add-apt-repository ppa:deadsnakes/ppa && add-apt-repository ppa:ubuntu-toolchain-r/test
RUN apt-get update && apt-get install -y curl wget vim git unzip unrar tar xz-utils libssl-dev bzip2 gzip make libgcc-s1 sudo openssh-server \
coreutils ntp language-pack-zh-hans python-qt4 libsm6 libxext6 libxrender-dev libgl1-mesa-glx libsqlite3-dev libopenblas-dev \
bison graphviz libjpeg-dev zlib1g zlib1g-dev automake locales swig net-tools libtool module-init-tools numactl libnuma-dev \
openssl libffi-dev pciutils libblas-dev gfortran libblas3 liblapack-dev liblapack3 default-jre screen tmux gdb lldb gcc g++
RUN apt-get update && apt-get install -y rdma-core librdmacm1
# Downgrade gcc&&g++
WORKDIR /usr/bin
COPY tools/dockerfile/build_scripts /build_scripts
RUN bash /build_scripts/install_gcc.sh gcc82 && rm -rf /build_scripts
RUN cp gcc gcc.bak && cp g++ g++.bak && rm gcc && rm g++
RUN ln -s /usr/local/gcc-8.2/bin/gcc /usr/local/bin/gcc
RUN ln -s /usr/local/gcc-8.2/bin/g++ /usr/local/bin/g++
RUN ln -s /usr/local/gcc-8.2/bin/gcc /usr/bin/gcc
RUN ln -s /usr/local/gcc-8.2/bin/g++ /usr/bin/g++
ENV PATH=/usr/local/gcc-8.2/bin:$PATH
# 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
# conda 4.9.2
WORKDIR /opt
ARG CONDA_FILE=Miniconda3-py38_23.10.0-1-Linux-x86_64.sh
RUN cd /opt && wget -q https://repo.anaconda.com/miniconda/${CONDA_FILE} && chmod +x ${CONDA_FILE}
RUN mkdir /opt/conda && ./${CONDA_FILE} -b -f -p "/opt/conda" && rm -rf ${CONDA_FILE}
ENV PATH=/opt/conda/bin:${PATH}
RUN conda init bash && conda install -n base jupyter jupyterlab
RUN conda install -n base spdlog==1.8.0 -y
# Install Go and glide
RUN wget -qO- https://paddle-ci.cdn.bcebos.com/go1.8.1.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 curl -s -q https://glide.sh/get | sh
# 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
# install pytest and pre-commit
RUN /opt/conda/bin/pip install pre-commit pytest protocol PyGithub
# install Paddle requirement
RUN wget https://raw.githubusercontent.com/PaddlePaddle/Paddle/develop/python/requirements.txt -O /root/requirements.txt
RUN /opt/conda/bin/pip install -r /root/requirements.txt && \
rm -rf /root/requirements.txt
RUN wget https://raw.githubusercontent.com/PaddlePaddle/Paddle/develop/python/unittest_py/requirements.txt -O /root/requirements.txt
RUN /opt/conda/bin/pip install -r /root/requirements.txt && rm -rf /root/requirements.txt
# 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 wget -q https://paddle-ci.cdn.bcebos.com/patchelf_0.10-2_amd64.deb && \
dpkg -i patchelf_0.10-2_amd64.deb
# ccache 3.7.9
RUN wget https://paddle-ci.gz.bcebos.com/ccache-3.7.9.tar.gz && \
tar xf ccache-3.7.9.tar.gz && mkdir /usr/local/ccache-3.7.9 && cd ccache-3.7.9 && \
./configure -prefix=/usr/local/ccache-3.7.9 && \
make -j8 && make install && \
ln -s /usr/local/ccache-3.7.9/bin/ccache /usr/local/bin/ccache
# # clang-form 3.8.0
# RUN wget https://paddle-ci.cdn.bcebos.com/clang+llvm-3.8.0-x86_64-linux-gnu-ubuntu-16.04.tar.xz && \
# tar xf clang+llvm-3.8.0-x86_64-linux-gnu-ubuntu-16.04.tar.xz && cd clang+llvm-3.8.0-x86_64-linux-gnu-ubuntu-16.04 && \
# cp -r * /usr/local && cd .. && rm -rf clang+llvm-3.8.0-x86_64-linux-gnu-ubuntu-16.04 && rm -rf clang+llvm-3.8.0-x86_64-linux-gnu-ubuntu-16.04.tar.xz
RUN apt-get clean -y
@@ -0,0 +1,126 @@
# 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 <baseimg>
MAINTAINER PaddlePaddle Authors <paddle-dev@baidu.com>
# ENV variables
ARG WITH_GPU
ARG WITH_AVX
ENV WITH_GPU=${WITH_GPU:-ON}
ENV WITH_AVX=${WITH_AVX:-ON}
ENV DEBIAN_FRONTEND=noninteractive
<setcuda>
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
<install_cpu_package>
# 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
+200
View File
@@ -0,0 +1,200 @@
# 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 <baseimg>
MAINTAINER PaddlePaddle Authors <paddle-dev@baidu.com>
# ENV variables
ARG WITH_GPU
ARG WITH_AVX
ENV WITH_GPU=${WITH_GPU:-ON}
ENV WITH_AVX=${WITH_AVX:-ON}
ENV DEBIAN_FRONTEND=noninteractive
<setcuda>
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 && \
apt-get install -y curl wget vim git unzip pigz zstd 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 \
libbz2-dev libexpat1-dev libffi-dev libgdbm-dev liblzma-dev libncursesw5-dev libreadline-dev \
libsqlite3-dev pkg-config tk-dev uuid-dev
<install_cpu_package>
# 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 apt-get install -y gcc-8 g++-8
RUN bash /build_scripts/install_gcc.sh gcc82
RUN cp gcc gcc.bak && cp g++ g++.bak && rm gcc && rm g++
RUN ln -sf /usr/local/gcc-8.2/bin/gcc /usr/local/bin/gcc
RUN ln -sf /usr/local/gcc-8.2/bin/g++ /usr/local/bin/g++
RUN ln -sf /usr/local/gcc-8.2/bin/gcc /usr/bin/gcc
RUN ln -sf /usr/local/gcc-8.2/bin/g++ /usr/bin/g++
RUN ln -sf /usr/local/gcc-8.2/bin/gcc /usr/bin/cc
ENV PATH=/usr/local/gcc-8.2/bin:$PATH
RUN bash /build_scripts/install_cudnn.sh cudnn841
ENV CUDNN_VERSION=8.4.1
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 wget -q https://www.bytereef.org/software/mpdecimal/releases/mpdecimal-2.5.1.tar.gz && \
tar -xzf mpdecimal-2.5.1.tar.gz && \
cd mpdecimal-2.5.1 && \
./configure --prefix=/usr/local > /dev/null && \
make -j"$(nproc)" > /dev/null && \
make install > /dev/null && \
cd .. && \
rm -rf mpdecimal-2.5.1 mpdecimal-2.5.1.tar.gz && \
ldconfig
# Build free-threaded 3.13 before normal 3.13 so python3.13 stays non-free-threaded.
RUN set -eux; \
build_python() { \
py_ver="$1"; \
shift; \
wget -q "https://www.python.org/ftp/python/${py_ver}/Python-${py_ver}.tgz"; \
tar -xzf "Python-${py_ver}.tgz"; \
cd "Python-${py_ver}"; \
configure_opts="--prefix=/usr/local --enable-shared --enable-optimizations --with-lto --with-system-expat --with-system-libmpdec --with-ensurepip=install"; \
if ./configure --help | grep -q -- "--with-system-ffi"; then \
configure_opts="${configure_opts} --with-system-ffi"; \
fi; \
CPPFLAGS="-I/usr/local/include" LDFLAGS="-L/usr/local/lib" CFLAGS="-Wformat" ./configure ${configure_opts} "$@" > /dev/null; \
make -j"$(nproc)" > /dev/null; \
make altinstall > /dev/null; \
cd ..; \
rm -rf "Python-${py_ver}" "Python-${py_ver}.tgz"; \
ldconfig; \
}; \
build_python 3.10.0; \
build_python 3.11.0; \
build_python 3.12.0; \
build_python 3.13.0 --disable-gil --with-mimalloc; \
build_python 3.13.0
ENV LD_LIBRARY_PATH=/usr/local/lib:${LD_LIBRARY_PATH}
# Keep Ubuntu's /usr/bin/python3 for system scripts such as lsb_release.
RUN ln -sf /usr/local/bin/python3.10 /usr/bin/python
RUN for py in 3.10 3.11 3.12 3.13 3.13t; do \
python${py} -m pip install --no-cache-dir --upgrade pip; \
done && \
python3.10 -m pip install setuptools==69.5.1 && \
python3.11 -m pip install setuptools==69.5.1 && \
python3.12 -m pip install --break-system-packages setuptools==69.5.1 && \
for py in 3.10 3.11 3.12 3.13 3.13t; do \
printf '#!/bin/sh\nexec /usr/local/bin/python%s -m pip "$@"\n' "$py" > "/usr/local/bin/pip${py}" && \
chmod +x "/usr/local/bin/pip${py}"; \
done && \
ln -sf /usr/local/bin/pip3.10 /usr/local/bin/pip && \
ln -sf /usr/local/bin/pip3.10 /usr/local/bin/pip3 && \
python3.13 -m pip install setuptools==69.5.1 && \
python3.13t -m pip install setuptools==69.5.1
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 pip3.10 --no-cache-dir install ipython==5.3.0 && \
pip3.10 --no-cache-dir install ipykernel==4.6.0 wheel && \
pip3.11 --no-cache-dir install ipython==5.3.0 && \
pip3.11 --no-cache-dir install ipykernel==4.6.0 wheel && \
pip3.12 --no-cache-dir install ipython==5.3.0 && \
pip3.12 --no-cache-dir install ipykernel==4.6.0 wheel && \
python3.13 -m pip --no-cache-dir install ipython==5.3.0 && \
python3.13 -m pip --no-cache-dir install ipykernel==4.6.0 wheel && \
python3.13t -m pip --no-cache-dir install ipython==5.3.0 && \
python3.13t -m pip --no-cache-dir install ipykernel==4.6.0 wheel
# For PaddleTest CE
RUN pip3.10 --no-cache-dir install pytest && \
pip3.11 --no-cache-dir install pytest && \
pip3.12 --no-cache-dir install pytest && \
python3.13 -m pip --no-cache-dir install pytest && \
python3.13t -m pip --no-cache-dir install pytest
RUN pip3.10 --no-cache-dir install pre-commit==2.17.0 && \
pip3.10 --no-cache-dir install cpplint==1.6.0 clang-format==13.0.0 && \
pip3.11 --no-cache-dir install cpplint==1.6.0 clang-format==13.0.0 && \
pip3.12 --no-cache-dir install cpplint==1.6.0 clang-format==13.0.0 && \
python3.13 -m pip --no-cache-dir install cpplint==1.6.0 clang-format==13.0.0 && \
python3.13t -m pip --no-cache-dir install cpplint==1.6.0 clang-format==13.0.0
COPY ./python/requirements.txt /root/
COPY ./python/unittest_py/requirements.txt /home/
COPY ./paddle/scripts/compile_requirements.txt /home/
# Free-threaded Python 3.13 only installs compile helpers because broader
# requirements currently pull packages without cp313t wheels.
RUN pip3.10 --no-cache-dir install -r /root/requirements.txt && \
pip3.10 --no-cache-dir install -r /home/requirements.txt && \
pip3.10 --no-cache-dir install -r /home/compile_requirements.txt && \
pip3.11 --no-cache-dir install -r /root/requirements.txt && \
pip3.11 --no-cache-dir install -r /home/requirements.txt && \
pip3.11 --no-cache-dir install -r /home/compile_requirements.txt && \
pip3.12 --no-cache-dir install -r /root/requirements.txt && \
pip3.12 --no-cache-dir install -r /home/requirements.txt && \
pip3.12 --no-cache-dir install -r /home/compile_requirements.txt && \
python3.13 -m pip --no-cache-dir install -r /root/requirements.txt && \
python3.13 -m pip --no-cache-dir install -r /home/requirements.txt && \
python3.13 -m pip --no-cache-dir install -r /home/compile_requirements.txt && \
python3.13t -m pip --no-cache-dir install -r /home/compile_requirements.txt
# clang12
RUN apt-get update &&\
apt install -y clang-12
ARG CC=/usr/bin/clang-12
ARG CXX=/usr/bin/clang++-12
# 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
EXPOSE 22
+154
View File
@@ -0,0 +1,154 @@
# 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 <baseimg>
MAINTAINER PaddlePaddle Authors <paddle-dev@baidu.com>
# ENV variables
ARG WITH_GPU
ARG WITH_AVX
ENV WITH_GPU=${WITH_GPU:-ON}
ENV WITH_AVX=${WITH_AVX:-ON}
ENV DEBIAN_FRONTEND=noninteractive
<setcuda>
ENV HOME /root
# Add bash enhancements
COPY paddle/scripts/docker/root/ /root/
RUN chmod 777 /tmp
RUN mv /etc/apt/sources.list.d/cuda-ubuntu2204-x86_64.list /etc/apt/sources.list.d/cuda-ubuntu2204-x86_64.list.bak
RUN apt-get update && apt-get install -y curl
RUN curl https://developer.download.nvidia.cn/compute/cuda/repos/ubuntu2204/x86_64/3bf863cc.pub | gpg --dearmor | tee /usr/share/keyrings/cuda-archive-keyring.gpg
RUN mv /etc/apt/sources.list.d/cuda-ubuntu2204-x86_64.list.bak /etc/apt/sources.list.d/cuda-ubuntu2204-x86_64.list
RUN sed -i 's#deb https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2204/x86_64 /#deb [signed-by=/usr/share/keyrings/cuda-archive-keyring.gpg] https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2204/x86_64 /#' /etc/apt/sources.list.d/cuda-ubuntu2204-x86_64.list
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 build-essential curl wget vim git unzip pigz zstd unrar tar xz-utils libssl-dev bzip2 gzip \
coreutils ntp language-pack-zh-hans libsm6 libxext6 libxrender-dev libgl1 libglx-mesa0 \
bison graphviz libjpeg-dev zlib1g-dev automake locales swig net-tools libtool kmod
<install_cpu_package>
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 apt-get install -y gcc-12 g++-12
RUN cp gcc gcc.bak && cp g++ g++.bak && rm gcc && rm g++
RUN ln -s /usr/bin/gcc-12 /usr/local/bin/gcc
RUN ln -s /usr/bin/g++-12 /usr/local/bin/g++
RUN ln -s /usr/bin/gcc-12 /usr/bin/gcc
RUN ln -s /usr/bin/g++-12 /usr/bin/g++
ENV PATH=/usr/local/gcc-12/bin:$PATH
<install_cudnn>
RUN rm -rf /build_script
# install cmake && ccache
RUN apt-get remove --purge cmake && apt-get install -y cmake
# ccache version 4.9.1
RUN apt-get install -y ccache
RUN apt-get update && \
apt-get install -y python3.10 python3.10-dev python3.10-distutils \
python3.11 python3.11-dev python3.11-distutils \
python3.12 python3.12-dev \
python3.13 python3.13-dev python3.13-nogil && \
apt-get install python-is-python3
RUN 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 -q https://bootstrap.pypa.io/get-pip.py
RUN sed -i 's#"install", "--upgrade", "--force-reinstall"#"install", "--upgrade", "--force-reinstall", "--break-system-packages"#' get-pip.py
RUN python3.10 get-pip.py && \
python3.11 get-pip.py && \
python3.12 get-pip.py
RUN python3.13t get-pip.py && \
mv /usr/local/bin/pip3.13 /usr/local/bin/pip3.13t && \
python3.13 get-pip.py
RUN python3.10 -m pip install setuptools==68.2.0 && \
python3.11 -m pip install setuptools==68.2.0 && \
python3.12 -m pip install --break-system-packages setuptools==68.2.0 && \
python3.13 -m pip install setuptools==69.5.0 && \
python3.13t -m pip install setuptools==69.5.0
# binutils >= 2.27
RUN apt-get install -y binutils
# 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
#For pre-commit
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
RUN python3.10 -m pip --no-cache-dir install ipython==5.3.0 && \
python3.10 -m pip --no-cache-dir install ipykernel==4.6.0 wheel && \
python3.11 -m pip --no-cache-dir install ipython==5.3.0 && \
python3.11 -m pip --no-cache-dir install ipykernel==4.6.0 wheel && \
python3.12 -m pip --no-cache-dir install --break-system-packages ipython==5.3.0 && \
python3.12 -m pip --no-cache-dir install --break-system-packages ipykernel==4.6.0 wheel && \
python3.13 -m pip --no-cache-dir install ipython==5.3.0 && \
python3.13 -m pip --no-cache-dir install ipykernel==4.6.0 wheel && \
python3.13t -m pip --no-cache-dir install ipython==5.3.0 && \
python3.13t -m pip --no-cache-dir install ipykernel==4.6.0 wheel
# For PaddleTest CE
RUN python3.10 -m pip --no-cache-dir install pytest && \
python3.11 -m pip --no-cache-dir install pytest && \
python3.12 -m pip --no-cache-dir install --break-system-packages pytest && \
python3.13 -m pip --no-cache-dir install pytest && \
python3.13t -m pip --no-cache-dir install pytest
RUN python3.10 -m pip --no-cache-dir install pre-commit==2.17.0 && \
python3.10 -m pip --no-cache-dir install cpplint==1.6.0 clang-format==13.0.0 && \
python3.11 -m pip --no-cache-dir install cpplint==1.6.0 clang-format==13.0.0 && \
python3.12 -m pip --no-cache-dir install --break-system-packages cpplint==1.6.0 clang-format==13.0.0 && \
python3.13 -m pip --no-cache-dir install cpplint==1.6.0 clang-format==13.0.0 && \
python3.13t -m pip --no-cache-dir install cpplint==1.6.0 clang-format==13.0.0
COPY ./python/requirements.txt /root/
COPY ./python/unittest_py/requirements.txt /home/
RUN python3.10 -m pip --no-cache-dir install -r /root/requirements.txt && \
python3.10 -m pip --no-cache-dir install --break-system-packages --ignore-installed -r /home/requirements.txt && \
python3.11 -m pip --no-cache-dir install -r /root/requirements.txt && \
python3.11 -m pip --no-cache-dir install --break-system-packages --ignore-installed -r /home/requirements.txt && \
python3.12 -m pip --no-cache-dir install --break-system-packages -r /root/requirements.txt && \
python3.12 -m pip --no-cache-dir install --break-system-packages --ignore-installed -r /home/requirements.txt && \
python3.13 -m pip --no-cache-dir install -r /root/requirements.txt && \
python3.13 -m pip --no-cache-dir install --break-system-packages --ignore-installed -r /home/requirements.txt && \
python3.13t -m pip --no-cache-dir install -r /root/requirements.txt
# clang14
RUN apt-get update &&\
apt install -y clang-14
EXPOSE 22
+166
View File
@@ -0,0 +1,166 @@
# 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 <baseimg>
MAINTAINER PaddlePaddle Authors <paddle-dev@baidu.com>
# ENV variables
ARG WITH_GPU
ARG WITH_AVX
ENV WITH_GPU=${WITH_GPU:-ON}
ENV WITH_AVX=${WITH_AVX:-ON}
ENV DEBIAN_FRONTEND=noninteractive
<setcuda>
ENV HOME /root
# Add bash enhancements
COPY paddle/scripts/docker/root/ /root/
RUN chmod 777 /tmp
RUN mv /etc/apt/sources.list.d/cuda.list /etc/apt/sources.list.d/cuda.list.bak
RUN apt-get update && apt-get install -y curl
RUN curl https://developer.download.nvidia.cn/compute/cuda/repos/ubuntu2404/x86_64/3bf863cc.pub | gpg --dearmor | tee /usr/share/keyrings/cuda-archive-keyring.gpg
RUN mv /etc/apt/sources.list.d/cuda.list.bak /etc/apt/sources.list.d/cuda.list
RUN sed -i 's#deb https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2404/x86_64 /#deb [signed-by=/usr/share/keyrings/cuda-archive-keyring.gpg] https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2404/x86_64 /#' /etc/apt/sources.list.d/cuda.list
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 build-essential curl wget vim git unzip pigz zstd unrar tar xz-utils libssl-dev bzip2 gzip \
coreutils ntp language-pack-zh-hans libsm6 libxext6 libxrender-dev libgl1 libglx-mesa0 \
bison graphviz libjpeg-dev zlib1g-dev automake locales swig net-tools libtool kmod
<install_cpu_package>
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_nccl2.sh
RUN rm -rf /build_script
# install cmake && ccache
RUN apt-get remove --purge cmake && apt-get install -y cmake=3.28.3-1build7
# ccache version 4.9.1
RUN apt-get install -y ccache
RUN apt-get update && \
apt-get install -y python3.10 python3.10-dev python3.10-distutils \
python3.11 python3.11-dev python3.11-distutils \
python3.12 python3.12-dev \
python3.13 python3.13-dev python3.13-nogil \
python3.14 python3.14-dev python3.14-nogil && \
apt-get install python-is-python3
RUN 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 -q https://bootstrap.pypa.io/get-pip.py
RUN sed -i 's#"install", "--upgrade", "--force-reinstall"#"install", "--upgrade", "--force-reinstall", "--break-system-packages"#' get-pip.py
RUN python3.10 get-pip.py && \
python3.11 get-pip.py && \
python3.12 get-pip.py
RUN python3.13t get-pip.py && \
mv /usr/local/bin/pip3.13 /usr/local/bin/pip3.13t && \
python3.13 get-pip.py
RUN python3.14t get-pip.py && \
mv /usr/local/bin/pip3.14 /usr/local/bin/pip3.14t && \
python3.14 get-pip.py
RUN python -m pip config set global.break-system-packages true
RUN python3.10 -m pip install setuptools==68.2.0 && \
python3.11 -m pip install setuptools==68.2.0 && \
python3.12 -m pip install --break-system-packages setuptools==68.2.0 && \
python3.13 -m pip install setuptools==69.5.0 && \
python3.13t -m pip install setuptools==69.5.0 && \
python3.14 -m pip install setuptools==69.5.0 && \
python3.14t -m pip install setuptools==69.5.0
# binutils >= 2.27
RUN apt-get install -y binutils
# 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
#For pre-commit
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
RUN python3.10 -m pip --no-cache-dir install ipython==5.3.0 && \
python3.10 -m pip --no-cache-dir install ipykernel==4.6.0 wheel && \
python3.11 -m pip --no-cache-dir install ipython==5.3.0 && \
python3.11 -m pip --no-cache-dir install ipykernel==4.6.0 wheel && \
python3.12 -m pip --no-cache-dir install --break-system-packages ipython==5.3.0 && \
python3.12 -m pip --no-cache-dir install --break-system-packages ipykernel==4.6.0 wheel && \
python3.13 -m pip --no-cache-dir install ipython==5.3.0 && \
python3.13 -m pip --no-cache-dir install ipykernel==4.6.0 wheel && \
python3.13t -m pip --no-cache-dir install ipython==5.3.0 && \
python3.13t -m pip --no-cache-dir install ipykernel==4.6.0 wheel && \
python3.14 -m pip --no-cache-dir install ipython==5.3.0 ipykernel==4.6.0 wheel && \
python3.14t -m pip --no-cache-dir install ipython==5.3.0 ipykernel==4.6.0 wheel
# For PaddleTest CE
RUN python3.10 -m pip --no-cache-dir install pytest && \
python3.11 -m pip --no-cache-dir install pytest && \
python3.12 -m pip --no-cache-dir install --break-system-packages pytest && \
python3.13 -m pip --no-cache-dir install pytest && \
python3.13t -m pip --no-cache-dir install pytest && \
python3.14 -m pip --no-cache-dir install pytest && \
python3.14t -m pip --no-cache-dir install pytest
RUN python3.10 -m pip --no-cache-dir install pre-commit==2.17.0 && \
python3.10 -m pip --no-cache-dir install cpplint==1.6.0 clang-format==13.0.0 && \
python3.11 -m pip --no-cache-dir install cpplint==1.6.0 clang-format==13.0.0 && \
python3.12 -m pip --no-cache-dir install --break-system-packages cpplint==1.6.0 clang-format==13.0.0 && \
python3.13 -m pip --no-cache-dir install cpplint==1.6.0 clang-format==13.0.0 && \
python3.13t -m pip --no-cache-dir install cpplint==1.6.0 clang-format==13.0.0 && \
python3.14 -m pip --no-cache-dir install cpplint==1.6.0 clang-format==13.0.0 && \
python3.14t -m pip --no-cache-dir install cpplint==1.6.0 clang-format==13.0.0
COPY ./python/requirements.txt /root/
COPY ./python/unittest_py/requirements.txt /home/
RUN python3.10 -m pip --no-cache-dir install -r /root/requirements.txt && \
python3.10 -m pip --no-cache-dir install --break-system-packages --ignore-installed -r /home/requirements.txt && \
python3.11 -m pip --no-cache-dir install -r /root/requirements.txt && \
python3.11 -m pip --no-cache-dir install --break-system-packages --ignore-installed -r /home/requirements.txt && \
python3.12 -m pip --no-cache-dir install --break-system-packages -r /root/requirements.txt && \
python3.12 -m pip --no-cache-dir install --break-system-packages --ignore-installed -r /home/requirements.txt && \
python3.13 -m pip --no-cache-dir install -r /root/requirements.txt && \
python3.13 -m pip --no-cache-dir install --break-system-packages --ignore-installed -r /home/requirements.txt && \
python3.13t -m pip --no-cache-dir install -r /root/requirements.txt && \
python3.14 -m pip --no-cache-dir install -r /root/requirements.txt && \
python3.14 -m pip --no-cache-dir install --break-system-packages --ignore-installed -r /home/requirements.txt && \
python3.14t -m pip --no-cache-dir install -r /root/requirements.txt
# clang14
RUN apt-get update &&\
apt install -y clang-14
EXPOSE 22
@@ -0,0 +1,93 @@
# 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
ARG CUDA_VERSION=13.0
ARG BASE_TARGET=cuda${CUDA_VERSION}
FROM nvcr.io/nvidia/cuda:13.0.2-cudnn-devel-ubuntu24.04 as base
# ENV variables
ARG WITH_GPU
ARG WITH_AVX
ARG WITH_ARM
ARG PYTHON_VERSION=3.12
ENV WITH_GPU=${WITH_GPU:-ON}
ENV WITH_AVX=${WITH_AVX:-ON}
ENV WITH_ARM=${WITH_ARM:-ON}
ENV DEBIAN_FRONTEND=noninteractive
ENV LD_LIBRARY_PATH=/usr/local/cuda-${CUDA_VERSION}/compat:/usr/local/cuda-${CUDA_VERSION}/targets/x86_64-linux/lib:$LD_LIBRARY_PATH
ENV HOME /root
ARG HTTP_PROXY
ARG HTTPS_PROXY
ARG NO_PROXY
ENV http_proxy=${HTTP_PROXY} \
https_proxy=${HTTPS_PROXY} \
no_proxy=${NO_PROXY}
RUN apt-get update && \
apt-get install -y software-properties-common && \
add-apt-repository -y ppa:deadsnakes/ppa && \
apt-get update --allow-unauthenticated && \
apt-get install -y --no-install-recommends \
git \
vim \
curl \
wget \
make \
libgl1 \
libglib2.0-0 \
libssl-dev \
autoconf \
automake \
libtool \
libmlx5-1 \
libibverbs-dev \
ninja-build \
zlib1g-dev \
python${PYTHON_VERSION} \
python${PYTHON_VERSION}-dev \
python${PYTHON_VERSION}-venv \
python3-pip && \
ln -sf /usr/bin/python${PYTHON_VERSION} /usr/bin/python && \
ln -sf /usr/bin/python${PYTHON_VERSION} /usr/bin/python3 && \
rm -rf /var/lib/apt/lists/*
WORKDIR /home
RUN wget -q https://cmake.org/files/v3.31/cmake-3.31.0-linux-aarch64.tar.gz && \
tar -zxf cmake-3.31.0-linux-aarch64.tar.gz && \
rm cmake-3.31.0-linux-aarch64.tar.gz && \
rm -rf /home/cmake-3.31.0-linux-aarch64/doc /home/cmake-3.31.0-linux-aarch64/man
ENV PATH=/home/cmake-3.31.0-linux-aarch64/bin:$PATH
ARG TMP_DIR=patchelf_tmp
RUN rm -rf "$TMP_DIR" && git clone -b 0.15.0 https://github.com/NixOS/patchelf "$TMP_DIR" && \
cd "$TMP_DIR" && ./bootstrap.sh && \
./configure && make && make install && \
cd .. && rm -rf "$TMP_DIR"
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/bin/ccache && \
cd ../../ && rm -rf ccache-4.8.2.tar.gz && rm -rf ccache-4.8.2
COPY paddle/scripts/compile_requirements.txt /root
COPY python/requirements.txt /root
RUN pip config set global.break-system-packages true
RUN pip install --break-system-packages -r /root/requirements.txt && \
pip install --break-system-packages -r /root/compile_requirements.txt && \
pip install --break-system-packages wheel pyyaml && \
rm -rf /root/compile_requirements.txt /root/requirements.txt
#install gdrcopy
RUN cd /usr/local && wget -q https://paddle-ci.gz.bcebos.com/gdrcopy.tar && tar xf gdrcopy.tar && rm -rf gdrcopy.tar
ENV GDRCOPY_HOME=/usr/local/gdrcopy
@@ -0,0 +1,96 @@
# 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
ARG CUDA_VERSION=13.0
ARG BASE_TARGET=cuda${CUDA_VERSION}
FROM nvcr.io/nvidia/cuda:13.0.2-cudnn-devel-ubuntu24.04 as base
# ENV variables
ARG WITH_GPU
ARG WITH_AVX
ARG WITH_ARM
ARG PYTHON_VERSION=3.13
ENV WITH_GPU=${WITH_GPU:-ON}
ENV WITH_AVX=${WITH_AVX:-ON}
ENV WITH_ARM=${WITH_ARM:-ON}
ENV DEBIAN_FRONTEND=noninteractive
ENV LD_LIBRARY_PATH=/usr/local/cuda-${CUDA_VERSION}/compat:/usr/local/cuda-${CUDA_VERSION}/targets/x86_64-linux/lib:$LD_LIBRARY_PATH
ENV HOME /root
ARG HTTP_PROXY
ARG HTTPS_PROXY
ARG NO_PROXY
ENV http_proxy=${HTTP_PROXY} \
https_proxy=${HTTPS_PROXY} \
no_proxy=${NO_PROXY}
RUN apt-get update && \
apt-get install -y software-properties-common && \
add-apt-repository -y ppa:deadsnakes/ppa && \
apt-get update --allow-unauthenticated && \
apt-get install -y --no-install-recommends \
git \
vim \
curl \
wget \
make \
libgl1 \
libglib2.0-0 \
libssl-dev \
autoconf \
automake \
libtool \
libmlx5-1 \
libibverbs-dev \
ninja-build \
zlib1g-dev \
python${PYTHON_VERSION} \
python${PYTHON_VERSION}-dev \
python${PYTHON_VERSION}-venv && \
ln -sf /usr/bin/python${PYTHON_VERSION} /usr/bin/python && \
ln -sf /usr/bin/python${PYTHON_VERSION} /usr/bin/python3 && \
rm -rf /var/lib/apt/lists/*
WORKDIR /home
RUN wget -q https://cmake.org/files/v3.31/cmake-3.31.0-linux-aarch64.tar.gz && \
tar -zxf cmake-3.31.0-linux-aarch64.tar.gz && \
rm cmake-3.31.0-linux-aarch64.tar.gz && \
rm -rf /home/cmake-3.31.0-linux-aarch64/doc /home/cmake-3.31.0-linux-aarch64/man
ENV PATH=/home/cmake-3.31.0-linux-aarch64/bin:$PATH
ARG TMP_DIR=patchelf_tmp
RUN rm -rf "$TMP_DIR" && git clone -b 0.15.0 https://github.com/NixOS/patchelf "$TMP_DIR" && \
cd "$TMP_DIR" && ./bootstrap.sh && \
./configure && make && make install && \
cd .. && rm -rf "$TMP_DIR"
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/bin/ccache && \
cd ../../ && rm -rf ccache-4.8.2.tar.gz && rm -rf ccache-4.8.2
COPY paddle/scripts/compile_requirements.txt /root
COPY python/requirements.txt /root
#install pip3
RUN curl -sS https://bootstrap.pypa.io/get-pip.py | python${PYTHON_VERSION} && \
ln -sf /usr/bin/pip${PYTHON_VERSION} /usr/bin/pip3 && \
ln -sf /usr/bin/pip${PYTHON_VERSION} /usr/bin/pip
RUN pip install --break-system-packages -r /root/requirements.txt && \
pip install --break-system-packages -r /root/compile_requirements.txt && \
pip install wheel && \
rm -rf /root/compile_requirements.txt /root/requirements.txt
RUN pip config set global.break-system-packages true
#install gdrcopy
RUN cd /usr/local && wget -q https://paddle-ci.gz.bcebos.com/gdrcopy.tar && tar xf gdrcopy.tar && rm -rf gdrcopy.tar
ENV GDRCOPY_HOME=/usr/local/gdrcopy
+46
View File
@@ -0,0 +1,46 @@
#!/bin/bash
# Copyright (c) 2023 PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
set -ex
# Usage:
# export CANN_VERSION=8.0.RC1
# bash build-image.sh ${CANN_VERSION}
CANN_VERSION=${1:-8.0.0} # default 8.0.0
SYSTEM=${2:-x86_64} # default x86_64
NPU_VERSION=${3:-910b} # default 910b
DOCKER_VERSION=${CANN_VERSION//[^0-9A-Z]/} # 80T13
# Download packages from https://www.hiascend.com/software/cann/community first
if [ ! -f Ascend-cann-toolkit_${CANN_VERSION}_linux-$(uname -m).run ]; then
echo "Please download CANN installation packages first!"
exit 1
fi
sed "s#<baseimg>#registry.baidubce.com/device/paddle-cpu:ubuntu20-npu-base-$(uname -m)-gcc84#g" Dockerfile.npu.ubuntu20.gcc84 > Dockerfile.npu.ubuntu20.gcc84.test
docker build --network=host -f Dockerfile.npu.ubuntu20.gcc84.test \
--build-arg CANN_VERSION=${CANN_VERSION} \
--build-arg SYSTEM=${SYSTEM} \
--build-arg NPU_VERSION=${NPU_VERSION} \
--build-arg http_proxy=${proxy} \
--build-arg https_proxy=${proxy} \
--build-arg ftp_proxy=${proxy} \
--build-arg no_proxy=bcebos.com \
-t ccr-2vdh3abv-pub.cnc.bj.baidubce.com/device/paddle-npu:cann${DOCKER_VERSION}-ubuntu20-npu-${NPU_VERSION}-base-$(uname -m)-gcc84 .
docker push ccr-2vdh3abv-pub.cnc.bj.baidubce.com/device/paddle-npu:cann${DOCKER_VERSION}-ubuntu20-npu-${NPU_VERSION}-base-$(uname -m)-gcc84
rm -rf Dockerfile.npu.ubuntu20.gcc84.test
+113
View File
@@ -0,0 +1,113 @@
#!/bin/bash
# Copyright (c) 2020 PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
set -xe
REPO="${REPO:-paddledocker}"
function make_cuda112cudnn821trt8034() {
sed 's/<baseimg>/11.2.2-cudnn8-devel-centos7/g' Dockerfile.centos >Dockerfile.tmp
sed -i "s#RUN bash build_scripts/build.sh#RUN bash build_scripts/install_gcc.sh gcc82 \nRUN mv /usr/bin/cc /usr/bin/cc.bak \&\& ln -s /usr/local/gcc-8.2/bin/gcc /usr/bin/cc \nENV PATH=/usr/local/gcc-8.2/bin:\$PATH \nRUN yum remove -y libcudnn8-devel.x86_64 libcudnn8.x86_64 \nRUN bash build_scripts/install_cudnn.sh cudnn821 \nENV CUDNN_VERSION=8.2.1 \nRUN bash build_scripts/build.sh#g" Dockerfile.tmp
sed -i "s#build_scripts/install_trt.sh#build_scripts/install_trt.sh trt8034#g" Dockerfile.tmp
sed -i '/CMD/iRUN ldconfig' Dockerfile.tmp
}
function make_cuda116cudnn840trt8406() {
sed 's/<baseimg>/11.6.2-cudnn8-devel-centos7/g' Dockerfile.centos >Dockerfile.tmp
sed -i "s#RUN bash build_scripts/build.sh#RUN bash build_scripts/install_gcc.sh gcc82 \nRUN mv /usr/bin/cc /usr/bin/cc.bak \&\& ln -s /usr/local/gcc-8.2/bin/gcc /usr/bin/cc \nENV PATH=/usr/local/gcc-8.2/bin:\$PATH \nRUN bash build_scripts/build.sh#g" Dockerfile.tmp
sed -i "s#build_scripts/install_trt.sh#build_scripts/install_trt.sh trt8406#g" Dockerfile.tmp
sed -i '/CMD/iRUN ldconfig' Dockerfile.tmp
}
function make_cuda117cudnn841trt8424() {
sed 's/<baseimg>/11.7.1-devel-centos7/g' Dockerfile.centos >Dockerfile.tmp
sed -i "s#RUN bash build_scripts/build.sh#RUN bash build_scripts/install_gcc.sh gcc82 \nRUN mv /usr/bin/cc /usr/bin/cc.bak \&\& ln -s /usr/local/gcc-8.2/bin/gcc /usr/bin/cc \nENV PATH=/usr/local/gcc-8.2/bin:\$PATH \nRUN bash build_scripts/install_cudnn.sh cudnn841 \nENV CUDNN_VERSION=8.4.1 \nRUN bash build_scripts/build.sh#g" Dockerfile.tmp
sed -i "s#build_scripts/install_trt.sh#build_scripts/install_trt.sh trt8424#g" Dockerfile.tmp
sed -i '/CMD/iRUN ldconfig' Dockerfile.tmp
}
function make_cuda118cudnn860trt8531() {
sed 's/<baseimg>/11.8.0-devel-centos7/g' Dockerfile.centos >Dockerfile.tmp
sed -i "s#RUN bash build_scripts/build.sh#RUN bash build_scripts/install_gcc.sh gcc82 \nRUN mv /usr/bin/cc /usr/bin/cc.bak \&\& ln -s /usr/local/gcc-8.2/bin/gcc /usr/bin/cc \nENV PATH=/usr/local/gcc-8.2/bin:\$PATH \nRUN bash build_scripts/install_cudnn.sh cudnn860 \nENV CUDNN_VERSION=8.6.0 \nRUN bash build_scripts/build.sh#g" Dockerfile.tmp
sed -i "s#build_scripts/install_trt.sh#build_scripts/install_trt.sh trt8531#g" Dockerfile.tmp
sed -i '/CMD/iRUN ldconfig' Dockerfile.tmp
}
function make_cuda120cudnn891trt8616() {
sed 's/<baseimg>/12.0.1-devel-centos7/g' Dockerfile.centos >Dockerfile.tmp
sed -i "s#RUN bash build_scripts/build.sh#RUN bash build_scripts/install_gcc.sh gcc122 \nRUN mv /usr/bin/cc /usr/bin/cc.bak \&\& ln -s /usr/local/gcc-12.2/bin/gcc /usr/bin/cc \nENV PATH=/usr/local/gcc-12.2/bin:\$PATH \nRUN bash build_scripts/install_cudnn.sh cudnn891 \nENV CUDNN_VERSION=8.9.1 \nRUN bash build_scripts/build.sh#g" Dockerfile.tmp
sed -i "s#build_scripts/install_trt.sh#build_scripts/install_trt.sh trt8616#g" Dockerfile.tmp
sed -i '/CMD/iRUN ldconfig' Dockerfile.tmp
}
function make_cuda123cudnn900trt8616() {
sed 's/<baseimg>/12.3.1-devel-centos7/g' Dockerfile.centos >Dockerfile.tmp
sed -i "s#RUN bash build_scripts/build.sh#RUN bash build_scripts/install_gcc.sh gcc122 \nRUN mv /usr/bin/cc /usr/bin/cc.bak \&\& ln -s /usr/local/gcc-12.2/bin/gcc /usr/bin/cc \nENV PATH=/usr/local/gcc-12.2/bin:\$PATH \nRUN bash build_scripts/install_cudnn.sh cudnn900 \nENV CUDNN_VERSION=9.0.0 \nRUN bash build_scripts/build.sh#g" Dockerfile.tmp
sed -i "s#build_scripts/install_trt.sh#build_scripts/install_trt.sh trt8616#g" Dockerfile.tmp
sed -i '/CMD/iRUN ldconfig' Dockerfile.tmp
}
function make_cuda124cudnn911trt8616() {
sed 's/<baseimg>/12.4.1-cudnn-devel-rockylinux8/g' Dockerfile.rockylinux8 >Dockerfile.tmp
sed -i "s#<install_gcc>#RUN dnf install -y gcc-toolset-12-gcc* \&\& source /opt/rh/gcc-toolset-12/enable \&\& echo 'source /opt/rh/gcc-toolset-12/enable' >>~/.bashrc \nENV PATH=/opt/rh/gcc-toolset-12/root/usr/bin:/usr/share/Modules/bin:\$PATH \nENV LD_LIBRARY_PATH=/opt/rh/gcc-toolset-12/root/usr/lib64:/opt/rh/gcc-toolset-12/root/usr/lib:\$LD_LIBRARY_PATH #g" Dockerfile.tmp
sed -i "s#RUN bash build_scripts/build.sh#RUN bash build_scripts/install_cudnn.sh cudnn911 \nENV CUDNN_VERSION=9.1.1 \nRUN bash build_scripts/build.sh#g" Dockerfile.tmp
sed -i "s#build_scripts/install_trt.sh#build_scripts/install_trt.sh trt8616#g" Dockerfile.tmp
sed -i '/CMD/iRUN ldconfig' Dockerfile.tmp
}
function make_cuda125cudnn911trt8616() {
sed 's/<baseimg>/12.5.1-cudnn-devel-rockylinux8/g' Dockerfile.rockylinux8 >Dockerfile.tmp
sed -i "s#RUN bash build_scripts/build.sh#RUN bash build_scripts/install_gcc.sh gcc122 \nRUN mv /usr/bin/cc /usr/bin/cc.bak \&\& ln -s /usr/local/gcc-12.2/bin/gcc /usr/bin/cc \nENV PATH=/usr/local/gcc-12.2/bin:\$PATH \nRUN bash build_scripts/install_cudnn.sh cudnn911 \nENV CUDNN_VERSION=9.1.1 \nRUN bash build_scripts/build.sh#g" Dockerfile.tmp
sed -i "s#build_scripts/install_trt.sh#build_scripts/install_trt.sh trt8616#g" Dockerfile.tmp
sed -i '/CMD/iRUN ldconfig' Dockerfile.tmp
}
function main() {
local CMD=$1
case $CMD in
cuda112cudnn821trt8034)
make_cuda112cudnn821trt8034
;;
cuda116cudnn840trt8406)
make_cuda116cudnn840trt8406
;;
cuda117cudnn841trt8424)
make_cuda117cudnn841trt8424
;;
cuda118cudnn860trt8531)
make_cuda118cudnn860trt8531
;;
cuda120cudnn891trt8616)
make_cuda120cudnn891trt8616
;;
cuda123cudnn900trt8616)
make_cuda123cudnn900trt8616
;;
cuda124cudnn911trt8616)
make_cuda124cudnn911trt8616
;;
cuda125cudnn911trt8616)
make_cuda125cudnn911trt8616
;;
*)
echo "Make dockerfile error, Without this parameter."
exit 1
;;
esac
}
main "$@"
+136
View File
@@ -0,0 +1,136 @@
#!/bin/bash
# Copyright (c) 2020 PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
function make_cpu_dockerfile(){
dockerfile_name="Dockerfile.cuda9_cudnn7_gcc48_py35_centos6"
sed "s#<baseimg>#ubuntu:20.04#g" ./Dockerfile.ubuntu20 >${dockerfile_name}
sed -i "s#<setcuda>##g" ${dockerfile_name}
sed -i "s#WITH_GPU:-ON#WITH_GPU:-OFF#g" ${dockerfile_name}
sed -i "s#RUN apt-key del 7fa2af80##g" ${dockerfile_name}
sed -i 's#RUN rm /etc/apt/sources.list.d/\*##g' ${dockerfile_name}
sed -i "s#RUN apt-key adv --fetch-keys https://developer.download.nvidia.cn/compute/cuda/repos/ubuntu2004/x86_64/3bf863cc.pub##g" ${dockerfile_name}
dockerfile_line=$(wc -l ${dockerfile_name}|awk '{print $1}')
sed -i 's#RUN bash /build_scripts/install_trt.sh##g' ${dockerfile_name}
sed -i "${dockerfile_line}i RUN wget --no-check-certificate -q https://paddle-edl.bj.bcebos.com/hadoop-2.7.7.tar.gz \&\& \
tar -xzf hadoop-2.7.7.tar.gz && mv hadoop-2.7.7 /usr/local/" ${dockerfile_name}
sed -i "${dockerfile_line}i RUN apt remove git -y \&\& apt update \&\& apt install -y libsndfile1 zstd pigz ninja-build" ${dockerfile_name}
sed -i "${dockerfile_line}i RUN pip install wheel PyGithub distro" ${dockerfile_name}
sed -i "${dockerfile_line}i RUN apt remove git -y \&\& apt update \&\& apt install -y libcurl4-openssl-dev gettext pigz \&\& wget -q https://paddle-ci.gz.bcebos.com/git-2.17.1.tar.gz \&\& \
tar -xvf git-2.17.1.tar.gz \&\& \
cd git-2.17.1 \&\& \
./configure --with-openssl --with-curl --prefix=/usr/local \&\& \
make -j8 \&\& make install " ${dockerfile_name}
sed -i 's#<install_cpu_package>#RUN apt-get install -y gcc g++ make#g' ${dockerfile_name}
sed -i 's#RUN bash /build_scripts/install_gcc.sh gcc82#RUN add-apt-repository ppa:ubuntu-toolchain-r/test \&\& apt-get update \&\& apt-get install -y gcc-13 g++-13#g' ${dockerfile_name}
sed -i 's#/usr/local/gcc-8.2/bin/gcc#/usr/bin/gcc-13#g' ${dockerfile_name}
sed -i 's#/usr/local/gcc-8.2/bin/g++#/usr/bin/g++-13#g' ${dockerfile_name}
sed -i 's#ENV PATH=/usr/local/gcc-8.2/bin:$PATH##g' ${dockerfile_name}
}
function make_sot_dockerfile(){
dockerfile_name="Dockerfile.gcc133_ubuntu24_cpu_sot"
sed "s#<baseimg>#ubuntu:24.04#g" ./Dockerfile.ubuntu24 >${dockerfile_name}
sed -i "s#<setcuda>##g" ${dockerfile_name}
sed -i "s#WITH_GPU:-ON#WITH_GPU:-OFF#g" ${dockerfile_name}
sed -i "/\/etc\/apt\/sources.list.d\/cuda/ d" ${dockerfile_name}
sed -i '/RUN curl https:\/\/developer.download.nvidia.cn/ d' ${dockerfile_name}
sed -i "s#RUN apt-key adv --fetch-keys https://developer.download.nvidia.cn/compute/cuda/repos/ubuntu2404/x86_64/3bf863cc.pub##g" ${dockerfile_name}
dockerfile_line=$(wc -l ${dockerfile_name}|awk '{print $1}')
sed -i 's#RUN bash /build_scripts/install_trt.sh##g' ${dockerfile_name}
sed -i "${dockerfile_line}i RUN pip install wheel PyGithub distro" ${dockerfile_name}
sed -i 's#<install_cpu_package>#RUN apt-get install -y gcc g++ make libcurl4-openssl-dev gettext ninja-build#g' ${dockerfile_name}
}
function make_ce_framework_dockerfile(){
dockerfile_name="Dockerfile.cuda11.2_cudnn8_gcc82_trt8"
sed "s#<baseimg>#nvidia/cuda:11.8.0-cudnn8-devel-ubuntu20.04#g" ./Dockerfile.ubuntu20 >${dockerfile_name}
dockerfile_line=$(wc -l ${dockerfile_name}|awk '{print $1}')
sed -i "s#<setcuda>#ENV LD_LIBRARY_PATH=/usr/local/cuda-11.8/targets/x86_64-linux/lib:\$LD_LIBRARY_PATH #g" ${dockerfile_name}
sed -i 's#<install_cpu_package>##g' ${dockerfile_name}
sed -i "7i RUN chmod 777 /tmp" ${dockerfile_name}
sed -i "${dockerfile_line}i RUN wget --no-check-certificate -q https://paddle-edl.bj.bcebos.com/hadoop-2.7.7.tar.gz \&\& \
tar -xzf hadoop-2.7.7.tar.gz && mv hadoop-2.7.7 /usr/local/" ${dockerfile_name}
sed -i "${dockerfile_line}i RUN apt-get update && apt install -y zstd pigz libcurl4-openssl-dev gettext ninja-build" ${dockerfile_name}
sed -i "${dockerfile_line}i RUN pip3.10 install wheel distro jinja2 bce-python-sdk==0.8.74" ${dockerfile_name}
sed -i "${dockerfile_line}i RUN pip3.10 install nvidia-cuda-cupti-cu11==11.8.87 nvidia-cuda-runtime-cu11==11.8.89 nvidia-cudnn-cu11==8.7.0.84 nvidia-cublas-cu11==11.11.3.6 nvidia-cufft-cu11==10.9.0.58 nvidia-curand-cu11==10.3.0.86 nvidia-cusolver-cu11==11.4.1.48 nvidia-cusparse-cu11==11.7.5.86 nvidia-nccl-cu11==2.19.3" ${dockerfile_name}
sed -i 's#RUN bash /build_scripts/install_trt.sh#RUN bash /build_scripts/install_trt.sh trt8531#g' ${dockerfile_name}
}
function make_ubuntu20_cu12_dockerfile(){
dockerfile_name="Dockerfile.cuda117_cudnn8_gcc82_ubuntu18_coverage"
sed "s#<baseimg>#nvidia/cuda:12.0.1-cudnn8-devel-ubuntu22.04#g" ./Dockerfile.ubuntu22 >${dockerfile_name}
sed -i "s#<setcuda>#ENV LD_LIBRARY_PATH=/usr/local/cuda-12.0/targets/x86_64-linux/lib:\$LD_LIBRARY_PATH #g" ${dockerfile_name}
sed -i 's#<install_cpu_package>##g' ${dockerfile_name}
sed -i "7i ENV TZ=Asia/Beijing" ${dockerfile_name}
sed -i "8i RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone" ${dockerfile_name}
sed -i "27i RUN apt-get update && apt-get install -y liblzma-dev openmpi-bin openmpi-doc libopenmpi-dev libsndfile1" ${dockerfile_name}
dockerfile_line=$(wc -l ${dockerfile_name}|awk '{print $1}')
sed -i "${dockerfile_line}i RUN wget --no-check-certificate -q https://paddle-edl.bj.bcebos.com/hadoop-2.7.7.tar.gz \&\& \
tar -xzf hadoop-2.7.7.tar.gz && mv hadoop-2.7.7 /usr/local/" ${dockerfile_name}
sed -i "${dockerfile_line}i RUN apt remove git -y \&\& apt update \&\& apt install -y libcurl4-openssl-dev gettext pigz zstd ninja-build \&\& wget -q https://paddle-ci.gz.bcebos.com/git-2.17.1.tar.gz \&\& \
tar -xvf git-2.17.1.tar.gz \&\& \
cd git-2.17.1 \&\& \
./configure --with-openssl --with-curl --prefix=/usr/local \&\& \
make -j8 \&\& make install " ${dockerfile_name}
sed -i "${dockerfile_line}i RUN pip install wheel \&\& pip3.12 install PyGithub wheel distro jinja2" ${dockerfile_name}
sed -i 's# && rm /etc/apt/sources.list.d/nvidia-ml.list##g' ${dockerfile_name}
sed -i 's#RUN bash /build_scripts/install_trt.sh##g' ${dockerfile_name}
sed -i 's#<install_cudnn>#RUN bash /build_scripts/install_cudnn.sh cudnn896 #g' ${dockerfile_name}
}
function make_ubuntu20_cu123_dockerfile(){
dockerfile_name="Dockerfile.cuda123_cudnn9_gcc122_ubuntu20"
sed "s#<baseimg>#nvidia/cuda:12.3.1-devel-ubuntu20.04#g" ./Dockerfile.ubuntu20 >${dockerfile_name}
sed -i "s#<setcuda>#ENV LD_LIBRARY_PATH=/usr/local/cuda-12.3/targets/x86_64-linux/lib:\$LD_LIBRARY_PATH #g" ${dockerfile_name}
sed -i 's#<install_cpu_package>##g' ${dockerfile_name}
sed -i "7i ENV TZ=Asia/Beijing" ${dockerfile_name}
sed -i "8i RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone" ${dockerfile_name}
sed -i "27i RUN apt-get update && apt-get install -y liblzma-dev openmpi-bin openmpi-doc libopenmpi-dev libsndfile1" ${dockerfile_name}
dockerfile_line=$(wc -l ${dockerfile_name}|awk '{print $1}')
sed -i "${dockerfile_line}i RUN wget --no-check-certificate -q https://paddle-edl.bj.bcebos.com/hadoop-2.7.7.tar.gz \&\& \
tar -xzf hadoop-2.7.7.tar.gz && mv hadoop-2.7.7 /usr/local/" ${dockerfile_name}
sed -i "${dockerfile_line}i RUN apt remove git -y \&\& apt update \&\& apt install -y libcurl4-openssl-dev gettext pigz zstd ninja-build \&\& wget -q https://paddle-ci.gz.bcebos.com/git-2.17.1.tar.gz \&\& \
tar -xvf git-2.17.1.tar.gz \&\& \
cd git-2.17.1 \&\& \
./configure --with-openssl --with-curl --prefix=/usr/local \&\& \
make -j8 \&\& make install " ${dockerfile_name}
sed -i "${dockerfile_line}i RUN pip install wheel \&\& pip3 install PyGithub wheel distro" ${dockerfile_name}
sed -i 's# && rm /etc/apt/sources.list.d/nvidia-ml.list##g' ${dockerfile_name}
sed -i 's#RUN bash /build_scripts/install_trt.sh#RUN bash /build_scripts/install_trt.sh trt8616#g' ${dockerfile_name}
sed -i 's#RUN bash /build_scripts/install_cudnn.sh cudnn841#RUN bash /build_scripts/install_cudnn.sh cudnn900 #g' ${dockerfile_name}
sed -i 's#CUDNN_VERSION=8.4.1#CUDNN_VERSION=9.0.0#g' ${dockerfile_name}
sed -i 's#gcc82#gcc121#g' ${dockerfile_name}
sed -i 's#/usr/local/gcc-8.2/bin/gcc#/usr/local/gcc-12.1/bin/gcc#g' ${dockerfile_name}
sed -i 's#/usr/local/gcc-8.2/bin/gcc#/usr/local/gcc-12.1/bin/gcc#g' ${dockerfile_name}
sed -i 's#/usr/local/gcc-8.2/bin/g++#/usr/local/gcc-12.1/bin/g++#g' ${dockerfile_name}
sed -i 's#/usr/local/gcc-8.2/bin/g++#/usr/local/gcc-12.1/bin/g++#g' ${dockerfile_name}
sed -i 's#PATH=/usr/local/gcc-8.2/bin:$PATH#PATH=/usr/local/gcc-12.1/bin:$PATH#g' ${dockerfile_name}
}
function main() {
make_cpu_dockerfile
make_sot_dockerfile
make_ce_framework_dockerfile
make_ubuntu20_cu12_dockerfile
make_ubuntu20_cu123_dockerfile
}
main "$@"
+138
View File
@@ -0,0 +1,138 @@
ARG CUDA_VERSION=11.8
ARG BASE_TARGET=cuda${CUDA_VERSION}
FROM amd64/almalinux:8 as base
ENV LC_ALL en_US.UTF-8
ENV LANG en_US.UTF-8
ENV LANGUAGE en_US.UTF-8
ARG DEVTOOLSET_VERSION=11
ENV LC_ALL en_US.UTF-8
ENV LANG en_US.UTF-8
ENV LANGUAGE en_US.UTF-8
RUN yum -y update
RUN yum -y install epel-release
RUN yum install -y \
sudo wget curl perl util-linux xz bzip2 git patch which zlib-devel openssl-devel \
yum-utils autoconf automake make gcc-toolset-${DEVTOOLSET_VERSION}-toolchain \
unzip bison diffutils file vim libffi-devel ncurses-devel sqlite-devel \
readline-devel tk-devel gdbm-devel glibc-devel libstdc++-devel glib2-devel \
libX11-devel libXext-devel libXrender-devel mesa-libGL-devel libICE-devel \
libSM-devel freetype-devel libpng-devel kernel-devel kmod \
rdma-core-devel libibverbs-devel
# Just add everything as a safe.directory for git since these will be used in multiple places with git
RUN git config --global --add safe.directory '*'
RUN ln -s /opt/rh/gcc-toolset-${DEVTOOLSET_VERSION}/root/usr/lib/gcc/x86_64-redhat-linux/${DEVTOOLSET_VERSION} /usr/lib/gcc/x86_64-redhat-linux/${DEVTOOLSET_VERSION}
ENV PATH=/opt/rh/gcc-toolset-${DEVTOOLSET_VERSION}/root/usr/bin:$PATH
# cmake-3.31.0
WORKDIR /home
RUN wget -q https://cmake.org/files/v3.31/cmake-3.31.0-linux-x86_64.tar.gz && tar -zxvf cmake-3.31.0-linux-x86_64.tar.gz && rm cmake-3.31.0-linux-x86_64.tar.gz
ENV PATH=/home/cmake-3.31.0-linux-x86_64/bin:$PATH
# go-1.15.12
WORKDIR /home
RUN wget --no-check-certificate -qO- https://paddle-ci.gz.bcebos.com/go1.15.12.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
ENV PATH=/usr/local/ssl:${GOROOT}/bin:${GOPATH}/bin:${PATH}
FROM base as python
# Install python
ADD ./common/install_python.sh install_python.sh
RUN bash ./install_python.sh && rm install_python.sh
FROM base as openssl
# Install openssl
ADD ./common/install_openssl.sh install_openssl.sh
RUN bash ./install_openssl.sh && rm install_openssl.sh
FROM base as patchelf
# Install patchelf
ADD ./common/install_patchelf.sh install_patchelf.sh
RUN bash ./install_patchelf.sh && rm install_patchelf.sh
FROM base as ccache
# Install ccache
ADD ./common/install_ccache.sh install_ccache.sh
RUN bash ./install_ccache.sh && rm install_ccache.sh
# Install CUDA
FROM base as cuda
ARG CUDA_VERSION
RUN rm -rf /usr/local/cuda-*
ENV CUDA_HOME=/usr/local/cuda-${CUDA_VERSION}
ENV CUDA_VERSION=${CUDA_VERSION}
ENV PATH=/usr/local/cuda-${CUDA_VERSION}/bin:$PATH
ENV LD_LIBRARY_PATH=/usr/local/cuda-${CUDA_VERSION}/compat:$LD_LIBRARY_PATH
ADD ./common/install_cuda.sh install_cuda.sh
ADD ./common/install_gdrcopy.sh install_gdrcopy.sh
FROM cuda as cuda11.8
RUN bash ./install_cuda.sh 11.8
ENV DESIRED_CUDA=11.8
FROM cuda as cuda12.3
RUN bash ./install_cuda.sh 12.3
ENV DESIRED_CUDA=12.3
FROM cuda as cuda12.4
RUN bash ./install_cuda.sh 12.4
ENV DESIRED_CUDA=12.4
FROM cuda as cuda12.6
RUN bash ./install_cuda.sh 12.6
ENV DESIRED_CUDA=12.6
FROM cuda as cuda12.9
RUN bash ./install_cuda.sh 12.9 && bash ./install_gdrcopy.sh
ENV DESIRED_CUDA=12.9
ENV GDRCOPY_HOME=/usr/local/gdrcopy
FROM cuda as cuda13.0
RUN bash ./install_cuda.sh 13.0 && bash ./install_gdrcopy.sh
ENV DESIRED_CUDA=13.0
ENV GDRCOPY_HOME=/usr/local/gdrcopy
FROM cuda as cuda13.2
RUN bash ./install_cuda.sh 13.2 && bash ./install_gdrcopy.sh
ENV DESIRED_CUDA=13.2
ENV GDRCOPY_HOME=/usr/local/gdrcopy
# Install paddle
FROM python as paddle
RUN wget https://raw.githubusercontent.com/PaddlePaddle/Paddle/develop/python/requirements.txt -O /root/requirements.txt
RUN LD_LIBRARY_PATH=/opt/_internal/cpython-3.10.0/lib/:${LD_LIBRARY_PATH} /opt/_internal/cpython-3.10.0/bin/pip3 install setuptools pyyaml wheel -U && \
LD_LIBRARY_PATH=/opt/_internal/cpython-3.11.0/lib/:${LD_LIBRARY_PATH} /opt/_internal/cpython-3.11.0/bin/pip3 install setuptools pyyaml wheel -U && \
LD_LIBRARY_PATH=/opt/_internal/cpython-3.12.0/lib/:${LD_LIBRARY_PATH} /opt/_internal/cpython-3.12.0/bin/pip3 install setuptools pyyaml wheel -U && \
LD_LIBRARY_PATH=/opt/_internal/cpython-3.13.0/lib/:${LD_LIBRARY_PATH} /opt/_internal/cpython-3.13.0/bin/pip3 install setuptools pyyaml wheel -U && \
LD_LIBRARY_PATH=/opt/_internal/cpython-3.14.0/lib/:${LD_LIBRARY_PATH} /opt/_internal/cpython-3.14.0/bin/pip3 install setuptools pyyaml wheel -U
RUN LD_LIBRARY_PATH=/opt/_internal/cpython-3.10.0/lib/:${LD_LIBRARY_PATH} /opt/_internal/cpython-3.10.0/bin/pip3 install -r /root/requirements.txt && \
LD_LIBRARY_PATH=/opt/_internal/cpython-3.11.0/lib/:${LD_LIBRARY_PATH} /opt/_internal/cpython-3.11.0/bin/pip3 install -r /root/requirements.txt && \
LD_LIBRARY_PATH=/opt/_internal/cpython-3.12.0/lib/:${LD_LIBRARY_PATH} /opt/_internal/cpython-3.12.0/bin/pip3 install -r /root/requirements.txt && \
LD_LIBRARY_PATH=/opt/_internal/cpython-3.13.0/lib/:${LD_LIBRARY_PATH} /opt/_internal/cpython-3.13.0/bin/pip3 install -r /root/requirements.txt && \
LD_LIBRARY_PATH=/opt/_internal/cpython-3.14.0/lib/:${LD_LIBRARY_PATH} /opt/_internal/cpython-3.14.0/bin/pip3 install -r /root/requirements.txt
RUN go get github.com/Masterminds/glide
RUN rm -rf /root/requirements.txt
ENV LD_LIBRARY_PATH=/opt/rh/gcc-toolset-${DEVTOOLSET_VERSION}/root/usr/lib64:/opt/rh/gcc-toolset-${DEVTOOLSET_VERSION}/root/usr/lib:$LD_LIBRARY_PATH
RUN rm -rf /usr/local/cuda
RUN chmod o+rw /usr/local
# Final step
FROM ${BASE_TARGET} as final
COPY --from=openssl /usr/local/ssl /usr/local/ssl
COPY --from=patchelf /usr/local/bin/patchelf /usr/local/bin/patchelf
COPY --from=ccache /usr/local/bin/ccache /usr/local/bin/ccache
COPY --from=paddle /opt/_internal /opt/_internal
+68
View File
@@ -0,0 +1,68 @@
# 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
ARG CUDA_VERSION=11.8
ARG CUDA_PADDLE=cu118
ARG BASE_TARGET=cuda${CUDA_VERSION}
FROM nvidia/cuda:11.8.0-cudnn8-devel-ubuntu22.04 as base
MAINTAINER PaddlePaddle Authors <paddle-dev@baidu.com>
# ENV variables
ARG WITH_GPU
ARG WITH_AVX
ARG PYTHON_VERSION=3.10
ENV WITH_GPU=${WITH_GPU:-ON}
ENV WITH_AVX=${WITH_AVX:-ON}
ENV DEBIAN_FRONTEND=noninteractive
ENV LD_LIBRARY_PATH=/usr/local/cuda-${CUDA_VERSION}/compat:/usr/local/cuda-${CUDA_VERSION}/targets/x86_64-linux/lib:$LD_LIBRARY_PATH
ENV HOME /root
RUN apt-get update --allow-unauthenticated && \
apt-get install -y --no-install-recommends \
git \
vim \
curl \
wget \
make \
libssl-dev \
autoconf \
automake \
libtool \
python${PYTHON_VERSION} \
python${PYTHON_VERSION}-dev \
python3-pip && \
ln -sf /usr/bin/python3 /usr/bin/python && \
rm -rf /var/lib/apt/lists/*
WORKDIR /home
RUN wget -q https://cmake.org/files/v3.31/cmake-3.31.0-linux-x86_64.tar.gz && \
tar -zxf cmake-3.31.0-linux-x86_64.tar.gz && \
rm cmake-3.31.0-linux-x86_64.tar.gz && \
rm -rf /home/cmake-3.31.0-linux-x86_64/doc /home/cmake-3.31.0-linux-x86_64/man
ENV PATH=/home/cmake-3.31.0-linux-x86_64/bin:$PATH
ARG TMP_DIR=patchelf_tmp
RUN rm -rf "$TMP_DIR" && git clone -b 0.15.0 https://github.com/NixOS/patchelf "$TMP_DIR" && \
cd "$TMP_DIR" && ./bootstrap.sh && \
./configure && make && make install && \
cd .. && rm -rf "$TMP_DIR"
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 && rm -rf ccache-4.8.2
COPY paddle/scripts/compile_requirements.txt /root
COPY python/requirements.txt /root
RUN pip install -r /root/requirements.txt && \
pip install -r /root/compile_requirements.txt && \
rm -rf /root/compile_requirements.txt /root/requirements.txt
+70
View File
@@ -0,0 +1,70 @@
# 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
ARG CUDA_VERSION=12.6
ARG CUDA_PADDLE=126
ARG BASE_TARGET=cuda${CUDA_VERSION}
FROM nvidia/cuda:12.6.3-cudnn-devel-ubuntu22.04 as base
MAINTAINER PaddlePaddle Authors <paddle-dev@baidu.com>
# ENV variables
ARG WITH_GPU
ARG WITH_AVX
ARG PYTHON_VERSION=3.10
ENV WITH_GPU=${WITH_GPU:-ON}
ENV WITH_AVX=${WITH_AVX:-ON}
ENV DEBIAN_FRONTEND=noninteractive
ENV LD_LIBRARY_PATH=/usr/local/cuda-${CUDA_VERSION}/compat:/usr/local/cuda-${CUDA_VERSION}/targets/x86_64-linux/lib:$LD_LIBRARY_PATH
ENV HOME /root
RUN apt-get update --allow-unauthenticated && \
apt-get install -y --no-install-recommends \
git \
vim \
curl \
wget \
make \
libssl-dev \
autoconf \
automake \
libtool \
libmlx5-1 \
libibverbs-dev \
python${PYTHON_VERSION} \
python${PYTHON_VERSION}-dev \
python3-pip && \
ln -sf /usr/bin/python3 /usr/bin/python && \
rm -rf /var/lib/apt/lists/*
WORKDIR /home
RUN wget -q https://cmake.org/files/v3.31/cmake-3.31.0-linux-x86_64.tar.gz && \
tar -zxf cmake-3.31.0-linux-x86_64.tar.gz && \
rm cmake-3.31.0-linux-x86_64.tar.gz && \
rm -rf /home/cmake-3.31.0-linux-x86_64/doc /home/cmake-3.31.0-linux-x86_64/man
ENV PATH=/home/cmake-3.31.0-linux-x86_64/bin:$PATH
ARG TMP_DIR=patchelf_tmp
RUN rm -rf "$TMP_DIR" && git clone -b 0.15.0 https://github.com/NixOS/patchelf "$TMP_DIR" && \
cd "$TMP_DIR" && ./bootstrap.sh && \
./configure && make && make install && \
cd .. && rm -rf "$TMP_DIR"
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 && rm -rf ccache-4.8.2
COPY paddle/scripts/compile_requirements.txt /root
COPY python/requirements.txt /root
RUN pip install -r /root/requirements.txt && \
pip install -r /root/compile_requirements.txt && \
rm -rf /root/compile_requirements.txt /root/requirements.txt
+71
View File
@@ -0,0 +1,71 @@
# 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
ARG CUDA_VERSION=12.9
ARG BASE_TARGET=cuda${CUDA_VERSION}
FROM nvidia/cuda:12.9.0-cudnn-devel-ubuntu22.04 as base
MAINTAINER PaddlePaddle Authors <paddle-dev@baidu.com>
# ENV variables
ARG WITH_GPU
ARG WITH_AVX
ARG PYTHON_VERSION=3.10
ENV WITH_GPU=${WITH_GPU:-ON}
ENV WITH_AVX=${WITH_AVX:-ON}
ENV DEBIAN_FRONTEND=noninteractive
ENV LD_LIBRARY_PATH=/usr/local/cuda-${CUDA_VERSION}/compat:/usr/local/cuda-${CUDA_VERSION}/targets/x86_64-linux/lib:$LD_LIBRARY_PATH
ENV HOME /root
RUN apt-get update --allow-unauthenticated && \
apt-get install -y --no-install-recommends \
git \
vim \
curl \
wget \
make \
libgl1 \
libglib2.0-0 \
libssl-dev \
autoconf \
automake \
libtool \
libmlx5-1 \
libibverbs-dev \
python${PYTHON_VERSION} \
python${PYTHON_VERSION}-dev \
python3-pip && \
ln -sf /usr/bin/python3 /usr/bin/python && \
rm -rf /var/lib/apt/lists/*
WORKDIR /home
RUN wget -q https://cmake.org/files/v3.31/cmake-3.31.0-linux-x86_64.tar.gz && \
tar -zxf cmake-3.31.0-linux-x86_64.tar.gz && \
rm cmake-3.31.0-linux-x86_64.tar.gz && \
rm -rf /home/cmake-3.31.0-linux-x86_64/doc /home/cmake-3.31.0-linux-x86_64/man
ENV PATH=/home/cmake-3.31.0-linux-x86_64/bin:$PATH
ARG TMP_DIR=patchelf_tmp
RUN rm -rf "$TMP_DIR" && git clone -b 0.15.0 https://github.com/NixOS/patchelf "$TMP_DIR" && \
cd "$TMP_DIR" && ./bootstrap.sh && \
./configure && make && make install && \
cd .. && rm -rf "$TMP_DIR"
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 && rm -rf ccache-4.8.2
COPY paddle/scripts/compile_requirements.txt /root
COPY python/requirements.txt /root
RUN pip install -r /root/requirements.txt && \
pip install -r /root/compile_requirements.txt && \
rm -rf /root/compile_requirements.txt /root/requirements.txt
+71
View File
@@ -0,0 +1,71 @@
# 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
ARG CUDA_VERSION=13.0
ARG BASE_TARGET=cuda${CUDA_VERSION}
FROM nvcr.io/nvidia/cuda:13.0.1-cudnn-devel-ubuntu22.04 as base
MAINTAINER PaddlePaddle Authors <paddle-dev@baidu.com>
# ENV variables
ARG WITH_GPU
ARG WITH_AVX
ARG PYTHON_VERSION=3.10
ENV WITH_GPU=${WITH_GPU:-ON}
ENV WITH_AVX=${WITH_AVX:-ON}
ENV DEBIAN_FRONTEND=noninteractive
ENV LD_LIBRARY_PATH=/usr/local/cuda-${CUDA_VERSION}/compat:/usr/local/cuda-${CUDA_VERSION}/targets/x86_64-linux/lib:$LD_LIBRARY_PATH
ENV HOME /root
RUN apt-get update --allow-unauthenticated && \
apt-get install -y --no-install-recommends \
git \
vim \
curl \
wget \
make \
libgl1 \
libglib2.0-0 \
libssl-dev \
autoconf \
automake \
libtool \
libmlx5-1 \
libibverbs-dev \
python${PYTHON_VERSION} \
python${PYTHON_VERSION}-dev \
python3-pip && \
ln -sf /usr/bin/python3 /usr/bin/python && \
rm -rf /var/lib/apt/lists/*
WORKDIR /home
RUN wget -q https://cmake.org/files/v3.31/cmake-3.31.0-linux-x86_64.tar.gz && \
tar -zxf cmake-3.31.0-linux-x86_64.tar.gz && \
rm cmake-3.31.0-linux-x86_64.tar.gz && \
rm -rf /home/cmake-3.31.0-linux-x86_64/doc /home/cmake-3.31.0-linux-x86_64/man
ENV PATH=/home/cmake-3.31.0-linux-x86_64/bin:$PATH
ARG TMP_DIR=patchelf_tmp
RUN rm -rf "$TMP_DIR" && git clone -b 0.15.0 https://github.com/NixOS/patchelf "$TMP_DIR" && \
cd "$TMP_DIR" && ./bootstrap.sh && \
./configure && make && make install && \
cd .. && rm -rf "$TMP_DIR"
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 && rm -rf ccache-4.8.2
COPY paddle/scripts/compile_requirements.txt /root
COPY python/requirements.txt /root
RUN pip install -r /root/requirements.txt && \
pip install -r /root/compile_requirements.txt && \
rm -rf /root/compile_requirements.txt /root/requirements.txt
+115
View File
@@ -0,0 +1,115 @@
# 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
ARG CUDA_VERSION=13.2
ARG BASE_TARGET=cuda${CUDA_VERSION}
FROM nvcr.io/nvidia/cuda:13.2.0-cudnn-devel-ubuntu24.04 as base
LABEL maintainer="paddle-dev@baidu.com"
# ENV variables
ARG WITH_GPU
ARG WITH_AVX
ARG PYTHON_VERSION=3.12
ARG PYTHON_SOURCE_VERSION=3.12.13
ARG TMP_DIR=patchelf_tmp
ENV WITH_GPU=${WITH_GPU:-ON}
ENV WITH_AVX=${WITH_AVX:-ON}
ENV DEBIAN_FRONTEND=noninteractive
ENV GDRCOPY_HOME=/usr/local/gdrcopy
ENV HOME /root
RUN apt-get update --allow-unauthenticated && \
apt-get install -y --no-install-recommends \
git \
vim \
curl \
wget \
make \
zstd \
rsync \
ca-certificates \
build-essential \
libgl1 \
libglib2.0-0 \
libssl-dev \
autoconf \
automake \
libtool \
libmlx5-1 \
libibverbs-dev \
pkg-config \
zlib1g-dev \
libbz2-dev \
libreadline-dev \
libsqlite3-dev \
libncursesw5-dev \
libffi-dev \
libgdbm-dev \
libgdbm-compat-dev \
liblzma-dev \
libexpat1-dev \
tk-dev \
uuid-dev \
xz-utils \
ccache \
libnccl2=2.29.7-1+cuda13.2 \
libnccl-dev=2.29.7-1+cuda13.2 && \
rm -rf /var/lib/apt/lists/*
RUN cd /tmp && \
wget -q https://www.python.org/ftp/python/${PYTHON_SOURCE_VERSION}/Python-${PYTHON_SOURCE_VERSION}.tar.xz && \
tar -xf Python-${PYTHON_SOURCE_VERSION}.tar.xz && \
cd Python-${PYTHON_SOURCE_VERSION} && \
./configure \
--prefix=/usr/local \
--enable-optimizations \
--with-ensurepip=install && \
make -j"$(nproc)" && \
make altinstall && \
ln -sf /usr/local/bin/python${PYTHON_VERSION} /usr/local/bin/python3 && \
ln -sf /usr/local/bin/python3 /usr/local/bin/python && \
ln -sf /usr/local/bin/pip${PYTHON_VERSION} /usr/local/bin/pip3 && \
ln -sf /usr/local/bin/pip3 /usr/local/bin/pip && \
python3 -m pip install --no-cache-dir --upgrade pip setuptools wheel packaging && \
cd / && \
rm -rf /tmp/Python-${PYTHON_SOURCE_VERSION} /tmp/Python-${PYTHON_SOURCE_VERSION}.tar.xz
WORKDIR /home
RUN set -eux; \
if [ "${TARGETARCH:-}" = "amd64" ] || [ "$(uname -m)" = "x86_64" ]; then \
CMAKE_ARCH="x86_64"; \
elif [ "${TARGETARCH:-}" = "arm64" ] || [ "$(uname -m)" = "aarch64" ]; then \
CMAKE_ARCH="aarch64"; \
else \
echo "Unsupported architecture: TARGETARCH=${TARGETARCH:-unknown}, uname -m=$(uname -m)"; \
exit 1; \
fi; \
CMAKE_PKG="cmake-3.31.0-linux-${CMAKE_ARCH}.tar.gz"; \
wget -q "https://cmake.org/files/v3.31/${CMAKE_PKG}"; \
tar -zxf "${CMAKE_PKG}"; \
rm "${CMAKE_PKG}"; \
mv "/home/cmake-3.31.0-linux-${CMAKE_ARCH}" /home/cmake-3.31.0; \
rm -rf /home/cmake-3.31.0/doc /home/cmake-3.31.0/man
ENV PATH=/home/cmake-3.31.0/bin:$PATH
RUN rm -rf "$TMP_DIR" && git clone --depth 1 --branch 0.15.0 https://github.com/NixOS/patchelf "$TMP_DIR" && \
cd "$TMP_DIR" && ./bootstrap.sh && \
./configure && make && make install && \
cd .. && rm -rf "$TMP_DIR"
COPY paddle/scripts/compile_requirements.txt /root
COPY python/requirements.txt /root
RUN pip config set global.break-system-packages true && \
pip install -r /root/requirements.txt && \
pip install -r /root/compile_requirements.txt && \
rm -rf /root/compile_requirements.txt /root/requirements.txt
RUN cd /usr/local && \
wget -q https://paddle-ci.gz.bcebos.com/gdrcopy.tar && \
tar xf gdrcopy.tar && \
rm -f gdrcopy.tar
@@ -0,0 +1,21 @@
# Copyright (c) 2025 PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
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
@@ -0,0 +1,530 @@
#!/bin/bash
# Copyright (c) 2025 PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
set -ex
NCCL_VERSION=v2.21.5-1
CUDNN_VERSION=9.5.1.17
function install_cusparselt_040 {
# cuSparseLt license: https://docs.nvidia.com/cuda/cusparselt/license.html
mkdir tmp_cusparselt && pushd tmp_cusparselt
wget -q https://developer.download.nvidia.com/compute/cusparselt/redist/libcusparse_lt/linux-x86_64/libcusparse_lt-linux-x86_64-0.4.0.7-archive.tar.xz
tar xf libcusparse_lt-linux-x86_64-0.4.0.7-archive.tar.xz
cp -a libcusparse_lt-linux-x86_64-0.4.0.7-archive/include/* /usr/local/cuda/include/
cp -a libcusparse_lt-linux-x86_64-0.4.0.7-archive/lib/* /usr/local/cuda/lib64/
popd
rm -rf tmp_cusparselt
}
function install_cusparselt_052 {
# cuSparseLt license: https://docs.nvidia.com/cuda/cusparselt/license.html
mkdir tmp_cusparselt && pushd tmp_cusparselt
wget -q https://developer.download.nvidia.com/compute/cusparselt/redist/libcusparse_lt/linux-x86_64/libcusparse_lt-linux-x86_64-0.5.2.1-archive.tar.xz
tar xf libcusparse_lt-linux-x86_64-0.5.2.1-archive.tar.xz
cp -a libcusparse_lt-linux-x86_64-0.5.2.1-archive/include/* /usr/local/cuda/include/
cp -a libcusparse_lt-linux-x86_64-0.5.2.1-archive/lib/* /usr/local/cuda/lib64/
popd
rm -rf tmp_cusparselt
}
function install_cusparselt_062 {
# cuSparseLt license: https://docs.nvidia.com/cuda/cusparselt/license.html
mkdir tmp_cusparselt && pushd tmp_cusparselt
wget -q https://developer.download.nvidia.com/compute/cusparselt/redist/libcusparse_lt/linux-x86_64/libcusparse_lt-linux-x86_64-0.6.2.3-archive.tar.xz
tar xf libcusparse_lt-linux-x86_64-0.6.2.3-archive.tar.xz
cp -a libcusparse_lt-linux-x86_64-0.6.2.3-archive/include/* /usr/local/cuda/include/
cp -a libcusparse_lt-linux-x86_64-0.6.2.3-archive/lib/* /usr/local/cuda/lib64/
popd
rm -rf tmp_cusparselt
}
function install_cusparselt_063 {
# cuSparseLt license: https://docs.nvidia.com/cuda/cusparselt/license.html
mkdir tmp_cusparselt && pushd tmp_cusparselt
wget -q https://developer.download.nvidia.com/compute/cusparselt/redist/libcusparse_lt/linux-x86_64/libcusparse_lt-linux-x86_64-0.6.3.2-archive.tar.xz
tar xf libcusparse_lt-linux-x86_64-0.6.3.2-archive.tar.xz
cp -a libcusparse_lt-linux-x86_64-0.6.3.2-archive/include/* /usr/local/cuda/include/
cp -a libcusparse_lt-linux-x86_64-0.6.3.2-archive/lib/* /usr/local/cuda/lib64/
popd
rm -rf tmp_cusparselt
}
function install_cusparselt_090_cuda13 {
# cuSparseLt license: https://docs.nvidia.com/cuda/cusparselt/license.html
mkdir tmp_cusparselt && pushd tmp_cusparselt
wget -q https://developer.download.nvidia.com/compute/cusparselt/redist/libcusparse_lt/linux-x86_64/libcusparse_lt-linux-x86_64-0.9.0.3_cuda13-archive.tar.xz
tar xf libcusparse_lt-linux-x86_64-0.9.0.3_cuda13-archive.tar.xz
cp -a libcusparse_lt-linux-x86_64-0.9.0.3_cuda13-archive/include/* /usr/local/cuda/include/
cp -a libcusparse_lt-linux-x86_64-0.9.0.3_cuda13-archive/lib/* /usr/local/cuda/lib64/
popd
rm -rf tmp_cusparselt
}
function install_cusparselt_081 {
# cuSparseLt license: https://docs.nvidia.com/cuda/cusparselt/license.html
mkdir tmp_cusparselt && pushd tmp_cusparselt
wget -q https://developer.download.nvidia.com/compute/cusparselt/redist/libcusparse_lt/linux-x86_64/libcusparse_lt-linux-x86_64-0.8.1.1_cuda13-archive.tar.xz
tar xf libcusparse_lt-linux-x86_64-0.8.1.1_cuda13-archive.tar.xz
cp -a libcusparse_lt-linux-x86_64-0.8.1.1_cuda13-archive/include/* /usr/local/cuda/include/
cp -a libcusparse_lt-linux-x86_64-0.8.1.1_cuda13-archive/lib/* /usr/local/cuda/lib64/
popd
rm -rf tmp_cusparselt
}
function install_nccl_2162 {
wget -q https://nccl2-deb.cdn.bcebos.com/nccl_2.16.2-1+cuda11.8_x86_64.txz --no-check-certificate --no-proxy
tar xf nccl_2.16.2-1+cuda11.8_x86_64.txz
cp -a nccl_2.16.2-1+cuda11.8_x86_64/include/* /usr/include/
cp -a nccl_2.16.2-1+cuda11.8_x86_64/lib/* /usr/lib64
rm -rf nccl_2.16.2-1+cuda11.8_x86_64 nccl_2.16.2-1+cuda11.8_x86_64.txz
}
function install_nccl_2203 {
wget -q https://nccl2-deb.cdn.bcebos.com/nccl_2.20.3-1+cuda12.3_x86_64.txz --no-check-certificate --no-proxy
tar xf nccl_2.20.3-1+cuda12.3_x86_64.txz
cp -a nccl_2.20.3-1+cuda12.3_x86_64/include/* /usr/include/
cp -a nccl_2.20.3-1+cuda12.3_x86_64/lib/* /usr/lib64
rm -rf nccl_2.20.3-1+cuda12.3_x86_64 nccl_2.20.3-1+cuda12.3_x86_64.txz
}
function install_nccl_2215 {
wget -q https://nccl2-deb.cdn.bcebos.com/nccl_2.21.5-1+cuda12.4_x86_64.txz --no-check-certificate --no-proxy
tar xf nccl_2.21.5-1+cuda12.4_x86_64.txz
cp -a nccl_2.21.5-1+cuda12.4_x86_64/include/* /usr/include/
cp -a nccl_2.21.5-1+cuda12.4_x86_64/lib/* /usr/lib64
rm -rf nccl_2.21.5-1+cuda12.4_x86_64 nccl_2.21.5-1+cuda12.4_x86_64.txz
}
function install_nccl_2234 {
wget -q https://nccl2-deb.cdn.bcebos.com/nccl_2.23.4-1+cuda12.6_x86_64.txz --no-check-certificate --no-proxy
tar xf nccl_2.23.4-1+cuda12.6_x86_64.txz
cp -a nccl_2.23.4-1+cuda12.6_x86_64/include/* /usr/include/
cp -a nccl_2.23.4-1+cuda12.6_x86_64/lib/* /usr/lib64
rm -rf nccl_2.23.4-1+cuda12.6_x86_64 nccl_2.23.4-1+cuda12.6_x86_64.txz
}
function install_nccl_2297_cuda132 {
yum-config-manager --add-repo https://developer.download.nvidia.com/compute/cuda/repos/rhel8/x86_64/cuda-rhel8.repo
# `install_132` uses toolkit-only installation, so install the official
# forward-compat driver libraries to provide /usr/local/cuda-13.2/compat/libcuda.so.1.
yum install -y \
cuda-compat-13-2 \
libnccl-2.29.7-1+cuda13.2 \
libnccl-devel-2.29.7-1+cuda13.2 \
libnccl-static-2.29.7-1+cuda13.2
}
function install_nccl_2283 {
wget -q https://nccl2-deb.cdn.bcebos.com/nccl_2.28.3-1+cuda13.0_x86_64.txz --no-check-certificate --no-proxy
tar xf nccl_2.28.3-1+cuda13.0_x86_64.txz
cp -a nccl_2.28.3-1+cuda13.0_x86_64/include/* /usr/include/
cp -a nccl_2.28.3-1+cuda13.0_x86_64/lib/* /usr/lib64
rm -rf nccl_2.28.3-1+cuda13.0_x86_64 nccl_2.28.3-1+cuda13.0_x86_64.txz
}
function install_trt_8616 {
wget -q https://paddle-ci.gz.bcebos.com/TRT/TensorRT-8.6.1.6.Linux.x86_64-gnu.cuda-11.8.tar.gz --no-check-certificate --no-proxy
tar -zxf TensorRT-8.6.1.6.Linux.x86_64-gnu.cuda-11.8.tar.gz -C /usr/local
cp -rf /usr/local/TensorRT-8.6.1.6/include/* /usr/include/ && cp -rf /usr/local/TensorRT-8.6.1.6/lib/* /usr/lib/
rm -f TensorRT-8.6.1.6.Linux.x86_64-gnu.cuda-11.8.tar.gz
}
function install_trt_105018 {
wget -q https://paddle-ci.gz.bcebos.com/TRT/TensorRT-10.5.0.18.Linux.x86_64-gnu.cuda-12.6.tar.gz --no-check-certificate --no-proxy
tar -zxf TensorRT-10.5.0.18.Linux.x86_64-gnu.cuda-12.6.tar.gz -C /usr/local
cp -rf /usr/local/TensorRT-10.5.0.18/include/* /usr/include/ && cp -rf /usr/local/TensorRT-10.5.0.18/lib/* /usr/lib/
rm -f TensorRT-10.5.0.18.Linux.x86_64-gnu.cuda-12.6.tar.gz
}
function install_trt_1016111 {
wget -q https://developer.download.nvidia.com/compute/machine-learning/tensorrt/10.16.1/tars/TensorRT-10.16.1.11.Linux.x86_64-gnu.cuda-13.2.tar.gz --no-check-certificate --no-proxy
tar -zxf TensorRT-10.16.1.11.Linux.x86_64-gnu.cuda-13.2.tar.gz -C /usr/local
cp -rf /usr/local/TensorRT-10.16.1.11/include/* /usr/include/ && cp -rf /usr/local/TensorRT-10.16.1.11/lib/* /usr/lib/
rm -f TensorRT-10.16.1.11.Linux.x86_64-gnu.cuda-13.2.tar.gz
}
function install_trt_101339 {
wget -q https://paddle-ci.gz.bcebos.com/TRT/TensorRT-10.13.3.9.Linux.x86_64-gnu.cuda-13.0.tar.gz --no-check-certificate --no-proxy
tar -zxf TensorRT-10.13.3.9.Linux.x86_64-gnu.cuda-13.0.tar.gz -C /usr/local
cp -rf /usr/local/TensorRT-10.13.3.9/include/* /usr/include/ && cp -rf /usr/local/TensorRT-10.13.3.9/lib/* /usr/lib/
rm -f TensorRT-10.13.3.9.Linux.x86_64-gnu.cuda-13.0.tar.gz
}
function install_118 {
CUDNN_VERSION=8.9.7.29
NCCL_VERSION=2.16.5
TensorRT_VERSION=8.6.1.6
echo "Installing CUDA 11.8 and cuDNN ${CUDNN_VERSION} and NCCL ${NCCL_VERSION} and TensorRT ${TensorRT_VERSION} and cuSparseLt-0.4.0"
rm -rf /usr/local/cuda-11.8 /usr/local/cuda
# install CUDA 11.8.0 in the same container
wget -q https://developer.download.nvidia.com/compute/cuda/11.8.0/local_installers/cuda_11.8.0_520.61.05_linux.run
chmod +x cuda_11.8.0_520.61.05_linux.run
./cuda_11.8.0_520.61.05_linux.run --toolkit --driver --silent --no-drm --kernel-source-path=/usr/src/kernels/4.18.0-553.34.1.el8_10.x86_64
rm -f cuda_11.8.0_520.61.05_linux.run
rm -f /usr/local/cuda && ln -s /usr/local/cuda-11.8 /usr/local/cuda
rm -rf /usr/bin/nvidia-smi
# cuDNN license: https://developer.nvidia.com/cudnn/license_agreement
mkdir tmp_cudnn && cd tmp_cudnn
wget -q https://developer.download.nvidia.com/compute/cudnn/redist/cudnn/linux-x86_64/cudnn-linux-x86_64-${CUDNN_VERSION}_cuda11-archive.tar.xz -O cudnn-linux-x86_64-${CUDNN_VERSION}_cuda11-archive.tar.xz
tar xf cudnn-linux-x86_64-${CUDNN_VERSION}_cuda11-archive.tar.xz
cp -a cudnn-linux-x86_64-${CUDNN_VERSION}_cuda11-archive/include/* /usr/local/cuda/include/
cp -a cudnn-linux-x86_64-${CUDNN_VERSION}_cuda11-archive/lib/* /usr/local/cuda/lib64/
cd ..
rm -rf tmp_cudnn
install_nccl_2162
install_trt_8616
install_cusparselt_040
ldconfig
}
function install_123 {
CUDNN_VERSION=9.1.1.17
NCCL_VERSION=2.20.3
TensorRT_VERSION=10.5
echo "Installing CUDA 12.3 and cuDNN ${CUDNN_VERSION} and NCCL ${NCCL_VERSION} and TensorRT ${TensorRT_VERSION} and cuSparseLt-0.5.2"
rm -rf /usr/local/cuda-12.3 /usr/local/cuda
# install CUDA 12.3.0 in the same container
wget -q https://developer.download.nvidia.com/compute/cuda/12.3.2/local_installers/cuda_12.3.2_545.23.08_linux.run
chmod +x cuda_12.3.2_545.23.08_linux.run
./cuda_12.3.2_545.23.08_linux.run --toolkit --driver --silent --kernel-source-path=/usr/src/kernels/4.18.0-553.34.1.el8_10.x86_64
rm -f cuda_12.3.2_545.23.08_linux.run
rm -f /usr/local/cuda && ln -s /usr/local/cuda-12.3 /usr/local/cuda
rm -rf /usr/bin/nvidia-smi
# cuDNN license: https://developer.nvidia.com/cudnn/license_agreement
mkdir tmp_cudnn && cd tmp_cudnn
wget -q https://developer.download.nvidia.com/compute/cudnn/redist/cudnn/linux-x86_64/cudnn-linux-x86_64-${CUDNN_VERSION}_cuda12-archive.tar.xz -O cudnn-linux-x86_64-${CUDNN_VERSION}_cuda12-archive.tar.xz
tar xf cudnn-linux-x86_64-${CUDNN_VERSION}_cuda12-archive.tar.xz
cp -a cudnn-linux-x86_64-${CUDNN_VERSION}_cuda12-archive/include/* /usr/local/cuda/include/
cp -a cudnn-linux-x86_64-${CUDNN_VERSION}_cuda12-archive/lib/* /usr/local/cuda/lib64/
cd ..
rm -rf tmp_cudnn
install_nccl_2203
install_trt_105018
install_cusparselt_052
ldconfig
}
function install_124 {
CUDNN_VERSION=9.1.1.17
NCCL=2.21.5
TensorRT_VERSION=10.5
echo "Installing CUDA 12.4.1 and cuDNN ${CUDNN_VERSION} and NCCL ${NCCL_VERSION} and TensorRT ${TensorRT_VERSION} and cuSparseLt-0.6.2"
rm -rf /usr/local/cuda-12.4 /usr/local/cuda
# install CUDA 12.4.1 in the same container
wget -q https://developer.download.nvidia.com/compute/cuda/12.4.1/local_installers/cuda_12.4.1_550.54.15_linux.run
chmod +x cuda_12.4.1_550.54.15_linux.run
./cuda_12.4.1_550.54.15_linux.run --toolkit --driver --silent --kernel-source-path=/usr/src/kernels/4.18.0-553.34.1.el8_10.x86_64
rm -f cuda_12.4.1_550.54.15_linux.run
rm -f /usr/local/cuda && ln -s /usr/local/cuda-12.4 /usr/local/cuda
rm -rf /usr/bin/nvidia-smi
# cuDNN license: https://developer.nvidia.com/cudnn/license_agreement
mkdir tmp_cudnn && cd tmp_cudnn
wget -q https://developer.download.nvidia.com/compute/cudnn/redist/cudnn/linux-x86_64/cudnn-linux-x86_64-${CUDNN_VERSION}_cuda12-archive.tar.xz -O cudnn-linux-x86_64-${CUDNN_VERSION}_cuda12-archive.tar.xz
tar xf cudnn-linux-x86_64-${CUDNN_VERSION}_cuda12-archive.tar.xz
cp -a cudnn-linux-x86_64-${CUDNN_VERSION}_cuda12-archive/include/* /usr/local/cuda/include/
cp -a cudnn-linux-x86_64-${CUDNN_VERSION}_cuda12-archive/lib/* /usr/local/cuda/lib64/
cd ..
rm -rf tmp_cudnn
install_nccl_2215
install_trt_105018
install_cusparselt_062
ldconfig
}
function install_126 {
CUDNN_VERSION=9.5.1.17
NCCL_VERSION=2.23.4
TensorRT_VERSION=10.5
echo "Installing CUDA 12.6.3 and cuDNN ${CUDNN_VERSION} and NCCL ${NCCL_VERSION} and TensorRT ${TensorRT_VERSION} and cuSparseLt-0.6.3"
rm -rf /usr/local/cuda-12.6 /usr/local/cuda
# install CUDA 12.6.3 in the same container
wget -q https://developer.download.nvidia.com/compute/cuda/12.6.3/local_installers/cuda_12.6.3_560.35.05_linux.run
chmod +x cuda_12.6.3_560.35.05_linux.run
./cuda_12.6.3_560.35.05_linux.run --toolkit --driver --silent --kernel-source-path=/usr/src/kernels/4.18.0-553.34.1.el8_10.x86_64
rm -f cuda_12.6.3_560.35.05_linux.run
rm -f /usr/local/cuda && ln -s /usr/local/cuda-12.6 /usr/local/cuda
rm -rf /usr/bin/nvidia-smi
# cuDNN license: https://developer.nvidia.com/cudnn/license_agreement
mkdir tmp_cudnn && cd tmp_cudnn
wget -q https://developer.download.nvidia.com/compute/cudnn/redist/cudnn/linux-x86_64/cudnn-linux-x86_64-${CUDNN_VERSION}_cuda12-archive.tar.xz -O cudnn-linux-x86_64-${CUDNN_VERSION}_cuda12-archive.tar.xz
tar xf cudnn-linux-x86_64-${CUDNN_VERSION}_cuda12-archive.tar.xz
cp -a cudnn-linux-x86_64-${CUDNN_VERSION}_cuda12-archive/include/* /usr/local/cuda/include/
cp -a cudnn-linux-x86_64-${CUDNN_VERSION}_cuda12-archive/lib/* /usr/local/cuda/lib64/
cd ..
rm -rf tmp_cudnn
install_nccl_2234
install_trt_105018
install_cusparselt_063
ldconfig
}
function install_129 {
CUDNN_VERSION=9.9.0.52
NCCL_VERSION=2.23.4
TensorRT_VERSION=10.5
echo "Installing CUDA 12.9.0 and cuDNN ${CUDNN_VERSION} and NCCL ${NCCL_VERSION} and TensorRT ${TensorRT_VERSION} and cuSparseLt-0.6.3"
rm -rf /usr/local/cuda-12.9 /usr/local/cuda
# install CUDA 12.9.0 in the same container
wget -q https://developer.download.nvidia.com/compute/cuda/12.9.0/local_installers/cuda_12.9.0_575.51.03_linux.run
chmod +x cuda_12.9.0_575.51.03_linux.run
./cuda_12.9.0_575.51.03_linux.run --toolkit --driver --silent --kernel-source-path=/usr/src/kernels/4.18.0-553.34.1.el8_10.x86_64
rm -f cuda_12.9.0_575.51.03_linux.run
rm -f /usr/local/cuda && ln -s /usr/local/cuda-12.9 /usr/local/cuda
rm -rf /usr/bin/nvidia-smi
# cuDNN license: https://developer.nvidia.com/cudnn/license_agreement
mkdir tmp_cudnn && cd tmp_cudnn
wget -q https://developer.download.nvidia.com/compute/cudnn/redist/cudnn/linux-x86_64/cudnn-linux-x86_64-${CUDNN_VERSION}_cuda12-archive.tar.xz -O cudnn-linux-x86_64-${CUDNN_VERSION}_cuda12-archive.tar.xz
tar xf cudnn-linux-x86_64-${CUDNN_VERSION}_cuda12-archive.tar.xz
cp -a cudnn-linux-x86_64-${CUDNN_VERSION}_cuda12-archive/include/* /usr/local/cuda/include/
cp -a cudnn-linux-x86_64-${CUDNN_VERSION}_cuda12-archive/lib/* /usr/local/cuda/lib64/
cd ..
rm -rf tmp_cudnn
install_nccl_2234
install_trt_105018
install_cusparselt_063
ldconfig
}
function install_130 {
CUDNN_VERSION=9.13.0.50
NCCL_VERSION=2.28.3
TensorRT_VERSION=10.13
echo "Installing CUDA 13.0.1 and cuDNN ${CUDNN_VERSION} and NCCL ${NCCL_VERSION} and TensorRT ${TensorRT_VERSION} and cuSparseLt-0.8.1"
rm -rf /usr/local/cuda-13.0 /usr/local/cuda
# install CUDA 13.0.1 in the same container
wget -q https://developer.download.nvidia.com/compute/cuda/13.0.1/local_installers/cuda_13.0.1_580.82.07_linux.run
chmod +x cuda_13.0.1_580.82.07_linux.run
./cuda_13.0.1_580.82.07_linux.run --toolkit --driver --silent --kernel-source-path=/usr/src/kernels/4.18.0-553.76.1.el8_10.x86_64
rm -f cuda_13.0.1_580.82.07_linux.run
rm -f /usr/local/cuda && ln -s /usr/local/cuda-13.0 /usr/local/cuda
rm -rf /usr/bin/nvidia-smi
# cuDNN license: https://developer.nvidia.com/cudnn/license_agreement
mkdir tmp_cudnn && cd tmp_cudnn
wget -q https://developer.download.nvidia.com/compute/cudnn/redist/cudnn/linux-x86_64/cudnn-linux-x86_64-${CUDNN_VERSION}_cuda13-archive.tar.xz -O cudnn-linux-x86_64-${CUDNN_VERSION}_cuda13-archive.tar.xz
tar xf cudnn-linux-x86_64-${CUDNN_VERSION}_cuda13-archive.tar.xz
cp -a cudnn-linux-x86_64-${CUDNN_VERSION}_cuda13-archive/include/* /usr/local/cuda/include/
cp -a cudnn-linux-x86_64-${CUDNN_VERSION}_cuda13-archive/lib/* /usr/local/cuda/lib64/
cd ..
rm -rf tmp_cudnn
install_nccl_2283
install_trt_101339
install_cusparselt_081
ldconfig
}
function install_132 {
CUDNN_VERSION=9.20.0.48
NCCL_VERSION=2.29.7
TensorRT_VERSION=10.16.1.11
echo "Installing CUDA 13.2.0 and cuDNN ${CUDNN_VERSION} and NCCL ${NCCL_VERSION} and TensorRT ${TensorRT_VERSION} and cuSparseLt-0.9.0"
rm -rf /usr/local/cuda-13.2 /usr/local/cuda
# install CUDA 13.2.0 in the same container
wget -q https://developer.download.nvidia.com/compute/cuda/13.2.0/local_installers/cuda_13.2.0_595.45.04_linux.run
chmod +x cuda_13.2.0_595.45.04_linux.run
./cuda_13.2.0_595.45.04_linux.run --toolkit --driver --silent --kernel-source-path=/usr/src/kernels/4.18.0-553.34.1.el8_10.x86_64
rm -f cuda_13.2.0_595.45.04_linux.run
rm -f /usr/local/cuda && ln -s /usr/local/cuda-13.2 /usr/local/cuda
rm -rf /usr/bin/nvidia-smi
# cuDNN license: https://developer.nvidia.com/cudnn/license_agreement
mkdir tmp_cudnn && cd tmp_cudnn
wget -q https://developer.download.nvidia.com/compute/cudnn/redist/cudnn/linux-x86_64/cudnn-linux-x86_64-${CUDNN_VERSION}_cuda13-archive.tar.xz -O cudnn-linux-x86_64-${CUDNN_VERSION}_cuda13-archive.tar.xz
tar xf cudnn-linux-x86_64-${CUDNN_VERSION}_cuda13-archive.tar.xz
cp -a cudnn-linux-x86_64-${CUDNN_VERSION}_cuda13-archive/include/* /usr/local/cuda/include/
cp -a cudnn-linux-x86_64-${CUDNN_VERSION}_cuda13-archive/lib/* /usr/local/cuda/lib64/
cd ..
rm -rf tmp_cudnn
install_nccl_2297_cuda132
install_trt_1016111
install_cusparselt_090_cuda13
ldconfig
}
function prune_118 {
echo "Pruning CUDA 11.8 and cuDNN"
#####################################################################################
# CUDA 11.8 prune static libs
#####################################################################################
export NVPRUNE="/usr/local/cuda-11.8/bin/nvprune"
export CUDA_LIB_DIR="/usr/local/cuda-11.8/lib64"
export GENCODE="-gencode arch=compute_35,code=sm_35 -gencode arch=compute_50,code=sm_50 -gencode arch=compute_60,code=sm_60 -gencode arch=compute_70,code=sm_70 -gencode arch=compute_75,code=sm_75 -gencode arch=compute_80,code=sm_80 -gencode arch=compute_86,code=sm_86 -gencode arch=compute_90,code=sm_90"
export GENCODE_CUDNN="-gencode arch=compute_35,code=sm_35 -gencode arch=compute_37,code=sm_37 -gencode arch=compute_50,code=sm_50 -gencode arch=compute_60,code=sm_60 -gencode arch=compute_61,code=sm_61 -gencode arch=compute_70,code=sm_70 -gencode arch=compute_75,code=sm_75 -gencode arch=compute_80,code=sm_80 -gencode arch=compute_86,code=sm_86 -gencode arch=compute_90,code=sm_90"
if [[ -n "$OVERRIDE_GENCODE" ]]; then
export GENCODE=$OVERRIDE_GENCODE
fi
# all CUDA libs except CuDNN and CuBLAS (cudnn and cublas need arch 3.7 included)
ls $CUDA_LIB_DIR/ | grep "\.a" | grep -v "culibos" | grep -v "cudart" | grep -v "cudnn" | grep -v "cublas" | grep -v "metis" \
| xargs -I {} bash -c \
"echo {} && $NVPRUNE $GENCODE $CUDA_LIB_DIR/{} -o $CUDA_LIB_DIR/{}"
# prune CuDNN and CuBLAS
$NVPRUNE $GENCODE_CUDNN $CUDA_LIB_DIR/libcublas_static.a -o $CUDA_LIB_DIR/libcublas_static.a
$NVPRUNE $GENCODE_CUDNN $CUDA_LIB_DIR/libcublasLt_static.a -o $CUDA_LIB_DIR/libcublasLt_static.a
#####################################################################################
# CUDA 11.8 prune visual tools
#####################################################################################
export CUDA_BASE="/usr/local/cuda-11.8/"
rm -rf $CUDA_BASE/libnvvp $CUDA_BASE/nsightee_plugins $CUDA_BASE/nsight-compute-2022.3.0 $CUDA_BASE/nsight-systems-2022.4.2/
}
function prune_123 {
echo "Pruning CUDA 12.3"
#####################################################################################
# CUDA 12.3 prune static libs
#####################################################################################
export NVPRUNE="/usr/local/cuda-12.3/bin/nvprune"
export CUDA_LIB_DIR="/usr/local/cuda-12.3/lib64"
export GENCODE="-gencode arch=compute_50,code=sm_50 -gencode arch=compute_60,code=sm_60 -gencode arch=compute_70,code=sm_70 -gencode arch=compute_75,code=sm_75 -gencode arch=compute_80,code=sm_80 -gencode arch=compute_86,code=sm_86 -gencode arch=compute_90,code=sm_90"
export GENCODE_CUDNN="-gencode arch=compute_50,code=sm_50 -gencode arch=compute_60,code=sm_60 -gencode arch=compute_61,code=sm_61 -gencode arch=compute_70,code=sm_70 -gencode arch=compute_75,code=sm_75 -gencode arch=compute_80,code=sm_80 -gencode arch=compute_86,code=sm_86 -gencode arch=compute_90,code=sm_90"
if [[ -n "$OVERRIDE_GENCODE" ]]; then
export GENCODE=$OVERRIDE_GENCODE
fi
# all CUDA libs except CuDNN and CuBLAS
ls $CUDA_LIB_DIR/ | grep "\.a" | grep -v "culibos" | grep -v "cudart" | grep -v "cudnn" | grep -v "cublas" | grep -v "metis" \
| xargs -I {} bash -c \
"echo {} && $NVPRUNE $GENCODE $CUDA_LIB_DIR/{} -o $CUDA_LIB_DIR/{}"
# prune CuDNN and CuBLAS
$NVPRUNE $GENCODE_CUDNN $CUDA_LIB_DIR/libcublas_static.a -o $CUDA_LIB_DIR/libcublas_static.a
$NVPRUNE $GENCODE_CUDNN $CUDA_LIB_DIR/libcublasLt_static.a -o $CUDA_LIB_DIR/libcublasLt_static.a
#####################################################################################
# CUDA 12.3 prune visual tools
#####################################################################################
export CUDA_BASE="/usr/local/cuda-12.3/"
rm -rf $CUDA_BASE/libnvvp $CUDA_BASE/nsightee_plugins $CUDA_BASE/nsight-compute-2023.1.0 $CUDA_BASE/nsight-systems-2023.1.2/
}
function prune_124 {
echo "Pruning CUDA 12.4"
#####################################################################################
# CUDA 12.4 prune static libs
#####################################################################################
export NVPRUNE="/usr/local/cuda-12.4/bin/nvprune"
export CUDA_LIB_DIR="/usr/local/cuda-12.4/lib64"
export GENCODE="-gencode arch=compute_50,code=sm_50 -gencode arch=compute_60,code=sm_60 -gencode arch=compute_70,code=sm_70 -gencode arch=compute_75,code=sm_75 -gencode arch=compute_80,code=sm_80 -gencode arch=compute_86,code=sm_86 -gencode arch=compute_90,code=sm_90"
export GENCODE_CUDNN="-gencode arch=compute_50,code=sm_50 -gencode arch=compute_60,code=sm_60 -gencode arch=compute_61,code=sm_61 -gencode arch=compute_70,code=sm_70 -gencode arch=compute_75,code=sm_75 -gencode arch=compute_80,code=sm_80 -gencode arch=compute_86,code=sm_86 -gencode arch=compute_90,code=sm_90"
if [[ -n "$OVERRIDE_GENCODE" ]]; then
export GENCODE=$OVERRIDE_GENCODE
fi
if [[ -n "$OVERRIDE_GENCODE_CUDNN" ]]; then
export GENCODE_CUDNN=$OVERRIDE_GENCODE_CUDNN
fi
# all CUDA libs except CuDNN and CuBLAS
ls $CUDA_LIB_DIR/ | grep "\.a" | grep -v "culibos" | grep -v "cudart" | grep -v "cudnn" | grep -v "cublas" | grep -v "metis" \
| xargs -I {} bash -c \
"echo {} && $NVPRUNE $GENCODE $CUDA_LIB_DIR/{} -o $CUDA_LIB_DIR/{}"
# prune CuDNN and CuBLAS
$NVPRUNE $GENCODE_CUDNN $CUDA_LIB_DIR/libcublas_static.a -o $CUDA_LIB_DIR/libcublas_static.a
$NVPRUNE $GENCODE_CUDNN $CUDA_LIB_DIR/libcublasLt_static.a -o $CUDA_LIB_DIR/libcublasLt_static.a
#####################################################################################
# CUDA 12.4 prune visual tools
#####################################################################################
export CUDA_BASE="/usr/local/cuda-12.4/"
rm -rf $CUDA_BASE/libnvvp $CUDA_BASE/nsightee_plugins $CUDA_BASE/nsight-compute-2024.1.0 $CUDA_BASE/nsight-systems-2023.4.4/
}
function prune_126 {
echo "Pruning CUDA 12.6"
#####################################################################################
# CUDA 12.6 prune static libs
#####################################################################################
export NVPRUNE="/usr/local/cuda-12.6/bin/nvprune"
export CUDA_LIB_DIR="/usr/local/cuda-12.6/lib64"
export GENCODE="-gencode arch=compute_50,code=sm_50 -gencode arch=compute_60,code=sm_60 -gencode arch=compute_70,code=sm_70 -gencode arch=compute_75,code=sm_75 -gencode arch=compute_80,code=sm_80 -gencode arch=compute_86,code=sm_86 -gencode arch=compute_90,code=sm_90"
export GENCODE_CUDNN="-gencode arch=compute_50,code=sm_50 -gencode arch=compute_60,code=sm_60 -gencode arch=compute_61,code=sm_61 -gencode arch=compute_70,code=sm_70 -gencode arch=compute_75,code=sm_75 -gencode arch=compute_80,code=sm_80 -gencode arch=compute_86,code=sm_86 -gencode arch=compute_90,code=sm_90"
if [[ -n "$OVERRIDE_GENCODE" ]]; then
export GENCODE=$OVERRIDE_GENCODE
fi
if [[ -n "$OVERRIDE_GENCODE_CUDNN" ]]; then
export GENCODE_CUDNN=$OVERRIDE_GENCODE_CUDNN
fi
# all CUDA libs except CuDNN and CuBLAS
ls $CUDA_LIB_DIR/ | grep "\.a" | grep -v "culibos" | grep -v "cudart" | grep -v "cudnn" | grep -v "cublas" | grep -v "metis" \
| xargs -I {} bash -c \
"echo {} && $NVPRUNE $GENCODE $CUDA_LIB_DIR/{} -o $CUDA_LIB_DIR/{}"
# prune CuDNN and CuBLAS
$NVPRUNE $GENCODE_CUDNN $CUDA_LIB_DIR/libcublas_static.a -o $CUDA_LIB_DIR/libcublas_static.a
$NVPRUNE $GENCODE_CUDNN $CUDA_LIB_DIR/libcublasLt_static.a -o $CUDA_LIB_DIR/libcublasLt_static.a
#####################################################################################
# CUDA 12.6 prune visual tools
#####################################################################################
export CUDA_BASE="/usr/local/cuda-12.6/"
rm -rf $CUDA_BASE/libnvvp $CUDA_BASE/nsightee_plugins $CUDA_BASE/nsight-compute-2024.3.2 $CUDA_BASE/nsight-systems-2024.5.1/
}
# idiomatic parameter and option handling in sh
while test $# -gt 0
do
case "$1" in
11.8) install_118; prune_118
;;
12.3) install_123; prune_123
;;
12.4) install_124; prune_124
;;
12.6) install_126; prune_126
;;
12.9) install_129
;;
13.0) install_130
;;
13.2) install_132
;;
*) echo "bad argument $1"; exit 1
;;
esac
shift
done
@@ -0,0 +1,24 @@
#!/bin/bash
# Copyright (c) 2026 PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
set -e
# install gdrcopy
cd /usr/local
wget -q https://paddle-ci.gz.bcebos.com/gdrcopy.tar
tar xf gdrcopy.tar
rm -f gdrcopy.tar
ldconfig
@@ -0,0 +1,59 @@
#!/bin/bash
# Copyright (c) 2025 PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
function check_var {
if [ -z "$1" ]; then
echo "required variable not defined"
exit 1
fi
}
function check_sha256sum {
local fname=$1
check_var ${fname}
local sha256=$2
check_var ${sha256}
echo "${sha256} ${fname}" > ${fname}.sha256
sha256sum -c ${fname}.sha256
rm ${fname}.sha256
}
function do_openssl_build {
./config -fPIC --prefix=/usr/local/ssl > /dev/null
make > /dev/null
make install > /dev/null
ln -sf /usr/lib64/libcrypto.so.1.1 /usr/local/ssl/lib/libcrypto.so.1.1
}
function build_openssl {
local openssl_fname=$1
check_var ${openssl_fname}
local openssl_sha256=$2
check_var ${openssl_sha256}
check_var ${OPENSSL_DOWNLOAD_URL}
curl -sLO ${OPENSSL_DOWNLOAD_URL}/${openssl_fname}.tar.gz
check_sha256sum ${openssl_fname}.tar.gz ${openssl_sha256}
tar -xzf ${openssl_fname}.tar.gz
(cd ${openssl_fname} && do_openssl_build)
rm -rf ${openssl_fname} ${openssl_fname}.tar.gz
}
OPENSSL_ROOT=openssl-1.1.1
OPENSSL_HASH=2836875a0f89c03d0fdf483941512613a50cfb421d6fd94b9f41d7279d586a3d
OPENSSL_DOWNLOAD_URL=https://www.openssl.org/source
build_openssl $OPENSSL_ROOT $OPENSSL_HASH
@@ -0,0 +1,37 @@
# Copyright (c) 2025 PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
set -e
TMP_DIR=patchelf_tmp
gcc_version=$(gcc --version |awk 'NR==1{print $3}')
if [ "$gcc_version" == "5.4.0" ];then
patchelf_version=0.10
else
patchelf_version=0.15.0
fi
rm -rf "$TMP_DIR"
git clone -b $patchelf_version https://github.com/NixOS/patchelf "$TMP_DIR"
cd "$TMP_DIR"
./bootstrap.sh
./configure
make
make install
cd ..
rm -rf "$TMP_DIR"
@@ -0,0 +1,121 @@
# Copyright (c) 2025 PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
function check_var {
if [ -z "$1" ]; then
echo "required variable not defined"
exit 1
fi
}
function lex_pyver {
# Echoes Python version string padded with zeros
# Thus:
# 3.2.1 -> 003002001
# 3 -> 003000000
echo $1 | awk -F "." '{printf "%03d%03d%03d", $1, $2, $3}'
}
function do_cpython_build {
local py_ver=$1
check_var $py_ver
local ucs_setting=$2
check_var $ucs_setting
tar -xzf Python-$py_ver.tgz
pushd Python-$py_ver
if [ "$ucs_setting" = "none" ]; then
unicode_flags=""
dir_suffix=""
else
local unicode_flags="--enable-unicode=$ucs_setting"
local dir_suffix="-$ucs_setting"
fi
local prefix="/opt/_internal/cpython-${py_ver}${dir_suffix}"
mkdir -p ${prefix}/lib
#if [ $1 -eq '3.13.0t' ];then
# GIL='--disable-gil'
#fi
LD_LIBRARY_PATH=/usr/local/lib:${LD_LIBRARY_PATH} CFLAGS="-Wformat" LDFLAGS="-Wl,-rpath,${prefix}/lib" ./configure --prefix=${prefix} --enable-shared $unicode_flags > /dev/null
LD_LIBRARY_PATH=/usr/local/lib:${LD_LIBRARY_PATH} make -j8 > /dev/null
LD_LIBRARY_PATH=/usr/local/lib:${LD_LIBRARY_PATH} make install > /dev/null
popd
echo "ZZZ looking for libpython"
find / -name 'libpython*.so*'
rm -rf Python-$py_ver
# Some python's install as bin/python3. Make them available as bin/python.
if [ -e ${prefix}/bin/python3.10 ]; then
ln -s python3.10 ${prefix}/bin/python
fi
if [ -e ${prefix}/bin/python3.11 ]; then
ln -s python3.11 ${prefix}/bin/python
fi
if [ -e ${prefix}/bin/python3.12 ]; then
ln -s python3.12 ${prefix}/bin/python
fi
if [ -e ${prefix}/bin/python3.13 ]; then
ln -s python3.13 ${prefix}/bin/python
fi
if [ -e ${prefix}/bin/python3.13t ]; then
ln -s python3.13t ${prefix}/bin/python
fi
if [ -e ${prefix}/bin/python3.14 ]; then
ln -s python3.14 ${prefix}/bin/python
fi
if [ -e ${prefix}/bin/python3.14t ]; then
ln -s python3.14t ${prefix}/bin/python
fi
# NOTE Make libpython shared library visible to python calls below
LD_LIBRARY_PATH="/usr/local/ssl/lib:${prefix}/lib" ${prefix}/bin/python -m pip config set global.trusted-host mirrors.aliyun.com
LD_LIBRARY_PATH="/usr/local/ssl/lib:${prefix}/lib" ${prefix}/bin/python -m pip config set global.index-url http://mirrors.aliyun.com/pypi/simple/
LD_LIBRARY_PATH="/usr/local/ssl/lib:${prefix}/lib" ${prefix}/bin/python get-pip.py
LD_LIBRARY_PATH="/usr/local/ssl/lib:${prefix}/lib" ${prefix}/bin/pip install wheel==0.40.0
cd /
ls ${MY_DIR}
abi_version=$(LD_LIBRARY_PATH="${prefix}/lib" ${prefix}/bin/python -V|awk '{print $2}'|awk -F '.' '{print $1$2}')
local abi_tag=$(echo cp$abi_version-cp$abi_version)
ln -s ${prefix} /opt/python/${abi_tag}
}
function build_cpython {
local py_ver=$1
check_var $py_ver
check_var $PYTHON_DOWNLOAD_URL
wget -q $PYTHON_DOWNLOAD_URL/$py_ver/Python-$py_ver.tgz
do_cpython_build $py_ver none
rm -f Python-$py_ver.tgz
}
function build_cpythons {
for py_ver in $@; do
check_var $GET_PIP_URL
curl -sLO $GET_PIP_URL
build_cpython $py_ver
done
rm -f get-pip.py
rm -f ez_setup.py
}
PYTHON_DOWNLOAD_URL=https://www.python.org/ftp/python
GET_PIP_URL=https://bootstrap.pypa.io/get-pip.py
CPYTHON_VERSIONS="3.14.0 3.13.0 3.12.0 3.11.0 3.10.0"
mkdir -p /opt/python
build_cpythons $CPYTHON_VERSIONS
+35
View File
@@ -0,0 +1,35 @@
#!/bin/bash
# Copyright (c) 2023 PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
function base_image(){
if [[ ${ref_CUDA_MAJOR} == "11.8" ]];then
dockerfile_name="Dockerfile-118"
sed "s#<baseimg>#nvidia/cuda:11.8.0-cudnn8-devel-ubuntu20.04#g" ./Dockerfile.ubuntu20 >${dockerfile_name}
sed -i "s#<setcuda>#ENV LD_LIBRARY_PATH=/usr/local/cuda-11.8/targets/x86_64-linux/lib:\$LD_LIBRARY_PATH #g" ${dockerfile_name}
sed -i 's#<install_cpu_package>##g' ${dockerfile_name}
sed -i "s#<install_gcc>#WORKDIR /usr/bin ENV PATH=/usr/local/gcc-8.2/bin:\$PATH #g" ${dockerfile_name}
sed -i 's#RUN bash /build_scripts/install_trt.sh#RUN bash /build_scripts/install_trt.sh trt8616#g' ${dockerfile_name}
sed -i 's#cudnn841#cudnn897#g' ${dockerfile_name}
sed -i 's#CUDNN_VERSION=8.4.1#CUDNN_VERSION=8.6.0#g' ${dockerfile_name}
else
echo "Dockerfile ERROR!!!"
exit 1
fi
}
export ref_CUDA_MAJOR=11.8
base_image
+101
View File
@@ -0,0 +1,101 @@
#!/bin/bash
# Copyright (c) 2023 PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
function base_image(){
if [[ ${ref_CUDA_MAJOR} == "11.2" ]];then
dockerfile_name="Dockerfile-112"
sed "s#<baseimg>#nvidia/cuda:11.2.2-cudnn8-devel-ubuntu20.04#g" ./Dockerfile.release.ubuntu20 >${dockerfile_name}
sed -i "s#<setcuda>#ENV LD_LIBRARY_PATH=/usr/local/cuda-11.2/targets/x86_64-linux/lib:\$LD_LIBRARY_PATH #g" ${dockerfile_name}
sed -i 's#<install_cpu_package>##g' ${dockerfile_name}
sed -i "s#<install_gcc>#WORKDIR /usr/bin ENV PATH=/usr/local/gcc-8.2/bin:\$PATH #g" ${dockerfile_name}
sed -i "s#gcc121#gcc82#g" ${dockerfile_name}
sed -i "s#gcc-12.1#gcc-8.2#g" ${dockerfile_name}
sed -i 's#RUN bash /build_scripts/install_trt.sh#RUN bash /build_scripts/install_trt.sh trt8034#g' ${dockerfile_name}
sed -i 's#cudnn841#cudnn821#g' ${dockerfile_name}
sed -i 's#CUDNN_VERSION=8.4.1#CUDNN_VERSION=8.2.1#g' ${dockerfile_name}
elif [[ ${ref_CUDA_MAJOR} == "11.8" ]];then
dockerfile_name="Dockerfile-118"
sed "s#<baseimg>#nvidia/cuda:11.8.0-cudnn8-devel-ubuntu20.04#g" ./Dockerfile.release.ubuntu20 >${dockerfile_name}
sed -i "s#<setcuda>#ENV LD_LIBRARY_PATH=/usr/local/cuda-11.8/targets/x86_64-linux/lib:\$LD_LIBRARY_PATH #g" ${dockerfile_name}
sed -i 's#<install_cpu_package>##g' ${dockerfile_name}
sed -i "s#<install_gcc>#WORKDIR /usr/bin ENV PATH=/usr/local/gcc-8.2/bin:\$PATH #g" ${dockerfile_name}
sed -i "s#gcc121#gcc82#g" ${dockerfile_name}
sed -i "s#gcc-12.1#gcc-8.2#g" ${dockerfile_name}
sed -i 's#RUN bash /build_scripts/install_trt.sh#RUN bash /build_scripts/install_trt.sh trt8531#g' ${dockerfile_name}
sed -i 's#cudnn841#cudnn860#g' ${dockerfile_name}
sed -i 's#CUDNN_VERSION=8.4.1#CUDNN_VERSION=8.6.0#g' ${dockerfile_name}
elif [[ ${ref_CUDA_MAJOR} == "12.0" ]];then
dockerfile_name="Dockerfile-120"
sed "s#<baseimg>#nvidia/cuda:12.0.0-cudnn8-devel-ubuntu20.04#g" ./Dockerfile.release.ubuntu20 >${dockerfile_name}
sed -i "s#<setcuda>#ENV LD_LIBRARY_PATH=/usr/local/cuda-12.0/targets/x86_64-linux/lib:\$LD_LIBRARY_PATH #g" ${dockerfile_name}
sed -i 's#<install_cpu_package>##g' ${dockerfile_name}
sed -i "s#<install_gcc>#WORKDIR /usr/bin ENV PATH=/usr/local/gcc-12.0/bin:\$PATH #g" ${dockerfile_name}
sed -i 's#RUN bash /build_scripts/install_trt.sh#RUN bash /build_scripts/install_trt.sh trt8616#g' ${dockerfile_name}
sed -i 's#cudnn841#cudnn891#g' ${dockerfile_name}
sed -i 's#CUDNN_VERSION=8.4.1#CUDNN_VERSION=8.9.1#g' ${dockerfile_name}
elif [[ ${ref_CUDA_MAJOR} == "12.3" ]];then
dockerfile_name="Dockerfile-123"
sed "s#<baseimg>#nvidia/cuda:12.3.1-devel-ubuntu20.04#g" ./Dockerfile.release.ubuntu20 >${dockerfile_name}
sed -i "s#<setcuda>#ENV LD_LIBRARY_PATH=/usr/local/cuda-12.3/targets/x86_64-linux/lib:\$LD_LIBRARY_PATH #g" ${dockerfile_name}
sed -i 's#<install_cpu_package>##g' ${dockerfile_name}
sed -i "s#<install_gcc>#WORKDIR /usr/bin ENV PATH=/usr/local/gcc-12.0/bin:\$PATH #g" ${dockerfile_name}
sed -i 's#RUN bash /build_scripts/install_trt.sh#RUN bash /build_scripts/install_trt.sh trt8616#g' ${dockerfile_name}
sed -i 's#cudnn841#cudnn900#g' ${dockerfile_name}
sed -i 's#CUDNN_VERSION=8.4.1#CUDNN_VERSION=9.0.0#g' ${dockerfile_name}
elif [[ ${ref_CUDA_MAJOR} == "12.6" ]];then
dockerfile_name="Dockerfile-126"
sed "s#<baseimg>#nvidia/cuda:12.6.0-devel-ubuntu20.04#g" ./Dockerfile.release.ubuntu20 >${dockerfile_name}
sed -i "s#<setcuda>#ENV LD_LIBRARY_PATH=/usr/local/cuda-12.s63/targets/x86_64-linux/lib:\$LD_LIBRARY_PATH #g" ${dockerfile_name}
sed -i 's#<install_cpu_package>##g' ${dockerfile_name}
sed -i "s#<install_gcc>#WORKDIR /usr/bin ENV PATH=/usr/local/gcc-12.0/bin:\$PATH #g" ${dockerfile_name}
sed -i 's#RUN bash /build_scripts/install_trt.sh#RUN bash /build_scripts/install_trt.sh trt8616#g' ${dockerfile_name}
sed -i 's#cudnn841#cudnn911#g' ${dockerfile_name}
sed -i 's#CUDNN_VERSION=8.4.1#CUDNN_VERSION=9.1.1#g' ${dockerfile_name}
elif [[ ${ref_CUDA_MAJOR} == "0" ]];then
dockerfile_name="Dockerfile-cpu"
sed "s#<baseimg>#ubuntu:20.04#g" ./Dockerfile.release.ubuntu20 >${dockerfile_name}
sed -i "s#<setcuda>##g" ${dockerfile_name}
sed -i 's#<install_cpu_package>#RUN apt-get install -y gcc g++ make#g' ${dockerfile_name}
sed -i "s#<install_gcc>#WORKDIR /usr/bin ENV PATH=/usr/local/gcc-8.2/bin:\$PATH #g" ${dockerfile_name}
sed -i "s#gcc121#gcc82#g" ${dockerfile_name}
sed -i "s#gcc-12.1#gcc-8.2#g" ${dockerfile_name}
sed -i 's#RUN bash /build_scripts/install_trt.sh##g' ${dockerfile_name}
sed -i 's#RUN bash /build_scripts/install_cudnn.sh cudnn841##g' ${dockerfile_name}
sed -i 's#ENV CUDNN_VERSION=8.4.1##g' ${dockerfile_name}
sed -i 's#RUN apt-key del 7fa2af80##g' ${dockerfile_name}
sed -i 's#RUN rm /etc/apt/sources.list.d/\*##g' ${dockerfile_name}
sed -i 's#RUN apt-key adv --fetch-keys https://developer.download.nvidia.cn/compute/cuda/repos/ubuntu2004/x86_64/3bf863cc.pub##g' ${dockerfile_name}
sed -i 's#ENV WITH_GPU=${WITH_GPU:-ON}#ENV WITH_GPU=${WITH_GPU:-OFF}#g' ${dockerfile_name}
else
echo "Dockerfile ERROR!!!"
exit 1
fi
}
export ref_CUDA_MAJOR=0
base_image
export ref_CUDA_MAJOR=11.2
base_image
export ref_CUDA_MAJOR=11.8
base_image
export ref_CUDA_MAJOR=12.0
base_image
export ref_CUDA_MAJOR=12.3
base_image
export ref_CUDA_MAJOR=12.6
base_image
+42
View File
@@ -0,0 +1,42 @@
#!/bin/bash
# Copyright (c) 2023 PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
function base_image(){
if [[ ${ref_CUDA_MAJOR} == "12.3" ]];then
dockerfile_name="Dockerfile-123"
sed "s#<baseimg>#nvidia/cuda:12.3.2-cudnn9-devel-ubuntu22.04#g" ./Dockerfile.ubuntu22 >${dockerfile_name}
sed -i "s#<setcuda>#ENV LD_LIBRARY_PATH=/usr/local/cuda-12.3/targets/x86_64-linux/lib:\$LD_LIBRARY_PATH #g" ${dockerfile_name}
sed -i 's#<install_cpu_package>##g' ${dockerfile_name}
sed -i 's#<install_cudnn>#RUN bash /build_scripts/install_cudnn.sh cudnn911#g' ${dockerfile_name}
sed -i 's#RUN bash /build_scripts/install_trt.sh#RUN bash /build_scripts/install_trt.sh trt105018#g' ${dockerfile_name}
elif [[ ${ref_CUDA_MAJOR} == "12.4" ]];then
dockerfile_name="Dockerfile-124"
sed "s#<baseimg>#nvidia/cuda:12.4.1-cudnn-devel-ubuntu22.04#g" ./Dockerfile.ubuntu22 >${dockerfile_name}
sed -i "s#<setcuda>#ENV LD_LIBRARY_PATH=/usr/local/cuda-12.4/targets/x86_64-linux/lib:\$LD_LIBRARY_PATH #g" ${dockerfile_name}
sed -i 's#<install_cpu_package>##g' ${dockerfile_name}
sed -i 's#<install_cudnn>##g' ${dockerfile_name}
sed -i 's#RUN bash /build_scripts/install_trt.sh#RUN bash /build_scripts/install_trt.sh trt105018#g' ${dockerfile_name}
else
echo "Dockerfile ERROR!!!"
exit 1
fi
}
export ref_CUDA_MAJOR=12.3
base_image
export ref_CUDA_MAJOR=12.4
base_image
+46
View File
@@ -0,0 +1,46 @@
#!/bin/bash
# Copyright (c) 2023 PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
function base_image(){
if [[ ${ref_CUDA_MAJOR} == "cpu" ]];then
dockerfile_name="Dockerfile-cpu"
sed "s#<baseimg>#ubuntu:24.04#g" ./Dockerfile.ubuntu24 >${dockerfile_name}
sed -i "s#<setcuda>##g" ${dockerfile_name}
sed -i "s#WITH_GPU:-ON#WITH_GPU:-OFF#g" ${dockerfile_name}
sed -i 's#RUN mv /etc/apt/sources.list.d/cuda.list /etc/apt/sources.list.d/cuda.list.bak##g' ${dockerfile_name}
sed -i 's#RUN curl .*3bf863cc.pub | gpg --dearmor | tee /usr/share/keyrings/cuda-archive-keyring.gpg##g' ${dockerfile_name}
sed -i 's#RUN mv /etc/apt/sources.list.d/cuda.list.bak /etc/apt/sources.list.d/cuda.list##g' ${dockerfile_name}
sed -i 's#RUN sed -i .*signed-by=/usr/share/keyrings/cuda-archive-keyring.gpg.*cuda.list##g' ${dockerfile_name}
sed -i 's#<install_cpu_package>#RUN apt-get install -y gcc g++ make#g' ${dockerfile_name}
sed -i 's#RUN bash /build_scripts/install_trt.sh##g' ${dockerfile_name}
sed -i 's#ENV CUDNN_VERSION=9.5.0##g' ${dockerfile_name}
elif [[ ${ref_CUDA_MAJOR} == "12.6" ]];then
dockerfile_name="Dockerfile-126"
sed "s#<baseimg>#nvidia/cuda:12.6.2-cudnn-devel-ubuntu24.04#g" ./Dockerfile.ubuntu24 >${dockerfile_name}
sed -i "s#<setcuda>#ENV LD_LIBRARY_PATH=/usr/local/cuda-12.6/targets/x86_64-linux/lib:\$LD_LIBRARY_PATH #g" ${dockerfile_name}
sed -i 's#<install_cpu_package>##g' ${dockerfile_name}
sed -i 's#RUN bash /build_scripts/install_trt.sh#RUN bash /build_scripts/install_trt.sh trt105018#g' ${dockerfile_name}
else
echo "Dockerfile ERROR!!!"
exit 1
fi
}
export ref_CUDA_MAJOR=cpu
base_image
export ref_CUDA_MAJOR=12.6
base_image