2
DAP讨论区
提问帖
有回复
新人贴
可选服务部署-PDF文档解析服务-解析的时候特别慢,查看日志说没有找到dcu
2026-01-08 19:34:57
92

解析了一个14M的pdf文件,里面都是文字形式的图片,解析特别慢,大概等了20分钟,查看日志发现 没有用到dcu,用的cpu,服务器是有两个dcu设备的,实在不知道哪儿的问题,我把容器信息和日志信息分别贴出来,请帮忙看看。


下面是 容器信息:

[

{

"Id": "80d25d78a3790409da50d5f07ced881d9594116b38645045bb67c3a299f89a1f",

"Created": "2025-12-13T04:29:51.616829529Z",

"Path": "docker-entrypoint.sh",

"Args": [

"python",

"/root/server.py"

],

"State": {

"Status": "running",

"Running": true,

"Paused": false,

"Restarting": false,

"OOMKilled": false,

"Dead": false,

"Pid": 370418,

"ExitCode": 0,

"Error": "",

"StartedAt": "2026-01-08T10:58:39.711482872Z",

"FinishedAt": "2025-12-21T01:41:22.950776207Z"

},

"Image": "sha256:4b27016377d6acf148ad1c81efdd1a035310f98f5d1f37605abdf079a7a8cc06",

"ResolvConfPath": "/var/lib/docker/containers/80d25d78a3790409da50d5f07ced881d9594116b38645045bb67c3a299f89a1f/resolv.conf",

"HostnamePath": "/var/lib/docker/containers/80d25d78a3790409da50d5f07ced881d9594116b38645045bb67c3a299f89a1f/hostname",

"HostsPath": "/var/lib/docker/containers/80d25d78a3790409da50d5f07ced881d9594116b38645045bb67c3a299f89a1f/hosts",

"LogPath": "/var/lib/docker/containers/80d25d78a3790409da50d5f07ced881d9594116b38645045bb67c3a299f89a1f/80d25d78a3790409da50d5f07ced881d9594116b38645045bb67c3a299f89a1f-json.log",

"Name": "/pdf-parse",

"RestartCount": 0,

"Driver": "overlay2",

"Platform": "linux",

"MountLabel": "",

"ProcessLabel": "",

"AppArmorProfile": "",

"ExecIDs": null,

"HostConfig": {

"Binds": [

"/opt/hyhal:/opt/hyhal:ro"

],

"ContainerIDFile": "",

"LogConfig": {

"Type": "json-file",

"Config": {}

},

"NetworkMode": "network-wwj",

"PortBindings": {},

"RestartPolicy": {

"Name": "no",

"MaximumRetryCount": 0

},

"AutoRemove": false,

"VolumeDriver": "",

"VolumesFrom": null,

"ConsoleSize": [

38,

135

],

"CapAdd": [

"SYS_PTRACE"

],

"CapDrop": null,

"CgroupnsMode": "host",

"Dns": [],

"DnsOptions": [],

"DnsSearch": [],

"ExtraHosts": null,

"GroupAdd": null,

"IpcMode": "private",

"Cgroup": "",

"Links": null,

"OomScoreAdj": 0,

"PidMode": "",

"Privileged": true,

"PublishAllPorts": false,

"ReadonlyRootfs": false,

"SecurityOpt": [

"seccomp=unconfined",

"label=disable"

],

"UTSMode": "",

"UsernsMode": "",

"ShmSize": 17179869184,

"Runtime": "runc",

"Isolation": "",

"CpuShares": 0,

"Memory": 0,

"NanoCpus": 0,

"CgroupParent": "",

"BlkioWeight": 0,

"BlkioWeightDevice": [],

"BlkioDeviceReadBps": [],

"BlkioDeviceWriteBps": [],

"BlkioDeviceReadIOps": [],

"BlkioDeviceWriteIOps": [],

"CpuPeriod": 0,

"CpuQuota": 0,

"CpuRealtimePeriod": 0,

"CpuRealtimeRuntime": 0,

"CpusetCpus": "",

"CpusetMems": "",

"Devices": [

{

"PathOnHost": "/dev/kfd",

"PathInContainer": "/dev/kfd",

"CgroupPermissions": "rwm"

},

{

"PathOnHost": "/dev/dri",

"PathInContainer": "/dev/dri",

"CgroupPermissions": "rwm"

}

],

"DeviceCgroupRules": null,

"DeviceRequests": null,

"MemoryReservation": 0,

"MemorySwap": 0,

"MemorySwappiness": null,

"OomKillDisable": false,

"PidsLimit": null,

"Ulimits": [],

"CpuCount": 0,

"CpuPercent": 0,

"IOMaximumIOps": 0,

"IOMaximumBandwidth": 0,

"MaskedPaths": null,

"ReadonlyPaths": null

},

"GraphDriver": {

"Data": {

"LowerDir": "/var/lib/docker/overlay2/d1ac21091d3ac49154fdb1ac06684a75da416729cc931892f0aada18c346b2d6-init/diff:/var/lib/docker/overlay2/9244a41ea7f12d14d6f506718d06cf1ee6affa0c1c2526fbdd32c6d6355856c9/diff:/var/lib/docker/overlay2/270cf27d7629717c7283d98d2229cd4c30f1f99ab6045d39f9df1d9601d42b08/diff:/var/lib/docker/overlay2/a1ef5425835201abb013e8f6a8652dc2e478433f6b2a8ef47eec2972931f063b/diff:/var/lib/docker/overlay2/756936231fc027c8aa0b24308a830991e819ad95f827ce6427a936220410d824/diff:/var/lib/docker/overlay2/a414ee64894e4a8d197c7204e1fa9c1dae26f87c3981fd97338eb80fe3bc9d32/diff:/var/lib/docker/overlay2/1fdd7c77a6eefe3db7fa8fa967559e52f220e3afa8ed5149ff9449ed8c37ad4a/diff:/var/lib/docker/overlay2/763f495a6892d83b2794b2bc0db1a30aa7e9485d661c6538e462ef732a4f4bc5/diff:/var/lib/docker/overlay2/a2370eafc6519b32eb89d81add9071c176807b722e2685299a4303ece747d960/diff:/var/lib/docker/overlay2/0f1cced87660f12af5af7c87c7c976da40939fb774d94a455f28d079f83776ab/diff:/var/lib/docker/overlay2/34680625b310b38c718b27f118413e79e6d261300c6ea3f83d4aaacb5b6cc3fc/diff:/var/lib/docker/overlay2/d2c10be39d348797df037545fedb57e926d9cffc2d02e56ff1d8740c103e4712/diff:/var/lib/docker/overlay2/2d76db33e815c629cee69ff65ddd50127ff61562381cff093aa01b62fef7f1a6/diff:/var/lib/docker/overlay2/2e4a9454e5e0d42f091d3da0bc5b7a727b6d2e115073ef43061b5961131a1324/diff:/var/lib/docker/overlay2/6900bd0b3abc884444ed4d290515f3e386cfa13303ffbb8c3f394b95477f4cd6/diff:/var/lib/docker/overlay2/0b30a3b75cd57209a4ca972b8e79c39fa62233b0b5a9ce9e3b3702c823b3d0bb/diff:/var/lib/docker/overlay2/055fe00f0cbc13bfe0aa9220adf867dd9c73fbae11e3f039461c2f527a33d9b7/diff:/var/lib/docker/overlay2/0b70e169b5db553048ca11c8e7d5fd16e0b0245b548a4577d4c7e56feaf69a4d/diff:/var/lib/docker/overlay2/d968b5e22df92f361847e84b42054962001c22e6c4585a4ca7dfde24a968935a/diff:/var/lib/docker/overlay2/d7a2d2503001f308d69484da84b290429e9922fd3c4cedc9d1be013568875a61/diff:/var/lib/docker/overlay2/a4080e51f78df3d79ab8c1e62c16eb60bfea7672b375cc978115727c4348ebdd/diff:/var/lib/docker/overlay2/daeb3f20fa0e75fef734ee4ba151d0c6b09a216f035d6d5b6318ca080f1f4194/diff:/var/lib/docker/overlay2/3efc4b984756b54a32c9ce5bded5b6c6e3e0aebdd77788e3043e4602d5b009b9/diff:/var/lib/docker/overlay2/91b92852f00160de72780b3782f964d87fe9e873acdd6ed3b352043ed5d0c0b8/diff:/var/lib/docker/overlay2/e68abed635c7a3e06c15dbb76d9b753238a435f9e95d47f4b67bf8d9abc36230/diff:/var/lib/docker/overlay2/74d31c29d9921e9f6858a8294c616bb659c26a5a7a649a2d7f51fa284d58e7e8/diff:/var/lib/docker/overlay2/88111cc0a1234c24710f9020308530f914a7538a32d0c53e8e8b650540f2a2ba/diff:/var/lib/docker/overlay2/bc897692813e1b306ed942ecc6debf4ac7ba2f833d1e2ea31218d8b5b78c5f46/diff:/var/lib/docker/overlay2/6fdd9621d852ee798c2cd43ce48e2e624fe216c50a6309247314d93b878e673a/diff:/var/lib/docker/overlay2/e5a37042cb86bf220bffec809134290357ad5a29874771ac35e03d0c2f198b78/diff:/var/lib/docker/overlay2/18a3430d85ee60c796b0148257525528101274ecf72fed0cc948a1ada0201902/diff:/var/lib/docker/overlay2/3f1632a4aa958c6f016036b4a064f196641431820be210f3634d4d12c64105b1/diff",

"MergedDir": "/var/lib/docker/overlay2/d1ac21091d3ac49154fdb1ac06684a75da416729cc931892f0aada18c346b2d6/merged",

"UpperDir": "/var/lib/docker/overlay2/d1ac21091d3ac49154fdb1ac06684a75da416729cc931892f0aada18c346b2d6/diff",

"WorkDir": "/var/lib/docker/overlay2/d1ac21091d3ac49154fdb1ac06684a75da416729cc931892f0aada18c346b2d6/work"

},

"Name": "overlay2"

},

"Mounts": [

{

"Type": "bind",

"Source": "/opt/hyhal",

"Destination": "/opt/hyhal",

"Mode": "ro",

"RW": false,

"Propagation": "rprivate"

}

],

"Config": {

"Hostname": "80d25d78a379",

"Domainname": "",

"User": "",

"AttachStdin": false,

"AttachStdout": false,

"AttachStderr": false,

"Tty": true,

"OpenStdin": true,

"StdinOnce": false,

"Env": [

"PORT=9911",

"HIP_VISIBLE_DEVICES=3",

"PATH=/opt/ucx/bin:/opt/dtk/bin:/opt/dtk/llvm/bin:/opt/dtk/hip/bin:/opt/dtk/hip/bin/hipify:/opt/hyhal/bin:/opt/mpi/bin:/opt/hwloc/bin/:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin",

"TZ=Asia/Shanghai",

"SHELL=/bin/bash",

"LC_ALL=en_US.UTF-8",

"LANG=en_US.UTF-8",

"LANGUAGE=en_US.UTF-8",

"LD_LIBRARY_PATH=/opt/ucx/lib:/opt/dtk/hip/lib:/opt/dtk/llvm/lib:/opt/dtk/lib:/opt/dtk/lib64:/opt/hyhal/lib:/opt/hyhal/lib64:/opt/mpi/lib:/opt/hwloc/lib:",

"MANPATH=/opt/mpi/share/man:",

"HYHAL_PATH=/opt/hyhal",

"DTKROOT=/opt/dtk",

"AMDGPU_TARGETS=gfx906;gfx926;gfx928;gfx936",

"ROCM_PATH=/opt/dtk",

"HIP_PATH=/opt/dtk/hip",

"MIOPEN_FIND_MODE=3",

"C_INCLUDE_PATH=/opt/dtk/include:/opt/hyhal/include:/opt/dtk/llvm/include:",

"CPLUS_INCLUDE_PATH=/opt/dtk/include:/opt/hyhal/include:/opt/dtk/llvm/include:",

"MOFED_VERSION=23.10-4.0.9.1",

"OS_VERSION=ubuntu22.04",

"PLATFORM=x86_64",

"UCX_HOME=/opt/ucx"

],

"Cmd": [

"python",

"/root/server.py"

],

"Image": "harbor.sourcefind.cn:5443/dap/pdf-parser:mineru-2.5.4-v2.1",

"Volumes": null,

"WorkingDir": "/workspace",

"Entrypoint": [

"docker-entrypoint.sh"

],

"OnBuild": null,

"Labels": {

"dtk-version": "dtk-25.04.1",

"maintainer": "chenwch1@sugon.com",

"org.opencontainers.image.ref.name": "ubuntu",

"org.opencontainers.image.version": "22.04"

}

},

"NetworkSettings": {

"Bridge": "",

"SandboxID": "0cda244317532812fa0433e5503b96216bb2547d3bb912035fd43c180bacf1a9",

"SandboxKey": "/var/run/docker/netns/0cda24431753",

"Ports": {},

"HairpinMode": false,

"LinkLocalIPv6Address": "",

"LinkLocalIPv6PrefixLen": 0,

"SecondaryIPAddresses": null,

"SecondaryIPv6Addresses": null,

"EndpointID": "",

"Gateway": "",

"GlobalIPv6Address": "",

"GlobalIPv6PrefixLen": 0,

"IPAddress": "",

"IPPrefixLen": 0,

"IPv6Gateway": "",

"MacAddress": "",

"Networks": {

"network-wwj": {

"IPAMConfig": null,

"Links": null,

"Aliases": null,

"MacAddress": "02:42:ac:13:00:0a",

"NetworkID": "78cc4b43e426e0c88c10539b1cf3b9c785b762707f665be1c67474f75a032b66",

"EndpointID": "d5cb50773fe3a377388390e76e6b33b34e386c85eedd4170c07edb29d5f1dbe1",

"Gateway": "172.19.0.1",

"IPAddress": "172.19.0.10",

"IPPrefixLen": 16,

"IPv6Gateway": "",

"GlobalIPv6Address": "",

"GlobalIPv6PrefixLen": 0,

"DriverOpts": null,

"DNSNames": [

"pdf-parse",

"80d25d78a379"

]

}

}

}

}

]


日志信息如下:


DTK version 25.04.1 pytorch version 2.4.1 2 DCU were detected in the container. NOTE: Make sure the user is in the 39 group. For more information, please go to https://developer.hpccube.com/ INFO:     Started server process [1] INFO:     Waiting for application startup. INFO:     Application startup complete. INFO:     Uvicorn running on http://0.0.0.0:9911 (Press CTRL+C to quit) 2026-01-08 18:59:18.726 | INFO     | \_\_main\_\_:process:95 - 正在处理文件: 关于进一步提高公文办理质量和效率的通知.pdf 2026-01-08 18:59:35.745 | INFO     | mineru.backend.pipeline.pipeline\_analyze:doc\_analyze:125 - Batch 1/1: 42 pages/42 pages 2026-01-08 18:59:35.747 | INFO     | mineru.backend.pipeline.model\_init:\_\_init\_\_:192 - DocAnalysis init, this may take some times...... [2026-01-08 18:59:44,275] [WARNING] [real\_accelerator.py:162:get\_accelerator] Setting accelerator to CPU. If you have GPU or other accelerator, we were unable to detect it. [2026-01-08 18:59:44,277] [INFO] [real\_accelerator.py:203:get\_accelerator] Setting ds\_accelerator to cpu (auto detect) /usr/local/lib/python3.10/dist-packages/mineru/model/ocr/paddleocr2pytorch/pytorchocr/base\_ocr\_v20.py:18: FutureWarning: You are using \`torch.load\` with \`weights\_only=False\` (the current default value), which uses the default pickle module implicitly. It is possible to construct malicious pickle data which will execute arbitrary code during unpickling (See https://github.com/pytorch/pytorch/blob/main/SECURITY.md#untrusted-models for more details). In a future release, the default value for \`weights\_only\` will be flipped to \`True\`. This limits the functions that could be executed during unpickling. Arbitrary objects will no longer be allowed to be loaded via this mode unless they are explicitly allowlisted by the user via \`torch.serialization.add\_safe\_globals\`. We recommend you start setting \`weights\_only=True\` for any use case where you don't have full control of the loaded file. Please open an issue on GitHub for any issues related to this experimental feature.   weights = torch.load(weights\_path) 2026-01-08 18:59:56.130 | INFO     | mineru.backend.pipeline.model\_init:\_\_init\_\_:248 - DocAnalysis init done! 2026-01-08 18:59:56.131 | INFO     | mineru.backend.pipeline.pipeline\_analyze:custom\_model\_init:65 - model init cost: 20.383466005325317 Layout Predict: 100%|██████████████████████████████████████████████████████████████████████████████████| 42/42 [03:43<00:00,  5.32s/it] MFD Predict: 100%|█████████████████████████████████████████████████████████████████████████████████████| 42/42 [07:09<00:00, 10.23s/it] MFR Predict: 100%|███████████████████████████████████████████████████████████████████████████████████████| 2/2 [00:06<00:00,  3.02s/it] Table-ocr det: 100%|█████████████████████████████████████████████████████████████████████████████████████| 2/2 [00:02<00:00,  1.42s/it] /usr/local/lib/python3.10/dist-packages/mineru/model/ocr/paddleocr2pytorch/pytorchocr/base\_ocr\_v20.py:18: FutureWarning: You are using \`torch.load\` with \`weights\_only=False\` (the current default value), which uses the default pickle module implicitly. It is possible to construct malicious pickle data which will execute arbitrary code during unpickling (See https://github.com/pytorch/pytorch/blob/main/SECURITY.md#untrusted-models for more details). In a future release, the default value for \`weights\_only\` will be flipped to \`True\`. This limits the functions that could be executed during unpickling. Arbitrary objects will no longer be allowed to be loaded via this mode unless they are explicitly allowlisted by the user via \`torch.serialization.add\_safe\_globals\`. We recommend you start setting \`weights\_only=True\` for any use case where you don't have full control of the loaded file. Please open an issue on GitHub for any issues related to this experimental feature.   weights = torch.load(weights\_path) Table-ocr rec ch: 100%|████████████████████████████████████████████████████████████████████████████████| 68/68 [00:27<00:00,  2.49it/s] Table-wireless Predict: 100%|████████████████████████████████████████████████████████████████████████████| 2/2 [00:00<00:00,  3.43it/s] Table-wired Predict: 100%|███████████████████████████████████████████████████████████████████████████████| 2/2 [00:01<00:00,  1.03it/s] /usr/local/lib/python3.10/dist-packages/mineru/model/ocr/paddleocr2pytorch/pytorchocr/base\_ocr\_v20.py:18: FutureWarning: You are using \`torch.load\` with \`weights\_only=False\` (the current default value), which uses the default pickle module implicitly. It is possible to construct malicious pickle data which will execute arbitrary code during unpickling (See https://github.com/pytorch/pytorch/blob/main/SECURITY.md#untrusted-models for more details). In a future release, the default value for \`weights\_only\` will be flipped to \`True\`. This limits the functions that could be executed during unpickling. Arbitrary objects will no longer be allowed to be loaded via this mode unless they are explicitly allowlisted by the user via \`torch.serialization.add\_safe\_globals\`. We recommend you start setting \`weights\_only=True\` for any use case where you don't have full control of the loaded file. Please open an issue on GitHub for any issues related to this experimental feature.   weights = torch.load(weights\_path)

全部评论(3)
只看楼主
D
DAP后端技术支持
1楼
看日志确实是使用的cpu,可以在容器中用命令hy-smi试试查看3号dcu卡是否存在,另外容器的启动参数是否与社区文档一致?
1/9
_
_mix90cxhg6yu
回复 @DAP后端技术支持
谢谢,3号确实不存在,但是修改为2个dcu后,还是没有用上dcu,提示虽然发现了2个dcu,但是无法使用,下面是详细的日志,您在帮忙看看
DTK version 25.04.1
pytorch version 2.4.1
2 DCU were detected in the container.
NOTE: Make sure the user is in the 39 group.
For more information, please go to https://developer.hpccube.com/
INFO: Started server process [1]
INFO: Waiting for application startup.
INFO: Application startup complete.
INFO: Uvicorn running on http://0.0.0.0:9911 (Press CTRL+C to quit)
2026-01-09 09:51:14.057 | INFO | __main__:process:95 - 正在处理文件: 关于进一步提高公文办理质量和效率的通知.pdf
Matplotlib is building the font cache; this may take a moment.
Creating new Ultralytics Settings v0.0.6 file ✅
View Ultralytics Settings with 'yolo settings' or at '/root/.config/Ultralytics/settings.json'
Update Settings with 'yolo settings key=value', i.e. 'yolo settings runs_dir=path/to/dir'. For help see https://docs.ultralytics.com/quickstart/#ultralytics-settings.
2026-01-09 09:51:39.043 | INFO | mineru.backend.pipeline.pipeline_analyze:doc_analyze:125 - Batch 1/1: 42 pages/42 pages
2026-01-09 09:51:39.047 | INFO | mineru.backend.pipeline.model_init:__init__:192 - DocAnalysis init, this may take some times......
[2026-01-09 09:51:40,358] [WARNING] [real_accelerator.py:162:get_accelerator] Setting accelerator to CPU. If you have GPU or other accelerator, we were unable to detect it.
[2026-01-09 09:51:40,360] [INFO] [real_accelerator.py:203:get_accelerator] Setting ds_accelerator to cpu (auto detect)
/usr/local/lib/python3.10/dist-packages/mineru/model/ocr/paddleocr2pytorch/pytorchocr/base_ocr_v20.py:18: FutureWarning: You are using `torch.load` with `weights_only=False` (the current default value), which uses the default pickle module implicitly. It is possible to construct malicious pickle data which will execute arbitrary code during unpickling (See https://github.com/pytorch/pytorch/blob/main/SECURITY.md#untrusted-models for more details). In a future release, the default value for `weights_only` will be flipped to `True`. This limits the functions that could be executed during unpickling. Arbitrary objects will no longer be allowed to be loaded via this mode unless they are explicitly allowlisted by the user via `torch.serialization.add_safe_globals`. We recommend you start setting `weights_only=True` for any use case where you don't have full control of the loaded file. Please open an issue on GitHub for any issues related to this experimental feature.
  weights = torch.load(weights_path)
2026-01-09 09:51:45.936 | INFO | mineru.backend.pipeline.model_init:__init__:248 - DocAnalysis init done!
2026-01-09 09:51:45.937 | INFO | mineru.backend.pipeline.pipeline_analyze:custom_model_init:65 - model init cost: 6.89015007019043
1/9
D
DAP后端技术支持
回复 @_mix90cxhg6yu
您好,指定卡号是通过环境变量:HIP_VISIBLE_DEVICES=1
如果机器上有个dcu卡,那他们的编号是0、1,可以通过上面的环境变量指定一个利用率低一些的卡
1/9
没有更多内容了
--
楼主
Level.3
0 帖子
楼主热帖
暂无数据