{"record":{"id":"dea50041ba3acc88","repo":"opendatalab/MinerU","slug":"unsupported-lmdeploy-device-type-device-type-dea500","errorCode":null,"errorMessage":"Unsupported lmdeploy device type: {device_type}","messagePattern":"Unsupported lmdeploy device type: (.+?)","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"mineru/model/vlm/lmdeploy_server.py","lineNumber":61,"sourceCode":"            indices_to_remove.append(i)\n\n    # 从后往前删除,避免索引错位\n    for i in sorted(set(indices_to_remove), reverse=True):\n        args.pop(i)\n\n    # 添加默认参数\n    if not has_port_arg:\n        args.extend([\"--server-port\", \"30000\"])\n    if not has_gpu_memory_utilization_arg:\n        args.extend([\"--cache-max-entry-count\", \"0.5\"])\n    if not has_log_level_arg:\n        args.extend([\"--log-level\", \"ERROR\"])\n\n    device_type = os.getenv(\"MINERU_LMDEPLOY_DEVICE\", device_type)\n    if device_type == \"\":\n        device_type = \"cuda\"\n    elif device_type not in [\"cuda\", \"ascend\", \"maca\", \"camb\"]:\n        raise ValueError(f\"Unsupported lmdeploy device type: {device_type}\")\n    lm_backend = os.getenv(\"MINERU_LMDEPLOY_BACKEND\", lm_backend)\n    if lm_backend == \"\":\n        lm_backend = set_lmdeploy_backend(device_type)\n    elif lm_backend not in [\"pytorch\", \"turbomind\"]:\n        raise ValueError(f\"Unsupported lmdeploy backend: {lm_backend}\")\n    logger.info(f\"lmdeploy device is: {device_type}, lmdeploy backend is: {lm_backend}\")\n\n    if lm_backend == \"pytorch\":\n        os.environ[\"TOKENIZERS_PARALLELISM\"] = \"false\"\n\n\n    args.extend([\"--device\", device_type])\n    args.extend([\"--backend\", lm_backend])\n\n    model_path = auto_download_and_get_model_root_path(\"/\", \"vlm\")\n\n    # logger.debug(args)\n","sourceCodeStart":43,"sourceCodeEnd":79,"githubUrl":"https://github.com/opendatalab/MinerU/blob/4fe4bde114a23ee5dd637eae99b767f4669bf58c/mineru/model/vlm/lmdeploy_server.py#L43-L79","documentation":"Raised when starting the lmdeploy VLM server if the resolved device type is not one of cuda, ascend, maca, or camb. The value comes from the function argument overridden by the MINERU_LMDEPLOY_DEVICE environment variable; empty string defaults to cuda.","triggerScenarios":"Setting MINERU_LMDEPLOY_DEVICE=cpu / rocm / npu / nvidia (anything outside the allowlist), or passing device_type='cpu' to the server-builder function when calling mineru's VLM backend.","commonSituations":"Trying to run the VLM pipeline on CPU (unsupported by this lmdeploy path — use the non-lmdeploy backend instead); vendor accelerator names not in the list; leftover env vars from other tooling.","solutions":["Set MINERU_LMDEPLOY_DEVICE to a supported value: cuda, ascend, maca, or camb (or unset it to default to cuda).","On CPU-only machines, do not use the lmdeploy VLM backend; select a different mineru VLM backend.","For ROCm, note 'cuda' is typically still the right device string."],"exampleFix":"# before\nexport MINERU_LMDEPLOY_DEVICE=cpu\n\n# after\nunset MINERU_LMDEPLOY_DEVICE   # defaults to cuda\n# or: export MINERU_LMDEPLOY_DEVICE=cuda","handlingStrategy":"validation","validationCode":"import os\nVALID_DEVICES = {\"cuda\", \"ascend\", \"maca\", \"camb\"}\ndevice = os.getenv(\"MINERU_LMDEPLOY_DEVICE\", \"\") or \"cuda\"\nassert device in VALID_DEVICES, f\"MINERU_LMDEPLOY_DEVICE must be one of {VALID_DEVICES}, got {device!r}\"","typeGuard":"def is_supported_lmdeploy_device(d: str) -> bool:\n    return d in {\"cuda\", \"ascend\", \"maca\", \"camb\"}","tryCatchPattern":null,"preventionTips":["Validate env vars in deployment entrypoints","Do not use the lmdeploy VLM backend on CPU-only hosts","Unset stale MINERU_* variables when switching backends"],"tags":["vlm","lmdeploy","device","environment-variable","validation"],"backgroundTag":null,"analyzedSha":"4fe4bde114a23ee5dd637eae99b767f4669bf58c","analyzedAt":"2026-08-14T21:29:18.456Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}