这里记录几个解决的问题,不是部署手册。
Q&A
如何限制最大显存用量?
使用官方环境变量MINERU_VIRTUAL_VRAM_SIZE控制,比如pipeline模式官方要求最低显存6G,我们直接限制最高8G。然后跑一个大文档,查看mineru的日志,能发现显存被控制住了,批处理数量也自动被控制了。

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30
| services: mineru-api: build: context: . dockerfile: Dockerfile image: mineru-sglang:v2.1.1 container_name: mineru-api restart: always profiles: ["api"] ports: - 8000:8000 environment: MINERU_MODEL_SOURCE: local MINERU_VIRTUAL_VRAM_SIZE: 10 entrypoint: mineru-api command: --host 0.0.0.0 --port 8000 ulimits: memlock: -1 stack: 67108864 ipc: host deploy: resources: reservations: devices: - driver: nvidia device_ids: [ "0" ] capabilities: [ gpu ]
|
如何启动mineru的官方docker compose文件呢?
他使用了profile模式
1
| docker-compose --profile api up -d mineru-api
|