Kunlun XPU PaddlePaddle Installation Tutorial¶
Currently, PaddleOCR supports Kunlun R200/R300 and other chips. Considering environmental differences, we recommend using the Kunlun XPU development image officially released by PaddlePaddle, which is pre-installed with the Kunlun basic runtime environment library (XRE). This guide mainly introduces installation and usage with PaddlePaddle. If you want to use a different inference engine, please follow that engine's official installation and configuration documentation.
1. Docker Environment Preparation¶
Pull the image. This image is only for the development environment and does not include a pre-compiled PaddlePaddle installation package.
docker pull registry.baidubce.com/device/paddle-xpu:ubuntu20-x86_64-gcc84-py310 # For X86 architecture
docker pull registry.baidubce.com/device/paddle-xpu:kylinv10-aarch64-gcc82-py310 # For ARM architecture
docker run -it --name=xxx -m 81920M --memory-swap=81920M \
--shm-size=128G --privileged --net=host \
-v $(pwd):/workspace -w /workspace \
registry.baidubce.com/device/paddle-xpu:$(uname -m)-py310 bash
2. Install Paddle Package¶
Currently, Python3.10 wheel installation packages are provided. If you have a need for other Python versions, you can refer to the PaddlePaddle official documentation to compile and install them yourself.
Install the Python3.10 wheel installation package:
pip install https://paddle-whl.bj.bcebos.com/paddlex/xpu/paddlepaddle_xpu-2.6.1-cp310-cp310-linux_x86_64.whl # For X86 architecture
pip install https://paddle-whl.bj.bcebos.com/paddlex/xpu/paddlepaddle_xpu-2.6.1-cp310-cp310-linux_aarch64.whl # For ARM architecture
Verify the installation package. After installation, run the following command:
The expected output is: