diff --git a/doc/build/build_from_source.md b/doc/build/build_from_source.md index 9d3b0308028c5c6eef9e15124adabbbb86406233..2c32c37e9ddf58432abec31ed7954c3ebc1e9716 100644 --- a/doc/build/build_from_source.md +++ b/doc/build/build_from_source.md @@ -87,9 +87,9 @@ sudo apt-get install swig If you want to compile PaddlePaddle with doc, you need to add -DWITH_DOC=ON in cmake command and install these first: ```bash -pip install sphinx +pip install 'sphinx>=1.4.0' pip install sphinx_rtd_theme breathe recommonmark -sudo apt-get install python-sphinx doxygen +sudo apt-get install doxygen ``` ### Build and Install diff --git a/doc/build/docker_install.md b/doc/build/docker_install.md new file mode 100644 index 0000000000000000000000000000000000000000..997a755956bf2562bc1d2b73a0899cc7f6156727 --- /dev/null +++ b/doc/build/docker_install.md @@ -0,0 +1,91 @@ +Docker installation guide +==================== +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 Docker images +There are six Docker images: + +- paddledev/paddle:latest-cpu: PaddlePaddle CPU binary image. +- paddledev/paddle:latest-gpu: PaddlePaddle GPU binary image. +- paddledev/paddle:latest-cpu-devel: PaddlePaddle CPU binary image plus source code. +- paddledev/paddle:latest-gpu-devel: PaddlePaddle GPU binary image plus source code. +- paddledev/paddle:latest-cpu-demo: PaddlePaddle CPU binary image plus source code and demo +- paddledev/paddle:latest-gpu-demo: PaddlePaddle GPU binary image plus source code and demo + +Tags with latest will be replaced by a released version. + +### 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:lastest-cpu +``` + +If you want to launch container with GPU support, you need to set some environment variables at the same time: + +```bash +export CUDA_SO="$(\ls /usr/lib64/libcuda* | xargs -I{} echo '-v {}:{}') $(\ls /usr/lib64/libnvidia* | xargs -I{} echo '-v {}:{}" +export DEVICES=$(\ls /dev/nvidia* | xargs -I{} echo '--device {}:{}') +docker run -it paddledev/paddle:latest-gpu +``` + +### Notice + +#### 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. + +If you use high performance nic, such as RDMA(RoCE 40GbE or IB 56GbE), Ethernet(10GbE), it is recommended to use config "-net = host". + + + + +#### 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. + +Following is a simple Dockerfile with ssh: +```bash +FROM paddledev/paddle + +MAINTAINER PaddlePaddle dev team + +RUN apt-get update +RUN apt-get install -y openssh-server +RUN mkdir /var/run/sshd +RUN echo 'root:root' | chpasswd + +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 + +EXPOSE 22 + +CMD ["/usr/sbin/sshd", "-D"] +``` + +Then you can build an image with Dockerfile and launch a container: + +```bash +# cd into Dockerfile directory +docker build . -t paddle_ssh +# run container, and map host machine port 8022 to container port 22 +docker run -d -p 8022:22 --name paddle_ssh_machine paddle_ssh +``` +Now, you can ssh on port 8022 to access the container, username is root, password is also root: + +```bash +ssh -p 8022 root@YOUR_HOST_MACHINE +``` + + +You can stop and delete the container as following: +```bash +# stop +docker stop paddle_ssh_machine +# delete +docker rm paddle_ssh_machine +``` diff --git a/doc/build/index.rst b/doc/build/index.rst index 2227234d77366898ae2d6c14c332e5fb5031bde1..6fefa7990ae461ba706482fe5b1c7fbe32686827 100644 --- a/doc/build/index.rst +++ b/doc/build/index.rst @@ -20,10 +20,10 @@ If you want to hack and contribute PaddlePaddle source code, following guides ca build_from_source.md contribute_to_paddle.md -Build Docker Images -------------------- +Docker and Debian Package installation +-------------------------------------- -Note: The intallation packages are still in pre-release +Note: The installation packages are still in pre-release state and your experience of installation may not be smooth. If you want to pack docker image, the following guide can help you\: @@ -31,4 +31,6 @@ If you want to pack docker image, the following guide can help you\: .. toctree:: :glob: - docker/* + docker_install.md + ubuntu_install.md + diff --git a/doc/build/ubuntu_install.md b/doc/build/ubuntu_install.md new file mode 100644 index 0000000000000000000000000000000000000000..c30a8f6db5d9eb83390d9374d27aba46fa42a462 --- /dev/null +++ b/doc/build/ubuntu_install.md @@ -0,0 +1,21 @@ +Debian Package installation guide +================================= + +## Debian Package installation +Currently , PaddlePaddle only provides ubuntu14.04 debian packages. +There are two versions package, including CPU and GPU. The download address is: + +https://github.com/baidu/Paddle/releases/tag/V0.8.0b0 + + +After downloading PaddlePaddle deb packages, you can run: + +```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. + +**Note** + +PaddlePaddle package only supports x86 CPU with AVX instructions. If not, you have to download and build from source code.