build multi arch

This commit is contained in:
2026-01-17 17:25:05 +01:00
parent a89ddd2d13
commit b96dc1ed91
5 changed files with 64 additions and 17 deletions

View File

@@ -126,7 +126,7 @@ docker buildx build -f Dockerfile.cpu \
--push .
```
### GPU Image (x86_64 only)
### GPU Image (x86_64 + ARM64 with local wheel)
```bash
docker build -f Dockerfile.gpu -t paddle-ocr-api:gpu .
@@ -174,7 +174,7 @@ This section documents GPU support findings based on testing on an NVIDIA DGX Sp
### PaddlePaddle GPU Platform Support
**Critical Finding:** PaddlePaddle-GPU does **NOT** support ARM64/aarch64 architecture.
**Note:** PaddlePaddle-GPU does NOT have prebuilt ARM64 wheels on PyPI, but ARM64 support is available via custom-built wheels.
| Platform | CPU | GPU |
|----------|-----|-----|
@@ -182,21 +182,22 @@ This section documents GPU support findings based on testing on an NVIDIA DGX Sp
| Windows x64 | ✅ | ✅ CUDA 10.2/11.x/12.x |
| macOS x64 | ✅ | ❌ |
| macOS ARM64 (M1/M2) | ✅ | ❌ |
| Linux ARM64 (Jetson/DGX) | ✅ | ❌ No wheels |
| Linux ARM64 (Jetson/DGX) | ✅ | ✅ Custom wheel required |
**Source:** [PaddlePaddle-GPU PyPI](https://pypi.org/project/paddlepaddle-gpu/) - only `manylinux_x86_64` and `win_amd64` wheels available.
**Source:** [PaddlePaddle-GPU PyPI](https://pypi.org/project/paddlepaddle-gpu/) - only `manylinux_x86_64` and `win_amd64` wheels available on PyPI. ARM64 wheels must be built from source or downloaded from Gitea packages.
### Why GPU Doesn't Work on ARM64
### ARM64 GPU Support
1. **No prebuilt wheels**: `pip install paddlepaddle-gpu` fails on ARM64 - no compatible wheels exist
2. **Not a CUDA issue**: The NVIDIA CUDA base images work fine on ARM64 (`nvidia/cuda:12.4.1-cudnn-runtime-ubuntu22.04`)
3. **Not a container toolkit issue**: `nvidia-container-toolkit` is installed and functional
4. **PaddlePaddle limitation**: The Paddle team hasn't compiled GPU wheels for ARM64
ARM64 GPU support is available but requires custom-built wheels:
When you run `pip install paddlepaddle-gpu` on ARM64:
```
ERROR: No matching distribution found for paddlepaddle-gpu
```
1. **No prebuilt PyPI wheels**: `pip install paddlepaddle-gpu` fails on ARM64 - no compatible wheels exist on PyPI
2. **Custom wheels work**: This project provides Dockerfiles to build ARM64 GPU wheels from source
3. **CI/CD builds ARM64 GPU images**: Pre-built wheels are available from Gitea packages
**To use GPU on ARM64:**
- Use the pre-built images from the container registry, or
- Build the wheel locally using `Dockerfile.build-paddle` (see Option 2 below), or
- Download the wheel from Gitea packages: `wheels/paddlepaddle_gpu-3.0.0-cp311-cp311-linux_aarch64.whl`
### Options for ARM64 Systems