PaddlePaddle provides some pre-compiled binary, including Docker images, ubuntu deb packages. It is welcomed to contributed more installation package of different linux distribution (such as ubuntu, centos, debian, gentoo and so on). We recommend to use Docker images to deploy PaddlePaddle.
## Docker installation
==========================
Docker is a tool designed to make it easier to create, deploy, and run applications by using containers.
PaddlePaddle provide the `Docker <https://www.docker.com/>`_ image. `Docker`_ is a lightweight container utilities. The performance of PaddlePaddle in `Docker`_ container is basically as same as run it in a normal linux. The `Docker`_ is a very convenient way to deliver the binary release for linux programs.
### PaddlePaddle Docker images
There are six Docker images:
.. note::
- paddledev/paddle:cpu-latest: PaddlePaddle CPU binary image.
* normal\: The docker image only contains binary of PaddlePaddle.
* devel\: The docker image contains PaddlePaddle binary, source code and essential build environment.
* demo\: The docker image contains the dependencies to run PaddlePaddle demo.
And the four rows are:
* CPU\: CPU Version. Support CPU which has :code:`AVX` instructions.
* GPU\: GPU Version. Support GPU, and cpu has :code:`AVX` instructions.
* CPU WITHOUT AVX\: CPU Version, which support most CPU even doesn't have :code:`AVX` instructions.
* GPU WITHOUT AVX\: GPU Version, which support most CPU even doesn't have :code:`AVX` instructions.
User can choose any version depends on machine. The following script can help you to detect your CPU support :code:`AVX` or not.
.. code-block:: bash
if cat /proc/cpuinfo | grep -q avx ; then echo "Support AVX"; else echo "Not support AVX"; fi
If the output is :code:`Support AVX`, then you can choose the AVX version of PaddlePaddle, otherwise, you need select :code:`noavx` version of PaddlePaddle. For example, the CPU develop version of PaddlePaddle is :code:`paddle-dev/paddle:cpu-devel-latest`.
The PaddlePaddle images don't contain any entry command. You need to write your entry command to use this image. See :code:`Remote Access` part or just use following command to run a :code:`bash`
.. code-block:: bash
docker run -it paddledev/paddle:cpu-latest /bin/bash
Download and Run Docker images
------------------------------
You have to install Docker in your machine which has linux kernel version 3.10+ first. You can refer to the official guide https://docs.docker.com/engine/installation/ for further information.
You can use ```docker pull ```to download images first, or just launch a container with ```docker run```:
```bash
docker run -it paddledev/paddle:cpu-latest
```
You can use :code:`docker pull ` to download images first, or just launch a container with :code:`docker run` \:
.. code-block:: bash
docker run -it paddledev/paddle:cpu-latest
If you want to launch container with GPU support, you need to set some environment variables at the same time:
docker run ${CUDA_SO} ${DEVICES} -it paddledev/paddle:gpu-latest
#### Performance
Some notes for docker
---------------------
Performance
+++++++++++
Since Docker is based on the lightweight virtual containers, the CPU computing performance maintains well. And GPU driver and equipments are all mapped to the container, so the GPU computing performance would not be seriously affected.
...
...
@@ -45,47 +87,36 @@ If you use high performance nic, such as RDMA(RoCE 40GbE or IB 56GbE), Ethernet(
#### Remote access
If you want to enable ssh access background, you need to build an image by yourself. Please refer to official guide https://docs.docker.com/engine/reference/builder/ for further information.
Remote access
+++++++++++++
Following is a simple Dockerfile with ssh:
```bash
FROM paddledev/paddle
MAINTAINER PaddlePaddle dev team <paddle-dev@baidu.com>
If you want to enable ssh access background, you need to build an image by yourself. Please refer to official guide https://docs.docker.com/engine/reference/builder/ for further information.
RUN apt-get update
RUN apt-get install -y openssh-server
RUN mkdir /var/run/sshd
RUN echo 'root:root' | chpasswd
Following is a simple Dockerfile with ssh:
RUN sed -ri 's/^PermitRootLogin\s+.*/PermitRootLogin yes/' /etc/ssh/sshd_config
RUN sed -ri 's/UsePAM yes/#UsePAM yes/g' /etc/ssh/sshd_config
Currently , PaddlePaddle only provides ubuntu14.04 debian packages.
There are two versions package, including CPU and GPU. The download address is:
PaddlePaddle supports :code:`deb` pacakge. The installation of this :code:`deb` package is tested in ubuntu 14.04, but it should be support other debian based linux, too.
There are four versions of debian package, :code:`cpu`, :code:`gpu`, :code:`cpu-noavx`, :code:`gpu-noavx`. And :code:`noavx` version is used to support CPU which does not contain :code:`AVX` instructions. The download url of :code:`deb` package is \: https://github.com/baidu/Paddle/releases/
After downloading PaddlePaddle deb packages, you can run:
After downloading PaddlePaddle deb packages, you can use :code:`gdebi` install.
```bash
dpkg -i paddle-0.8.0b-cpu.deb
apt-get install -f
```
And if you use GPU version deb package, you need to install CUDA toolkit and cuDNN, and set related environment variables(such as LD_LIBRARY_PATH) first. It is normal when `dpkg -i` get errors. `apt-get install -f` will continue install paddle, and install dependences.
.. code-block:: bash
gdebi paddle-*.deb
If :code:`gdebi` is not installed, you can use :code:`sudo apt-get install gdebi` to install it.
Or you can use following commands to install PaddlePaddle.
**Note**
.. code-block:: bash
dpkg -i paddle-*.deb
apt-get install -f
And if you use GPU version deb package, you need to install CUDA toolkit and cuDNN, and set related environment variables(such as LD_LIBRARY_PATH) first. It is normal when `dpkg -i` get errors. `apt-get install -f` will continue install paddle, and install dependences.
PaddlePaddle package only supports x86 CPU with AVX instructions. If not, you have to download and build from source code.
<spanid="docker-installation-guide"></span><h1>Docker installation guide<aclass="headerlink"href="#docker-installation-guide"title="Permalink to this headline">¶</a></h1>
<p>PaddlePaddle provides some pre-compiled binary, including Docker images, ubuntu deb packages. It is welcomed to contributed more installation package of different linux distribution (such as ubuntu, centos, debian, gentoo and so on). We recommend to use Docker images to deploy PaddlePaddle.</p>
<divclass="section"id="docker-installation">
<spanid="docker-installation"></span><h2>Docker installation<aclass="headerlink"href="#docker-installation"title="Permalink to this headline">¶</a></h2>
<p>Docker is a tool designed to make it easier to create, deploy, and run applications by using containers.</p>
<h1>Docker installation guide<aclass="headerlink"href="#docker-installation-guide"title="Permalink to this headline">¶</a></h1>
<p>PaddlePaddle provide the <aclass="reference external"href="https://www.docker.com/">Docker</a> image. <aclass="reference external"href="https://www.docker.com/">Docker</a> is a lightweight container utilities. The performance of PaddlePaddle in <aclass="reference external"href="https://www.docker.com/">Docker</a> container is basically as same as run it in a normal linux. The <aclass="reference external"href="https://www.docker.com/">Docker</a> is a very convenient way to deliver the binary release for linux programs.</p>
<divclass="admonition note">
<pclass="first admonition-title">Note</p>
<pclass="last">The <aclass="reference external"href="https://www.docker.com/">Docker</a> image is the recommended way to run PaddlePaddle</p>
<spanid="paddlepaddle-docker-images"></span><h3>PaddlePaddle Docker images<aclass="headerlink"href="#paddlepaddle-docker-images"title="Permalink to this headline">¶</a></h3>
<p>There are six Docker images:</p>
<h2>PaddlePaddle Docker images<aclass="headerlink"href="#paddlepaddle-docker-images"title="Permalink to this headline">¶</a></h2>
<p>There are 12 <aclass="reference external"href="https://hub.docker.com/r/paddledev/paddle/tags/">images</a> for PaddlePaddle, and the name is <codeclass="code docutils literal"><spanclass="pre">paddle-dev/paddle</span></code>, tags are:</p>
<tableborder="1"class="docutils">
<colgroup>
<colwidth="21%"/>
<colwidth="22%"/>
<colwidth="29%"/>
<colwidth="28%"/>
</colgroup>
<theadvalign="bottom">
<trclass="row-odd"><thclass="head"> </th>
<thclass="head">normal</th>
<thclass="head">devel</th>
<thclass="head">demo</th>
</tr>
</thead>
<tbodyvalign="top">
<trclass="row-even"><td>CPU</td>
<td>cpu-latest</td>
<td>cpu-devel-latest</td>
<td>cpu-demo-latest</td>
</tr>
<trclass="row-odd"><td>GPU</td>
<td>gpu-latest</td>
<td>gpu-devel-latest</td>
<td>gpu-demo-latest</td>
</tr>
<trclass="row-even"><td>CPU WITHOUT AVX</td>
<td>cpu-noavx-latest</td>
<td>cpu-devel-noavx-latest</td>
<td>cpu-demo-noavx-latest</td>
</tr>
<trclass="row-odd"><td>GPU WITHOUT AVX</td>
<td>gpu-noavx-latest</td>
<td>gpu-devel-noavx-latest</td>
<td>gpu-demo-noavx-latest</td>
</tr>
</tbody>
</table>
<p>And the three columns are:</p>
<ulclass="simple">
<li>normal: The docker image only contains binary of PaddlePaddle.</li>
<li>devel: The docker image contains PaddlePaddle binary, source code and essential build environment.</li>
<li>demo: The docker image contains the dependencies to run PaddlePaddle demo.</li>
</ul>
<p>And the four rows are:</p>
<ulclass="simple">
<li>paddledev/paddle:cpu-latest: PaddlePaddle CPU binary image.</li>
<li>paddledev/paddle:cpu-devel-latest: PaddlePaddle CPU binary image plus source code.</li>
<li>paddledev/paddle:gpu-devel-latest: PaddlePaddle GPU binary image plus source code.</li>
<li>paddledev/paddle:cpu-demo-latest: PaddlePaddle CPU binary image plus source code and demo</li>
<li>paddledev/paddle:gpu-demo-latest: PaddlePaddle GPU binary image plus source code and demo</li>
<li>CPU: CPU Version. Support CPU which has <codeclass="code docutils literal"><spanclass="pre">AVX</span></code> instructions.</li>
<li>GPU: GPU Version. Support GPU, and cpu has <codeclass="code docutils literal"><spanclass="pre">AVX</span></code> instructions.</li>
<li>CPU WITHOUT AVX: CPU Version, which support most CPU even doesn’t have <codeclass="code docutils literal"><spanclass="pre">AVX</span></code> instructions.</li>
<li>GPU WITHOUT AVX: GPU Version, which support most CPU even doesn’t have <codeclass="code docutils literal"><spanclass="pre">AVX</span></code> instructions.</li>
</ul>
<p>Tags with latest will be replaced by a released version.</p>
<p>User can choose any version depends on machine. The following script can help you to detect your CPU support <codeclass="code docutils literal"><spanclass="pre">AVX</span></code> or not.</p>
<p>If the output is <codeclass="code docutils literal"><spanclass="pre">Support</span><spanclass="pre">AVX</span></code>, then you can choose the AVX version of PaddlePaddle, otherwise, you need select <codeclass="code docutils literal"><spanclass="pre">noavx</span></code> version of PaddlePaddle. For example, the CPU develop version of PaddlePaddle is <codeclass="code docutils literal"><spanclass="pre">paddle-dev/paddle:cpu-devel-latest</span></code>.</p>
<p>The PaddlePaddle images don’t contain any entry command. You need to write your entry command to use this image. See <codeclass="code docutils literal"><spanclass="pre">Remote</span><spanclass="pre">Access</span></code> part or just use following command to run a <codeclass="code docutils literal"><spanclass="pre">bash</span></code></p>
<divclass="highlight-bash"><divclass="highlight"><pre><span></span>docker run -it paddledev/paddle:cpu-latest /bin/bash
<spanid="download-and-run-docker-images"></span><h3>Download and Run Docker images<aclass="headerlink"href="#download-and-run-docker-images"title="Permalink to this headline">¶</a></h3>
<p>You have to install Docker in your machine which has linux kernel version 3.10+ first. You can refer to the official guide https://docs.docker.com/engine/installation/ for further information.</p>
<p>You can use <codeclass="docutils literal"><spanclass="pre">docker</span><spanclass="pre">pull</span></code>to download images first, or just launch a container with <codeclass="docutils literal"><spanclass="pre">docker</span><spanclass="pre">run</span></code>:</p>
<h2>Download and Run Docker images<aclass="headerlink"href="#download-and-run-docker-images"title="Permalink to this headline">¶</a></h2>
<p>You have to install Docker in your machine which has linux kernel version 3.10+ first. You can refer to the official guide <aclass="reference external"href="https://docs.docker.com/engine/installation/">https://docs.docker.com/engine/installation/</a> for further information.</p>
<p>You can use <codeclass="code docutils literal"><spanclass="pre">docker</span><spanclass="pre">pull</span><spanclass="pre">`</span><spanclass="pre">to</span><spanclass="pre">download</span><spanclass="pre">images</span><spanclass="pre">first,</span><spanclass="pre">or</span><spanclass="pre">just</span><spanclass="pre">launch</span><spanclass="pre">a</span><spanclass="pre">container</span><spanclass="pre">with</span><spanclass="pre">:code:`docker</span><spanclass="pre">run</span></code>:</p>
<divclass="highlight-bash"><divclass="highlight"><pre><span></span>docker run -it paddledev/paddle:cpu-latest
</pre></div>
</div>
<p>If you want to launch container with GPU support, you need to set some environment variables at the same time:</p>
docker run ${CUDA_SO} ${DEVICES} -it paddledev/paddle:gpu-latest
</pre></div>
</div>
</div>
<divclass="section"id="notice">
<spanid="notice"></span><h3>Notice<aclass="headerlink"href="#notice"title="Permalink to this headline">¶</a></h3>
<divclass="section"id="some-notes-for-docker">
<h2>Some notes for docker<aclass="headerlink"href="#some-notes-for-docker"title="Permalink to this headline">¶</a></h2>
<divclass="section"id="performance">
<spanid="performance"></span><h4>Performance<aclass="headerlink"href="#performance"title="Permalink to this headline">¶</a></h4>
<h3>Performance<aclass="headerlink"href="#performance"title="Permalink to this headline">¶</a></h3>
<p>Since Docker is based on the lightweight virtual containers, the CPU computing performance maintains well. And GPU driver and equipments are all mapped to the container, so the GPU computing performance would not be seriously affected.</p>
<p>If you use high performance nic, such as RDMA(RoCE 40GbE or IB 56GbE), Ethernet(10GbE), it is recommended to use config “-net = host”.</p>
</div>
<divclass="section"id="remote-access">
<spanid="remote-access"></span><h4>Remote access<aclass="headerlink"href="#remote-access"title="Permalink to this headline">¶</a></h4>
<p>If you want to enable ssh access background, you need to build an image by yourself. Please refer to official guide https://docs.docker.com/engine/reference/builder/ for further information.</p>
<h3>Remote access<aclass="headerlink"href="#remote-access"title="Permalink to this headline">¶</a></h3>
<p>If you want to enable ssh access background, you need to build an image by yourself. Please refer to official guide <aclass="reference external"href="https://docs.docker.com/engine/reference/builder/">https://docs.docker.com/engine/reference/builder/</a> for further information.</p>
<h2>Build from Source<aclass="headerlink"href="#build-from-source"title="Permalink to this headline">¶</a></h2>
<divclass="admonition warning">
<pclass="first admonition-title">Warning</p>
<pclass="last">Please use <codeclass="code docutils literal"><spanclass="pre">deb</span></code> package or <codeclass="code docutils literal"><spanclass="pre">docker</span></code> image to install paddle. The building guide is used for hacking or contributing to PaddlePaddle.</p>
</div>
<p>If you want to hack and contribute PaddlePaddle source code, following guides can help you:</p>
<h2>Docker and Debian Package installation<aclass="headerlink"href="#docker-and-debian-package-installation"title="Permalink to this headline">¶</a></h2>
<p>Note: The installation packages are still in pre-release
state and your experience of installation may not be smooth.</p>
<p>If you want to pack docker image, the following guide can help you:</p>
<spanid="debian-package-installation-guide"></span><h1>Debian Package installation guide<aclass="headerlink"href="#debian-package-installation-guide"title="Permalink to this headline">¶</a></h1>
<spanid="debian-package-installation"></span><h2>Debian Package installation<aclass="headerlink"href="#debian-package-installation"title="Permalink to this headline">¶</a></h2>
<p>Currently , PaddlePaddle only provides ubuntu14.04 debian packages.
There are two versions package, including CPU and GPU. The download address is:</p>
<h1>Debian Package installation guide<aclass="headerlink"href="#debian-package-installation-guide"title="Permalink to this headline">¶</a></h1>
<p>PaddlePaddle supports <codeclass="code docutils literal"><spanclass="pre">deb</span></code> pacakge. The installation of this <codeclass="code docutils literal"><spanclass="pre">deb</span></code> package is tested in ubuntu 14.04, but it should be support other debian based linux, too.</p>
<p>There are four versions of debian package, <codeclass="code docutils literal"><spanclass="pre">cpu</span></code>, <codeclass="code docutils literal"><spanclass="pre">gpu</span></code>, <codeclass="code docutils literal"><spanclass="pre">cpu-noavx</span></code>, <codeclass="code docutils literal"><spanclass="pre">gpu-noavx</span></code>. And <codeclass="code docutils literal"><spanclass="pre">noavx</span></code> version is used to support CPU which does not contain <codeclass="code docutils literal"><spanclass="pre">AVX</span></code> instructions. The download url of <codeclass="code docutils literal"><spanclass="pre">deb</span></code> package is : <aclass="reference external"href="https://github.com/baidu/Paddle/releases/">https://github.com/baidu/Paddle/releases/</a></p>
<p>After downloading PaddlePaddle deb packages, you can use <codeclass="code docutils literal"><spanclass="pre">gdebi</span></code> install.</p>
<p>And if you use GPU version deb package, you need to install CUDA toolkit and cuDNN, and set related environment variables(such as LD_LIBRARY_PATH) first. It is normal when <codeclass="docutils literal"><spanclass="pre">dpkg</span><spanclass="pre">-i</span></code> get errors. <codeclass="docutils literal"><spanclass="pre">apt-get</span><spanclass="pre">install</span><spanclass="pre">-f</span></code> will continue install paddle, and install dependences.</p>
<p><strong>Note</strong></p>
<p>PaddlePaddle package only supports x86 CPU with AVX instructions. If not, you have to download and build from source code.</p>
<p>If <codeclass="code docutils literal"><spanclass="pre">gdebi</span></code> is not installed, you can use <codeclass="code docutils literal"><spanclass="pre">sudo</span><spanclass="pre">apt-get</span><spanclass="pre">install</span><spanclass="pre">gdebi</span></code> to install it.</p>
<p>Or you can use following commands to install PaddlePaddle.</p>
<p>And if you use GPU version deb package, you need to install CUDA toolkit and cuDNN, and set related environment variables(such as LD_LIBRARY_PATH) first. It is normal when <cite>dpkg -i</cite> get errors. <cite>apt-get install -f</cite> will continue install paddle, and install dependences.</p>
$ docker run -it paddledev/paddlepaddle:latest-gpu
$ docker run <spanclass="si">${</span><spanclass="nv">CUDA_SO</span><spanclass="si">}</span><spanclass="si">${</span><spanclass="nv">DEVICES</span><spanclass="si">}</span>-it paddledev/paddlepaddle:latest-gpu