diff --git a/docker/china/dcu.Dockerfile b/docker/china/dcu.Dockerfile new file mode 100644 index 00000000..8ae67ad8 --- /dev/null +++ b/docker/china/dcu.Dockerfile @@ -0,0 +1,34 @@ +# Base image containing the vLLM inference environment, requiring amd64(x86-64) CPU + Hygon DCU. +FROM harbor.sourcefind.cn:5443/dcu/admin/base/vllm:0.9.2-ubuntu22.04-dtk25.04.2-1226-das1.7-py3.10-20251226 + + +# Install libgl for opencv support & Noto fonts for Chinese characters +RUN apt-get update && \ + apt-get install -y \ + fonts-noto-core \ + fonts-noto-cjk \ + fontconfig && \ + fc-cache -fv && \ + apt-get clean && \ + rm -rf /var/lib/apt/lists/* + +# Install mineru latest +RUN python3 -m pip install -U pip -i https://mirrors.aliyun.com/pypi/simple && \ + python3 -m pip install mineru[api,gradio] \ + "matplotlib>=3.10,<4" \ + "ultralytics>=8.3.48,<9" \ + "doclayout_yolo==0.0.4" \ + "ftfy>=6.3.1,<7" \ + "shapely>=2.0.7,<3" \ + "pyclipper>=1.3.0,<2" \ + "omegaconf>=2.3.0,<3" \ + numpy==1.25.0 \ + opencv-python==4.11.0.86 \ + -i https://mirrors.aliyun.com/pypi/simple && \ + python3 -m pip cache purge + +# Download models and update the configuration file +RUN /bin/bash -c "mineru-models-download -s modelscope -m all" + +# Set the entry point to activate the virtual environment and run the command line tool +ENTRYPOINT ["/bin/bash", "-c", "export MINERU_MODEL_SOURCE=local && exec \"$@\"", "--"] \ No newline at end of file diff --git a/docs/zh/usage/acceleration_cards/Hygon.md b/docs/zh/usage/acceleration_cards/Hygon.md new file mode 100644 index 00000000..9b3e2da3 --- /dev/null +++ b/docs/zh/usage/acceleration_cards/Hygon.md @@ -0,0 +1,115 @@ +## 1. 测试平台 +以下为本指南测试使用的平台信息,供参考: +``` +os: Ubuntu 22.04.3 LTS +cpu: Hygon Hygon C86-4G(x86-64) +dcu: BW200 +driver: 6.3.13-V1.12.0a +docker: 20.10.24 +``` + +## 2. 环境准备 + +### 2.1 使用 Dockerfile 构建镜像 + +```bash +wget https://gcore.jsdelivr.net/gh/opendatalab/MinerU@master/docker/china/dcu.Dockerfile +docker build --network=host -t mineru:dcu-vllm-latest -f dcu.Dockerfile . +``` + + +## 3. 启动 Docker 容器 + +```bash +docker run -u root --name mineru_docker \ + --network=host \ + --ipc=host \ + --shm-size=16G \ + --device=/dev/kfd \ + --device=/dev/mkfd \ + --device=/dev/dri \ + -v /opt/hyhal:/opt/hyhal \ + --group-add video \ + --cap-add=SYS_PTRACE \ + --security-opt seccomp=unconfined \ + -e MINERU_MODEL_SOURCE=local \ + -it mineru:dcu-vllm-latest \ + /bin/bash +``` + +执行该命令后,您将进入到Docker容器的交互式终端,您可以直接在容器内运行MinerU相关命令来使用MinerU的功能。 +您也可以直接通过替换`/bin/bash`为服务启动命令来启动MinerU服务,详细说明请参考[通过命令启动服务](https://opendatalab.github.io/MinerU/zh/usage/quick_usage/#apiwebuihttp-clientserver)。 + + +## 4. 注意事项 + +不同环境下,MinerU对Hygon加速卡的支持情况如下表所示: + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
使用场景容器环境
vllm
命令行工具(mineru)pipeline🟢
<vlm/hybrid>-auto-engine🟢
<vlm/hybrid>-http-client🟢
fastapi服务(mineru-api)pipeline🟢
<vlm/hybrid>-auto-engine🟢
<vlm/hybrid>-http-client🟢
gradio界面(mineru-gradio)pipeline🟢
<vlm/hybrid>-auto-engine🟢
<vlm/hybrid>-http-client🟢
openai-server服务(mineru-openai-server)🟢
数据并行 (--data-parallel-size)🟢
+ +注: +🟢: 支持,运行较稳定,精度与Nvidia GPU基本一致 +🟡: 支持但较不稳定,在某些场景下可能出现异常,或精度存在一定差异 +🔴: 不支持,无法运行,或精度存在较大差异 + +>[!TIP] +>DCU加速卡指定可用加速卡的方式与AMD GPU类似,请参考[GPU isolation techniques](https://rocm.docs.amd.com/en/docs-6.2.4/conceptual/gpu-isolation.html) \ No newline at end of file