File tree Expand file tree Collapse file tree 3 files changed +18
-13
lines changed
Expand file tree Collapse file tree 3 files changed +18
-13
lines changed Original file line number Diff line number Diff line change 1- FROM nvcr.io/nvidia/cuda:11.6.2 -cudnn8-runtime-ubuntu20.04
1+ FROM paddlepaddle/paddle:latest-dev-cuda11.6 -cudnn8.4-trt8.4-gcc82
22
33RUN echo "deb http://mirrors.aliyun.com/ubuntu/ bionic main restricted universe multiverse" >> /etc/apt/sources.list
44RUN echo "deb-src http://mirrors.aliyun.com/ubuntu/ bionic main restricted universe multiverse" >> /etc/apt/sources.list
@@ -35,7 +35,7 @@ RUN wget https://mirrors.huaweicloud.com/python/3.9.7/Python-3.9.7.tgz && \
3535RUN python3 -m pip install --upgrade pip -i https://pypi.tuna.tsinghua.edu.cn/simple && pip install pysdf open3d db-sqlite3 -i https://pypi.tuna.tsinghua.edu.cn/simple
3636
3737# install pymesh and paddle
38- RUN python3 -m pip install --upgrade pip -i https://pypi.tuna.tsinghua.edu.cn/simple && pip install numpy= =1.22.4 -i https://pypi.tuna.tsinghua.edu.cn/simple
38+ RUN python3 -m pip install --upgrade pip -i https://pypi.tuna.tsinghua.edu.cn/simple && pip install " numpy>=1.20.0,< =1.23.1" -i https://pypi.tuna.tsinghua.edu.cn/simple
3939COPY ./pymesh.tar.xz /src/pymesh.tar.xz
4040
4141RUN cd /src && \
@@ -50,10 +50,8 @@ ENV PATH="$PATH:/usr/lib/x86_64-linux-gnu/"
5050ENV LD_LIBRARY_PATH="/usr/local/cuda/lib64/:$LD_LIBRARY_PATH"
5151
5252RUN python3 -m ensurepip --upgrade && \
53- pip3 config set global.index-url https://pypi.doubanio.com /simple/ && \
53+ pip3 config set global.index-url https://pypi.tuna.tsinghua.edu.cn /simple && \
5454 # ensure paddle install normally
55- ln -s /usr/lib/x86_64-linux-gnu/libcudnn.so.8 /usr/local/cuda/lib64/libcudnn.so && \
56- ln -s /usr/local/cuda/lib64/libcublas.so.11 /usr/local/cuda/lib64/libcublas.so && \
5755 python3 -m pip install paddlepaddle-gpu==0.0.0.post116 -f https://www.paddlepaddle.org.cn/whl/linux/gpu/develop.html
5856
5957RUN echo 'ldconfig' >> /root/.bashrc
Original file line number Diff line number Diff line change 11docker build . -t paddlescience:latest
22
33if [ -x " $( command -v nvidia-docker) " ]; then
4- nvidia-docker run --network=host -it paddlescience
4+ nvidia-docker run --name paddlescience_container -- network=host -it paddlescience
55elif [ -x " $( command -v docker) " ]; then
6- docker run --gpus all --network=host -it paddlescience
6+ docker run --name paddlescience_container -- gpus all --network=host -it paddlescience
77else
88 echo " Docker start failed, please install nvidia-docker or docker(>=19.03) first"
99fi
Original file line number Diff line number Diff line change 1818 # docker run --name paddlescience_container --gpus all --network=host -it shm-size 64g hydrogensulfate/paddlescience:latest /bin/bash
1919 ```
2020
21+ !!! note
22+
23+ Dockerhub 拉取的镜像**仅**预装了运行 PaddleScience 所需的依赖包,如 pymesh、open3d,**并不包含 PaddleScience**。
24+ 因此请在镜像拉取和容器构建完成后,参考 [1.4 安装 PaddleScience](#14-paddlescience) 中的步骤,在容器中安装 PaddleScience。
25+
2126=== "通过 Dockerfile 构建镜像"
2227
23- 如果你对 docker 有一定了解,则可以通过我们提供的 Dockerfile 文件,直接构建出能运行 PaddleScience 的环境。按照下列步骤构建镜像,创建容器并进入容器,以运行 PaddleScience。
28+ ``` sh
29+ git clone https://github.com/PaddlePaddle/PaddleScience.git
30+ cd PaddleScience/docker/
31+ wget -nc https://paddle-org.bj.bcebos.com/paddlescience/docker/pymesh.tar.xz
32+ bash run.sh
33+ ```
2434
25- 1. 克隆 PaddleScience 源码:`git clone https://github.com/PaddlePaddle/PaddleScience.git`;
26- 2. 下载 PyMesh 预编译文件压缩包 [pymesh.tar.xz](https://paddle-org.bj.bcebos.com/paddlescience/docker/pymesh.tar.xz),并放置在 `PaddleScience/docker/` 目录下;
27- 3. 在 `PaddleScience/docker/` 目录下,执行 `bash run.sh`,等待 docker build 完毕后自动进入环境。如果出现因网络问题导致的 apt 下载报错,则重复执行 `bash run.sh` 直至 build 完成;
28- 4. **在容器内手动执行:`{++ldconfig++}`,刷新动态链接库缓存,否则可能出现 GPU 设置不正确的问题。**
35+ 如果出现因网络问题导致的 docker 构建时 apt 下载报错,则重复执行 `bash run.sh` 直至构建完成。
2936
30- 更多关于 Paddle Docker 的安装和使用,请参考 [Docker 安装](https://www.paddlepaddle.org.cn/documentation/docs/zh/install/docker/fromdocker.html)
37+ 更多关于 Paddle Docker 的安装和使用,请参考 [Docker 安装](https://www.paddlepaddle.org.cn/documentation/docs/zh/install/docker/fromdocker.html)。
3138
3239### 1.2 python 环境安装[ 可选]
3340
You can’t perform that action at this time.
0 commit comments