index_en.rst 20.0 KB
Newer Older
1
..  _install_introduction_:
2 3 4 5
======================
 Installation Manuals
======================

6
The manuals will guide you to build and install PaddlePaddle on your 64-bit desktop or laptop.
7

8 9
1. Operating system requirements:
============================
10

11 12 13 14 15
* Windows 7 / 8 / 10, Pro/Enterprise
* Ubuntu 14.04 / 16.04 / 18.04
* CentOS 6 / 7
* MacOS 10.11 / 10.12 / 10.13 / 10.14
* 64-bit operating system is required
16

17 18
2. Processor requirements:
============================
19

20 21
* Processor supports MKL
* The processor architecture is x86_64(or called x64, Intel 64, AMD64). Currently, PaddlePaddle does not support arm64.
22

23 24
3. Version requirements of python and pip:
============================
25

26 27 28 29
* Python 2 requires version 2.7.15+
* Python 3 requires version 3.5.1+/3.6/3.7
* Python needs pip, and pip requires version 9.0.1+
* Python and pip requires 64-bit
30

31 32
4. PaddlePaddle's support for GPU:
=================================
33

34 35 36
* Currently, **PaddlePaddle** only supports **CUDA** driver of **NVIDIA** graphics card.
* You need to install `cuDNN <https://docs.nvidia.com/deeplearning/sdk/cudnn-install/>`_ , and version 7.3+ is required(For CUDA9/10) 
* If you need GPU multi-card mode, you need to install `NCCL 2 <https://developer.nvidia.com/nccl/>`_
37

38 39
    * Only Ubuntu/CentOS support NCCL 2
* You need to install `CUDA <https://docs.nvidia.com/cuda/cuda-installation-guide-windows/>`_ , depending on your system, there are different requirements for CUDA version:
40

41
    * Windows install GPU version
42

43 44 45
        * Windows 7 / 8 / 10 support CUDA 9.0 / 10.0 single-card mode, but don't support CUDA 9.1/9.2/10.1		
        * don't support install using **nvidia-docker** 
    * Ubuntu install GPU version
46

47 48 49 50 51
        * Ubuntu 14.04 supports CUDA 10.0/10.1, but doesn't support CUDA 9.0/9.1/9.2
        * Ubuntu 16.04 supports CUDA 9.0/9.1/9.2/10.0/10.1
        * Ubuntu 18.04 supports CUDA 10.0/10.1, but doesn't support CUDA 9.0/9.1/9.2
        * If you install using **nvidia-docker** , it supports CUDA 9.0/9.1/9.2/10.0/10.1
    * CentOS install GPU version
52

53
        * If you install using native **pip** :
54

55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528
            * CentOS 7 supports CUDA 9.0/9.1/9.2/10.0/10.1, CUDA 9.1 supports single-card mode only
            * CentOS 6 supports CUDA 9.0/9.1/9.2/10.0/10.1 single-card mode
        * If you compile and install using native source code:

            * CentOS 7 supports CUDA 9.0/9.1/9.2/10.0/10.1, CUDA 9.1 supports single-card mode only
            * CentOS 6 is not recommended, we don't provide official support in case of compilation problems
        * If you install using  **nvidia-docker** , CentOS 7 supports CUDA 9.0/9.1/9.2/10.0/10.1
    * MacOS isn't supported: PaddlePaddle has no GPU support in Mac OS platform

Please make sure your environment meets the above conditions. If you have other requirements, please refer to `Appendix <Tables_en.html#ciwhls>`_ .

5. PaddlePaddle's support for NCCL:
=================================

* Support for Windows

    * not support NCCL
* Support for Ubuntu

    * Ubuntu 14.04:

        * support NCCL v2.4.2-v2.4.8 under CUDA10.1 
        * support NCCL v2.3.7-v2.4.8 under CUDA10.0
    * Ubuntu 16.04:

        * support NCCL v2.4.2-v2.4.8 under CUDA10.1
        * support NCCL v2.3.7-v2.4.8 under CUDA10.0/9.2/9.0        
        * support NCCL v2.1.15 under CUDA9.1
    * Ubuntu 18.04:

        * support v2.4.2-v2.4.8 under CUDA10.1 
        * support NCCL v2.3.7-v2.4.8 under CUDA10.0 
* Support for CentOS

    * CentOS 6: not support NCCL
    * CentOS 7:

        * support NCCL v2.4.2-v2.4.8 under CUDA10.1 
        * support NCCL v2.3.7-v2.4.8 under CUDA10.0/9.2/9.0 
* Support for MacOS

    * not support NCCL


The first way to install: use pip to install
================================

You can choose any of the four ways to install: "use pip to install", "use Conda to install", "use Docker to install", "compiling from the source code"

This section describes how to use pip to install.

1. You need to confirm that your operating system meets the requirements listed above

2. You need to confirm that your processor meets the requirements listed above

3. Confirm that the Python where you need to install PaddlePaddle is your expected location, because your computer may have multiple Python

    If you are using Python 2, use the following command to output Python path. Depending on your environment, you may need to replace Python in all command lines in the description with specific Python path
    
        In the Windows environment, the command to output Python path is:
        
        ::

            where python

        In the MacOS/Linux environment, the command to output Python path is:

        ::

            which python

    If you are using Python 3, use the following command to output Python path. Depending on your environment, you may need to replace Python in all command lines in the description with specific Python path

        In the Windows environment, the command to output Python path is:

        ::

            where python3

        In the MacOS/Linux environment, the command to output Python path is:

        ::

            which python3

4. Check the version of Python

    If you are using Python 2,confirm it is 2.7.15+ using command
    ::
    
        python --version

    If you are using Python 3,confirm it is 3.5.1+/3.6/3.7 using command
    ::
    
        python3 --version
    
5. Check the version of pip and confirm it is 9.0.1+  

    If you are using Python 2
    ::
    
        python -m ensurepip 
        python -m pip --version

    If you are using Python 3
    ::
    
        python3 -m ensurepip
        python3 -m pip --version

6. Confirm that Python and pip is 64 bit,and the processor architecture is x86_64(or called x64、Intel 64、AMD64)architecture. Currently, PaddlePaddle doesn't support arm64 architecture. The first line below outputs "64bit", and the second line outputs "x86_64", "x64" or "AMD64" :

    If you use Python 2
    ::

        python -c "import platform;print(platform.architecture()[0]);print(platform.machine())"

    If you use Python 3
    ::
    
        python3 -c "import platform;print(platform.architecture()[0]);print(platform.machine())"

7. If you want to use `pip <https://pypi.org/project/pip/>`_ to install PaddlePaddle, you can use the command below directly:

    (1). **CPU version** : If you only want to install CPU version, please refer to command below

        If you are using Python 2, command to install CPU version is:
        ::
    
            python -m pip install paddlepaddle -i https://mirror.baidu.com/pypi/simple

            or

            python -m pip install paddlepaddle -i https://pypi.tuna.tsinghua.edu.cn/simple
        
        If you are using Python 3, command to install CPU version is:
        ::
    
            python3 -m pip install paddlepaddle -i https://mirror.baidu.com/pypi/simple

            or

            python3 -m pip install paddlepaddle -i https://pypi.tuna.tsinghua.edu.cn/simple

    (2). **GPU version** : If you only want to install GPU version, please refer to command below


        Note:

            * You need to confirm that your GPU meets the requirements listed above

        If you are using Python2, please attention that PaddlePaddle installed through command below supports CUDA10.0 under Windows、Ubuntu、CentOS by default:
        ::

            python -m pip install paddlepaddle-gpu -i https://mirror.baidu.com/pypi/simple

            or

            python -m pip install paddlepaddle-gpu -i https://pypi.tuna.tsinghua.edu.cn/simple

        If you are using Python 2, CUDA 9, cuDNN 7.3+, command to install GPU version:
        ::

            python -m pip install paddlepaddle-gpu==1.7.1.post97 -i https://mirror.baidu.com/pypi/simple

            or

            python -m pip install paddlepaddle-gpu==1.7.1.post97 -i https://pypi.tuna.tsinghua.edu.cn/simple

        If you are using Python 2, CUDA 10.0, cuDNN 7.3+, command to install GPU version:
        ::

            python -m pip install paddlepaddle-gpu==1.7.1.post107 -i https://mirror.baidu.com/pypi/simple

            or

            python -m pip install paddlepaddle-gpu==1.7.1.post107 -i https://pypi.tuna.tsinghua.edu.cn/simple
        
        If you are using Python 3, please change **python** in the above command to **python3** and install.

8. Verify installation

    After the installation is complete, you can use `python` or `python3` to enter the Python interpreter and then use `import paddle.fluid as fluid` and then  `fluid.install_check.run_check()` to verify that the installation was successful.

    If `Your Paddle Fluid is installed succesfully!` appears, it means the installation was successful.


9. For more information to help, please refer to:

    `install under Ubuntu <install_Ubuntu_en.html>`_

    `install under CentOS <install_CentOS_en.html>`_

    `install under MacOS <install_MacOS_en.html>`_

    `install under Windows <install_Windows_en.html>`_


The second way to install: use Conda to install
================================

You can choose any of the four ways to install: "use pip to install", "use Conda to install", "use Docker to install", "compiling from the source code"

This section describes how to use Conda to install.

1. You need to confirm that your operating system meets the requirements listed above

2. You need to confirm that your processor meets the requirements listed above

3. Confirm that the Python where you need to install PaddlePaddle is your expected location, because your computer may have multiple Python


3. For domestic users unable to connect to the official source of anaconda, you can add Tsinghua source for installation according to the following command.

    ::

        conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/
        conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main/
        conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/Paddle/
        conda config --set show_channel_urls yes

4. If you need to create a new Conda virtual environment specifically for Paddle to use (the environment name after --name, you can choose by yourself):

    If you are using Python2 under Window
    
    ::

        conda create --name paddle python=2.7
        activate paddle

    If you are using Python2 under MacOS/Linux

    ::

        conda create --name paddle python=2.7
        conda activate paddle

   If you are using Python3 under Window, note: python3 version can be 3.5.1+/3.6/3.7

    ::

        conda create --name paddle python=3.7
        activate paddle

    If you are using Python3 under MacOS/Linux, note: python3 version can be 3.5.1+/3.6/3.7

    ::

        conda create --name paddle python=3.7
        conda activate paddle

5. Confirm that the Python where you need to install PaddlePaddle is your expected location, because your computer may have multiple Python, enter Anaconda's command-line terminal, enter the following instructions to confirm the Python location

    If you use Python 2, use the following command to output Python path. Depending on your environment, you may need to replace Python in all command lines in the description with specific Python path
        
        In the Windows environment, the command to output Python path is:
        
        ::

            where python

        In the MacOS/Linux environment, the command to output Python path is:

        ::

            which python

    If you use Python 3, use the following command to output Python path. Depending on your environment, you may need to replace Python3 in all command lines in the description with Python or specific Python path

        In the Windows environment, the command to output Python path is:
        
        ::

            where python3

        In the MacOS/Linux environment, the command to output Python path is:

        ::

            which python3

6. Check the version of Python

    If you are using Python 2, use the following command to confirm it is 2.7.15+
    ::
    
        python --version

    If you are using Python 3, use the following command to confirm it is 3.5.1+/3.6/3.7
    ::
    
        python3 --version
    
7. Check the version of pip and confirm it is 9.0.1+  

    If you are using Python 2
    ::
    
        python -m ensurepip 
        python -m pip --version

    If you are using Python 3
    ::
    
        python3 -m ensurepip
        python3 -m pip --version

8. Confirm Python and pip is 64 bit, and the processor architecture is x86_64(or called x64,Intel 64,AMD64) architecture. Currently, PaddlePaddle doesn't support arm64 architecture. The first line below outputs "64bit", and the second line outputs "x86_64", "x64" or "AMD64":

    If you are using Python 2
    ::

        python -c "import platform;print(platform.architecture()[0]);print(platform.machine())"

    If you are using Python 3
    ::
    
        python3 -c "import platform;print(platform.architecture()[0]);print(platform.machine())"

9. If you want to use Conda to install PaddlePaddle, you can directly use commands below:

    (1). **CPU version** :If you just want to install the CPU version, please refer to the following command installation

    ::

        conda install paddlepaddle
    

    (2). **GPU version** :If you just want to install the GPU version, please refer to the following command installation

        Note:

            * You need to confirm that your GPU meets the requirements listed above

        If you are using CUDA 8,cuDNN 7.1+, the command to install GPU version:
        ::
    
            conda install paddlepaddle-gpu cudatoolkit=8.0

        If you are using CUDA 9,cuDNN 7.3+, the command to install GPU version:
        ::
    
            conda install paddlepaddle-gpu cudatoolkit=9.0
        

        If you are using CUDA 10.0,cuDNN 7.3+, the command to install GPU version::
        ::
    
            conda install paddlepaddle-gpu cudatoolkit=10.0

10. Verify installation

    After the installation is complete, you can use `python` or `python3` to enter the Python interpreter and then use `import paddle.fluid as fluid` and then  `fluid.install_check.run_check()` to verify that the installation was successful.

    If `Your Paddle Fluid is installed succesfully!` appears, it means the installation was successful.


11. For more information to help, please refer to:

    `install under conda <install_Conda_en.html>`_


The third way to install: use Docker to install
================================

You can choose any of the four ways to install: "use pip to install", "use Conda to install", "use Docker to install", "compiling from the source code"

This section describes how to use Docker to install.

If you want to use `docker <https://www.docker.com>`_ to install PaddlePaddle, you can use command below:

1. **CPU version**

    (1). At first you need to install `docker <https://www.docker.com>`_

    Note:

        * CentOS 6 not support docker installation

        * processor need supporting MKL

    (2). Pull the image of the preinstalled PaddlePaddle:
    ::

        docker pull hub.baidubce.com/paddlepaddle/paddle:1.7.1

    (3). Use the image to build and enter the Docker container:
    ::

        docker run --name paddle -it -v dir1:dir2 hub.baidubce.com/paddlepaddle/paddle:1.7.1 /bin/bash

        > --name [Name of container] set the name of Docker;

        > -it The parameter indicates that the container has been operated interactively with the local machine;

        > -v Parameter is used to share files between the host and the container. dir1 is the host directory and dir2 is the directory mounted inside the container. Users can customize their own mounting directory by setting dir1 and dir2.For example, $PWD:/paddle specifies to mount the current path of the host (PWD variable in Linux will expand to the absolute path of the current path) to the /paddle directory inside the container; 

        > hub.baidubce.com/paddlepaddle/paddle:1.7.1 is the image name you need to use;/bin/bash is the command to be executed in Docker

2. **GPU version**

    (1). At first you need to install `nvidia-docker <https://github.com/NVIDIA/nvidia-docker>`_

    Note:

        * processor need supporting MKL

        * Your computer needs to have NVIDIA graphics card supporting CUDA driver

        * You need to install `cuDNN <https://docs.nvidia.com/deeplearning/sdk/cudnn-install/>`_ ,version requires 7.3+(For CUDA9/10), 7.1+(For CUDA 8)

        * If you need GPU multi-card mode, you need to install `NCCL 2 <https://developer.nvidia.com/nccl/>`_

            * Only Ubuntu/CentOS support NCCL 2 technology

        * You need to install `CUDA <https://docs.nvidia.com/cuda/cuda-installation-guide-windows/>`_ , depending on your system, there are different requirements for CUDA version:

            * Ubuntu/CentOS 7 ,if you use nvidia-docker to install, CUDA 8.0/9.0/9.1/9.2/10.0 is supported

            * Windows/MacOS/CentOS 6 not support nvidia-docker to install


    (2). Pull the image that supports CUDA 10.0, cuDNN 7.3 + pre installed PaddlePaddle:
    ::

        nvidia-docker pull hub.baidubce.com/paddlepaddle/paddle:1.7.1-gpu-cuda10.0-cudnn7

    (3). Use the image to build and enter the docker container:
    ::

        nvidia-docker run --name paddle -it -v dir1:dir2 hub.baidubce.com/paddlepaddle/paddle:1.7.1-gpu-cuda10.0-cudnn7 /bin/bash

        > --name [Name of container] set name of Docker;

        > -it The parameter indicates that the container has been operated interactively with the local machine;

        > -v Parameter is used to share files between the host and the container. dir1 is the host directory and dir2 is the directory mounted inside the container. Users can customize their own mounting directory by setting dir1 and dir2.For example, $PWD:/paddle specifies to mount the current path of the host (PWD variable in Linux will expand to the absolute path of the current path) to the /paddle directory inside the container;

        > hub.baidubce.com/paddlepaddle/paddle:1.7.1 is the image name you need to use;/bin/bash is the command to be executed in Docker

    Or if you need the version supporting **CUDA 9**, replace **cuda10.0** of the above command with **cuda9.0** 

3. If your machine is not in China's mainland                                                                                                              , you can pull the image directly from DockerHub:

    ::

        docker run --name paddle -it -v dir1:dir2 paddlepaddle/paddle:1.7.1 /bin/bash

        > --name [Name of container] set name of Docker;

        > -it The parameter indicates that the container has been operated interactively with the local machine;

        > -v Parameter is used to share files between the host and the container. dir1 is the host directory and dir2 is the directory mounted inside the container. Users can customize their own mounting directory by setting dir1 and dir2.For example, $PWD:/paddle specifies to mount the current path of the host (PWD variable in Linux will expand to the absolute path of the current path) to the /paddle directory inside the container; 

        > paddlepaddle/paddle:1.7.1 is the image name you need to use;/bin/bash is the command to be executed in docker

4. Verify installation

    After the installation is complete, you can use `python` or `python3` to enter the Python interpreter and then use `import paddle.fluid as fluid` and then  `fluid.install_check.run_check()` to verify that the installation was successful.

    If `Your Paddle Fluid is installed succesfully!` appears, it means the installation was successful.


5. For more help, refer to:

   `use Docker to install <install_Docker_en.html>`_

	
The fourth way to install: compile and install with source code
====================================

- If you use PaddlePaddle only, we suggest you to choose one of the three installation methods **pip**, **conda**, **docker** to install.
- If you need to develop PaddlePaddle, please refer to `compile from source code <compile/fromsource.html>`_
529 530 531 532 533 534 535 536

..	toctree::
	:hidden:

	install_Ubuntu_en.md
	install_CentOS_en.md
	install_MacOS_en.md
	install_Windows_en.md
W
wangchaochaohu 已提交
537
        install_Conda_en.md
538
        install_Docker_en.md
539
	compile/fromsource_en.rst
X
xsrobin 已提交
540
	Tables_en.md