<td><code> apt install patchelf </code> or read github <ahref="https://gist.github.com/ruario/80fefd174b3395d34c14">patchELF official documentation</a></td>
</tr>
<tr>
<td> go </td>
<td> >=1.8 </td>
<td> optional </td>
<td></td>
</tr>
</tbody>
</table>
</p>
***
<aname="Compile"></a>
</br></br>
## **Compile Option Table**
<palign="center">
<table>
<thead>
<tr>
<th> Option </th>
<th> Description </th>
<th> Default </th>
</tr>
</thead>
<tbody>
<tr>
<td> WITH_GPU </td>
<td> Whether to support GPU </td>
<td> ON </td>
</tr>
<tr>
<td> WITH_C_API </td>
<td> Whether to compile CAPI </td>
<td> OFF </td>
</tr>
<tr>
<td> WITH_DOUBLE </td>
<td> Whether to use double precision floating point numeber </td>
<td> OFF </td>
</tr>
<tr>
<td> WITH_DSO </td>
<td> whether to load CUDA dynamic libraries dynamically at runtime, instead of statically loading CUDA dynamic libraries. </td>
<td> ON </td>
</tr>
<tr>
<td> WITH_AVX </td>
<td> whether to compile PaddlePaddle binaries file containing the AVX instruction set </td>
<td> ON </td>
</tr>
<tr>
<td> WITH_PYTHON </td>
<td> Whether the PYTHON interpreter is embedded </td>
<td> ON </td>
</tr>
<tr>
<td> WITH_STYLE_CHECK </td>
<td> Whether to perform code style checking at compile time </td>
<td> ON </td>
</tr>
<tr>
<td> WITH_TESTING </td>
<td> Whether to turn on unit test </td>
<td> OFF </td>
</tr>
<tr>
<td> WITH_DOC </td>
<td> Whether to compile Chinese and English documents </td>
<td> OFF </td>
</tr>
<tr>
<td> WITH_SWIG_PY </td>
<td> Whether to compile PYTHON's SWIG interface, which can be used for predicting and customizing training </td>
<td> Auto </td>
<tr>
<td> WITH_GOLANG </td>
<td> Whether to compile the fault-tolerant parameter server of the go language </td>
<td> OFF </td>
</tr>
<tr>
<td> WITH_MKL </td>
<td> Whether to use the MKL math library, if not,using OpenBLAS </td>
<td> ON </td>
</tr>
<tr>
<td> WITH_SYSTEM_BLAS </td>
<td> Whether to use the system's BLAS </td>
<td> OFF </td>
</tr>
<tr>
<td> WITH_DISTRIBUTE </td>
<td> Whether to Compile with distributed version </td>
<td> OFF </td>
</tr>
<tr>
<td> WITH_RDMA </td>
<td> Whether to compile the relevant parts that supports RDMA </td>
<td> OFF </td>
</tr>
<tr>
<td> WITH_BRPC_RDMA </td>
<td> Whether to use BRPC RDMA as RPC protocol </td>
<td> OFF </td>
</tr>
<tr>
<td> ON_INFER </td>
<td> Whether to turn on prediction optimization </td>
<td> OFF </td>
</tr>
<tr>
<td> DWITH_ANAKIN </td>
<td> Whether to Compile ANAKIN </td>
<td> OFF </td>
</tr>
<tr>
<td> CUDA_ARCH_NAME </td>
<td> Build for which GPU architecture </td>
<td> All:all available GPU architectures Auto:Automatically detect current GPU architecture </td>
</tr>
<tr>
<td> TENSORRT_ROOT </td>
<td> Assign TensoRRT path </td>
<td> If this flag is not assigned, Paddle will detect TensorRT automatically. </td>
</tr>
</tbody>
</table>
</p>
**BLAS**
PaddlePaddle supports two BLAS libraries, [MKL](https://software.intel.com/en-us/mkl) and [OpenBlAS](http://www.openblas.net/). MKL is used by default. If you use MKL and the machine contains the AVX2 instruction set, you will also download the MKL-DNN math library, for details please refer to [here](https://github.com/PaddlePaddle/Paddle/tree/release/0.11.0/doc/design/mkldnn#cmake).
If you close MKL, OpenBLAS will be used as the BLAS library.
**CUDA/cuDNN**
PaddlePaddle automatically finds the CUDA and cuDNN libraries installed in the system for compilation and execution at compile time/runtime. Use the parameter `-DCUDA_ARCH_NAME=Auto` to specify to enable automatic detection of the SM architecture and speed up compilation.
PaddlePaddle can be compiled and run using any version after cuDNN v5.1, but try to keep the same version of cuDNN in the compiling and running processes. We recommend using the latest version of cuDNN.
**Configure Compile Options**
PaddePaddle implements references to various BLAS/CUDA/cuDNN libraries by specifying paths at compile time. When cmake compiles, it first searches the system paths ( `/usr/liby` and `/usr/local/lib` ) for these libraries, and also reads the relevant path variables for searching. Can be set by using the `-D` command, for example:
**Note**: The settings introduced here for these compilation options are only valid for the first cmake. If you want to reset it later, it is recommended to clean up the entire build directory ( rm -rf ) and then specify it.
***
<aname="whls"></a>
</br></br>
## **Installation Package List**
<palign="center">
<table>
<thead>
<tr>
<th> Version Number </th>
<th> Release Discription </th>
</tr>
</thead>
<tbody>
<tr>
<td> paddlepaddle==[version code] such as paddlepaddle==1.5.1 </td>
<td> Only support the corresponding version of the CPU PaddlePaddle, please refer to <ahref=https://pypi.org/project/paddlepaddle/#history>Pypi</a> for the specific version. </td>
</tr>
<tr>
<td> paddlepaddle-gpu==1.5.1 </td>
<td> Using version 1.5.1 compiled with CUDA 9.0 and cuDNN 7 </td>
</tr>
<tr>
<td> paddlepaddle-gpu==1.5.1.post87 </td>
<td> Using version 1.5.1 compiled with CUDA 8.0 and cuDNN 7 </td>
</tr>
</tbody>
</table>
</p>
You can find various distributions of PaddlePaddle-gpu in [the Release History](https://pypi.org/project/paddlepaddle-gpu/#history).
Please note that: paddlepaddle-gpu in windows, will download package compiled with CUDA 8.0 and cuDNN 7
## Execute the PaddlePaddle training program in Docker
***
Suppose you have written a PaddlePaddle program in the current directory (such as /home/work): `train.py` ( refer to [PaddlePaddleBook](https://github.com/PaddlePaddle/book/blob/develop/01.fit_a_line/README.cn.md) to write), you can start the training with the following command:
cd /home/work
docker run -it -v $PWD:/work hub.baidubce.com/paddlepaddle/paddle /work/train.py
In the above commands, the `-it` parameter indicates that the container has been run interactively; `-v $PWD:/work` specifies that the current path (the absolute path where the PWD variable in Linux will expand to the current path) is mounted to the `:/work` directory inside the container: `Hub.baidubce.com/paddlepaddle/paddle` specifies the container to be used; finally `/work/train.py` is the command executed inside the container, ie. the training program.
Of course, you can also enter into the Docker container and execute or debug your code interactively:
docker run -it -v $PWD:/work hub.baidubce.com/paddlepaddle/paddle /bin/bash
cd /work
python train.py
**Note: In order to reduce the size, vim is not installed in PaddlePaddle Docker image by default. You can edit the code in the container after executing **`apt-get install -y vim`**(which installs vim for you) in the container.**
</br></br>
## Start PaddlePaddle Book tutorial with Docker
***
Use Docker to quickly launch a local Jupyter Notebook containing the PaddlePaddle official Book tutorial, which can be viewed on the web. PaddlePaddle Book is an interactive Jupyter Notebook for users and developers. If you want to learn more about deep learning, PaddlePaddle Book is definitely your best choice. You can read tutorials or create and share interactive documents with code, formulas, charts, and text.
We provide a Docker image that can run the PaddlePaddle Book directly, running directly:
`docker run -p 8888:8888 hub.baidubce.com/paddlepaddle/book`
Domestic users can use the following image source to speed up access:
`docker run -p 8888:8888 hub.baidubce.com/paddlepaddle/book`
Then enter the following URL in your browser:
`http://localhost:8888/`
It's that simple and bon voyage! For further questions, please refer to the [FAQ](#FAQ).
</br></br>
## Perform GPU training using Docker
***
In order to ensure that the GPU driver works properly in the image, we recommend using [nvidia-docker](https://github.com/NVIDIA/nvidia-docker) to run the image. Don't forget to install the latest GPU drivers on your physical machine in advance.
`Nvidia-docker run -it -v $PWD:/work hub.baidubce.com/paddlepaddle/paddle:latest-gpu /bin/bash`
**Note: If you don't have nvidia-docker installed, you can try the following to mount the CUDA library and Linux devices into the Docker container:**
AVX is a set of CPU instructions that speeds up the calculation of PaddlePaddle. The latest PaddlePaddle Docker image is enabled by default for AVX compilation, so if your computer does not support AVX, you need to compile PaddlePaddle to no-avx version separately.
The following instructions can check if the Linux computer supports AVX: