Install on Linux via PIP¶
Environmental preparation¶
1.1 How to check your environment¶
You can use the following commands to view the local operating system and bit information
uname -m && cat /etc/*release
Confirm that the Python where you need to install PaddlePaddle is your expected location, because your computer may have multiple Python
Use the following command to output Python path. Depending on the environment, you may need to replace Python in all command lines in the description with specific Python path
which python3
You need to confirm whether the version of Python meets the requirements
Use the following command to confirm that it is 3.8/3.9/3.10/3.11/3.12
python3 --version
It is required to confirm whether the version of pip meets the requirements. The version of pip is required to be 20.2.2 or above
python3 -m ensurepip
python3 -m pip --version
You need to confirm that Python and pip are 64bit, and the processor architecture is x86_64(or called x64、Intel 64、AMD64). The first line below outputs “64bit”, and the second line outputs “x86_64”, “x64” or “AMD64”
python3 -c "import platform;print(platform.architecture()[0]);print(platform.machine())"
The installation package provided by default requires computer support for MKL
If you do not know the machine environment, please download and useQuick install script, for instructions please refer tohere。
INSTALLATION¶
Choose CPU/GPU¶
If your computer doesn’t have NVIDIA® GPU, please install the CPU Version of PaddlePaddle
If your computer has NVIDIA® GPU, please make sure that the following conditions are met and install the GPU Version of PaddlePaddle
CUDA toolkit 11.2 with cuDNN v8.2.1(for multi card support, NCCL2.7 or higher;for PaddleTensorRT deployment, TensorRT8.0.3.4)
CUDA toolkit 11.6 with cuDNN v8.4.0(for multi card support, NCCL2.7 or higher;for PaddleTensorRT deployment, TensorRT8.4.0.6)
CUDA toolkit 11.7 with cuDNN v8.4.1(for multi card support, NCCL2.7 or higher;for PaddleTensorRT deployment, TensorRT8.4.2.4)
CUDA toolkit 11.8 with cuDNN v8.6.0(for multi card support, NCCL2.7 or higher;for PaddleTensorRT deployment, TensorRT8.5.1.7)
CUDA toolkit 12.0 with cuDNN v8.9.1(for multi card support, NCCL2.7 or higher;for PaddleTensorRT deployment, TensorRT8.6.1.6)
Hardware devices with GPU computing power over 3.5
You can refer to NVIDIA official documents for installation process and configuration method of CUDA, cuDNN and TensorRT. Please refer to CUDA,cuDNN,TensorRT
If you need to use a multi-card environment, please make sure that you have installed nccl2 correctly, or install nccl2 according to the following instructions (here are the installation instructions of nccl2 under CUDA11.2 and cuDNN7. For more version installation information, please refer to NVIDIA Official Website):
rm -f /usr/local/lib/libnccl.so wget --no-check-certificate -q https://nccl2-deb.cdn.bcebos.com/libnccl-2.10.3-1+cuda11.4.x86_64.rpm wget --no-check-certificate -q https://nccl2-deb.cdn.bcebos.com/libnccl-devel-2.10.3-1+cuda11.4.x86_64.rpm wget --no-check-certificate -q https://nccl2-deb.cdn.bcebos.com/libnccl-static-2.10.3-1+cuda11.4.x86_64.rpm rpm -ivh libnccl-2.10.3-1+cuda11.4.x86_64.rpm rpm -ivh libnccl-devel-2.10.3-1+cuda11.4.x86_64.rpm rpm -ivh libnccl-static-2.10.3-1+cuda11.4.x86_64.rpm
Installation Step¶
You can choose the following version of PaddlePaddle to start installation:
2.1 CPU Version of PaddlePaddle¶
python3 -m pip install paddlepaddle==2.6.1 -i https://mirror.baidu.com/pypi/simple
2.2 GPU Version of PaddlePaddle¶
2.2.1 If you are using CUDA 11.2
python3 -m pip install paddlepaddle-gpu==2.6.1.post112 -i https://mirror.baidu.com/pypi/simple
CUDA11.2 with cuDNN dynamic library PaddlePaddle
python3 -m pip install paddlepaddle-gpu==2.6.1.post112 -f https://www.paddlepaddle.org.cn/whl/linux/cudnnin/stable.html
2.2.2 If you are using CUDA 11.6
python3 -m pip install paddlepaddle-gpu==2.6.1.post116 -f https://www.paddlepaddle.org.cn/whl/linux/mkl/avx/stable.html
CUDA11.6 with cuDNN dynamic library PaddlePaddle
python3 -m pip install paddlepaddle-gpu==2.6.1.post116 -f https://www.paddlepaddle.org.cn/whl/linux/cudnnin/stable.html
2.2.3 If you are using CUDA 11.7
python3 -m pip install paddlepaddle-gpu==2.6.1.post117 -f https://www.paddlepaddle.org.cn/whl/linux/mkl/avx/stable.html
CUDA11.7 with cuDNN dynamic library PaddlePaddle
python3 -m pip install paddlepaddle-gpu==2.6.1.post117 -f https://www.paddlepaddle.org.cn/whl/linux/cudnnin/stable.html
2.2.4 If you are using CUDA 11.8
python3 -m pip install paddlepaddle-gpu==2.6.1 -i https://mirror.baidu.com/pypi/simple
CUDA11.8 with cuDNN dynamic library PaddlePaddle, you can use the following command to download the wheel package to the local, and then use python3 -m pip install [name].whl
to install locally ([name] is the name of the wheel package)
python3 -m pip download paddlepaddle-gpu==2.6.1 -f https://www.paddlepaddle.org.cn/whl/linux/cudnnin/stable.html --no-index --no-deps
2.2.5 If you are using CUDA 12.0
python3 -m pip install paddlepaddle-gpu==2.6.1.post120 -f https://www.paddlepaddle.org.cn/whl/linux/mkl/avx/stable.html
CUDA12.0 with cuDNN dynamic library PaddlePaddle
python3 -m pip install paddlepaddle-gpu==2.6.1.post120 -f https://www.paddlepaddle.org.cn/whl/linux/cudnnin/stable.html
Note:
Please confirm that the Python where you need to install PaddlePaddle is your expected location, because your computer may have multiple Python. Depending on the environment, you may need to replace python3 in all command lines in the instructions with specific Python path.
The above commands install the
avx
andmkl
package by default. Paddle no longer supportsnoavx
package. To determine whether your machine supportsavx
, you can use the following command. If the output containsavx
, it means that the machine supportsavx
:cat /proc/cpuinfo | grep -i avx
If you want to install the Paddle package with
avx
andopenblas
, you can use the following command to download the wheel package to the local, and then usepython3 -m pip install [name].whl
to install locally ([name] is the name of the wheel package):python3 -m pip download paddlepaddle==2.6.1 -f https://www.paddlepaddle.org.cn/whl/linux/openblas/avx/stable.html --no-index --no-deps
Verify installation¶
After the installation is complete, you can use python3
to enter the Python interpreter and then use import paddle
and paddle.utils.run_check()
If PaddlePaddle is installed successfully!
appears, to verify that the installation was successful.
How to uninstall¶
Please use the following command to uninstall PaddlePaddle:
CPU version of PaddlePaddle:
python3 -m pip uninstall paddlepaddle
GPU version of PaddlePaddle:
python3 -m pip uninstall paddlepaddle-gpu