vllm-project/vllm · error · ValueError

Unsupported platform, please use CUDA, ROCm, or CPU.

Error message

Unsupported platform, please use CUDA, ROCm, or CPU.

What it means

get_requirements() selects a requirements file (common/cuda, rocm.txt, tpu.txt, cpu.txt, xpu.txt) using the same platform probes as the version logic. When the host matches none of them, no dependency set exists and setup.py raises this ValueError, stopping the install before any compilation.

Source

Thrown at setup.py:1351

                # fetching cubins at runtime when the package is absent.
                continue
            if "nvidia-cutlass-dsl[cu13]" in req and cuda_major == "12":
                # [cu13] extra is the default; strip it on CUDA 12 builds.
                req = req.replace("nvidia-cutlass-dsl[cu13]", "nvidia-cutlass-dsl")
            if "humming-kernels[cu13]" in req and cuda_major == "12":
                req = req.replace("humming-kernels[cu13]", "humming-kernels[cu12]")
            modified_requirements.append(req)
        requirements = modified_requirements
    elif _is_hip():
        requirements = _read_requirements("rocm.txt")
    elif _is_tpu():
        requirements = _read_requirements("tpu.txt")
    elif _is_cpu():
        requirements = _read_requirements("cpu.txt")
    elif _is_xpu():
        requirements = _read_requirements("xpu.txt")
    else:
        raise ValueError("Unsupported platform, please use CUDA, ROCm, or CPU.")
    return requirements


ext_modules = []

if _is_cuda() or _is_hip():
    ext_modules.append(CMakeExtension(name="vllm.cumem_allocator"))
    # Optional since this doesn't get built (produce an .so file). This is just
    # copying the relevant .py files from the source repository.
    ext_modules.append(CMakeExtension(name="vllm.triton_kernels", optional=True))

if not _is_xpu() and sys.version_info >= (3, 11):
    ext_modules.append(CMakeExtension(name="vllm.spinloop"))
    ext_modules.append(CMakeExtension(name="vllm.fs_io_C"))

if _is_hip():
    ext_modules.append(CMakeExtension(name="vllm._rocm_C"))

View on GitHub (pinned to c794754062)

Solutions

  1. Export the device explicitly, e.g. `VLLM_TARGET_DEVICE=cpu`, before reinstalling.
  2. Run the install from the documented Linux environment with torch available so the CUDA probe succeeds.
  3. Double-check the spelling of VLLM_TARGET_DEVICE against supported values (cuda, rocm, tpu, cpu, xpu).

Example fix

# before
uv pip install -e .
# -> ValueError: Unsupported platform, please use CUDA, ROCm, or CPU.

# after
VLLM_TARGET_DEVICE=cpu uv pip install -e .
Defensive patterns

Strategy: validation

Validate before calling

# Pre-flight check mirroring setup.py's platform selection
import importlib.util, shutil, sys
supported = False
if importlib.util.find_spec("torch") is not None:
    import torch
    supported = torch.version.cuda is not None or shutil.which("rocm-smi") or True  # cpu fallback
if not supported and not os.getenv("VLLM_TARGET_DEVICE"):
    raise SystemExit("Set VLLM_TARGET_DEVICE (cuda|rocm|tpu|cpu|xpu) before installing")

Prevention

When it happens

Trigger: Running `uv pip install -e .` / `python -m pip install .` on a machine where _is_cuda()/_is_hip()/_is_tpu()/_is_cpu()/_is_xpu() all return false (macOS, Windows, or a Linux box with no torch/nvidia-smi and no VLLM_TARGET_DEVICE).

Common situations: Trying to develop vLLM on a Mac or Windows laptop; a bare CI container without GPU drivers or torch preinstalled; VLLM_TARGET_DEVICE set to a typo'd value.

Related errors


AI-assisted analysis of vllm-project/vllm@c794754062 (2026-08-14). Data as JSON: /api/errors/27f797efe3ac4abd. Report an issue: GitHub.