forked from PaddlePaddle/Paddle
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile-132
More file actions
71 lines (59 loc) · 2.41 KB
/
Dockerfile-132
File metadata and controls
71 lines (59 loc) · 2.41 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
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.2
ARG BASE_TARGET=cuda${CUDA_VERSION}
FROM nvcr.io/nvidia/cuda:13.2.0-cudnn-devel-ubuntu24.04 as base
MAINTAINER PaddlePaddle Authors <paddle-dev@baidu.com>
# ENV variables
ARG WITH_GPU
ARG WITH_AVX
ARG PYTHON_VERSION=3.12
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 --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"
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 --break-system-packages -r /root/requirements.txt && \
pip install --break-system-packages -r /root/compile_requirements.txt && \
rm -rf /root/compile_requirements.txt /root/requirements.txt