opendatalab/MinerU · error · ValueError
Unsupported operating system.
Error message
Unsupported operating system.
What it means
Raised inside set_lmdeploy_backend() on the CUDA path when the OS is neither Windows nor Linux as detected by is_windows_environment()/is_linux_environment(). lmdeploy's engine selection (turbomind/pytorch by compute capability) is only implemented for those two platforms.
Source
Thrown at mineru/backend/vlm/utils.py:77
def set_lmdeploy_backend(device_type: str) -> str:
if device_type.lower() in ["ascend", "maca", "camb"]:
lmdeploy_backend = "pytorch"
elif device_type.lower() in ["cuda"]:
import torch
if not torch.cuda.is_available():
raise ValueError("CUDA is not available.")
if is_windows_environment():
lmdeploy_backend = "turbomind"
elif is_linux_environment():
major, minor = torch.cuda.get_device_capability()
compute_capability = f"{major}.{minor}"
if version.parse(compute_capability) >= version.parse("8.0"):
lmdeploy_backend = "pytorch"
else:
lmdeploy_backend = "turbomind"
else:
raise ValueError("Unsupported operating system.")
else:
raise ValueError(f"Unsupported lmdeploy device type: {device_type}")
return lmdeploy_backend
def set_default_gpu_memory_utilization() -> float:
from vllm import __version__ as vllm_version
device = get_device()
gpu_memory = get_vram(device)
default_gpu_memory_utilization = 0.5
if version.parse(vllm_version) >= version.parse("0.11.0") and gpu_memory <= 8:
default_gpu_memory_utilization = 0.7
logger.debug(f"vllm_version: {vllm_version}, gpu_memory: {gpu_memory} GB, default_gpu_memory_utilization: {default_gpu_memory_utilization}")
return default_gpu_memory_utilization
def set_default_batch_size() -> int:View on GitHub (pinned to 4fe4bde114)
Solutions
- Run lmdeploy-engine on Linux or Windows with an NVIDIA GPU.
- On macOS, switch to the mlx-engine backend (Apple Silicon) or transformers backend.
- If the platform is genuinely Linux/Windows but detection fails, check platform.system()/env overrides your shell sets.
Example fix
# before
backend = set_lmdeploy_backend("cuda") # on macOS -> Unsupported operating system.
# after (Apple Silicon Mac)
run_parse(backend="mlx-engine", ...) Defensive patterns
Strategy: type-guard
Validate before calling
import platform
def lmdeploy_cuda_platform_ok() -> bool:
return platform.system() in ("Windows", "Linux") Type guard
import platform
def supports_lmdeploy_cuda() -> bool:
import torch
return platform.system() in ("Windows", "Linux") and torch.cuda.is_available() Try / catch
try:
backend = set_lmdeploy_backend("cuda")
except ValueError as e:
if "Unsupported operating system" in str(e):
backend = "pytorch" # ascend/maca/camb path, or switch backends entirely
else:
raise Prevention
- Gate backend selection on platform.system() in launch scripts.
- On macOS use mlx-engine (Apple Silicon) or transformers instead.
- Keep per-OS config files rather than one shared config.
When it happens
Trigger: device_type='cuda' on macOS or another Unix where a CUDA device is reported (rare, e.g. legacy Mac CUDA, BSD with NVIDIA drivers) or environment detection misclassifies the platform.
Common situations: Running on macOS with an old CUDA card; esoteric OSes; container reporting a strange platform via platform module.
Related errors
- CUDA is not available.
- Please install lmdeploy to use the lmdeploy-engine backend.
- Unsupported lmdeploy device type: {device_type}
- Unsupported lmdeploy backend: {lm_backend}
- Unsupported lmdeploy device type: {device_type}
AI-assisted analysis of opendatalab/MinerU@4fe4bde114 (2026-08-14).
Data as JSON: /api/errors/4c5b130e60201860.
Report an issue: GitHub.