diff --git a/docker/china/gcu.Dockerfile b/docker/china/gcu.Dockerfile new file mode 100644 index 00000000..075c1d98 --- /dev/null +++ b/docker/china/gcu.Dockerfile @@ -0,0 +1,27 @@ +# Base image containing the vLLM inference environment, requiring amd64(x86-64) CPU + Enflame GCU. +FROM + + +# 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[core]>=2.7.2" \ + numpy==1.26.4 \ + 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/Enflame.md b/docs/zh/usage/acceleration_cards/Enflame.md new file mode 100644 index 00000000..a003e447 --- /dev/null +++ b/docs/zh/usage/acceleration_cards/Enflame.md @@ -0,0 +1,115 @@ +## 1. 测试平台 +以下为本指南测试使用的平台信息,供参考: +``` +os: Ubuntu 22.04.4 LTS +cpu: Intel x86-64 +gcu: Enflame S60 +driver: 1.7.0.9 +docker: 28.0.1 +``` + +## 2. 环境准备 + +### 2.1 使用 Dockerfile 构建镜像 + +```bash +wget https://gcore.jsdelivr.net/gh/opendatalab/MinerU@master/docker/china/gcu.Dockerfile +docker build --network=host -t mineru:gcu-vllm-latest -f gcu.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对Enflame加速卡的支持情况如下表所示: + +
| 使用场景 | +容器环境 | +||
|---|---|---|---|
| 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) | +🔴 | +||