{"record":{"id":"27f797efe3ac4abd","repo":"vllm-project/vllm","slug":"unsupported-platform-please-use-cuda-rocm-or-cp","errorCode":null,"errorMessage":"Unsupported platform, please use CUDA, ROCm, or CPU.","messagePattern":"Unsupported platform, please use CUDA, ROCm, or CPU\\.","errorType":"exception","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"setup.py","lineNumber":1351,"sourceCode":"                # fetching cubins at runtime when the package is absent.\n                continue\n            if \"nvidia-cutlass-dsl[cu13]\" in req and cuda_major == \"12\":\n                # [cu13] extra is the default; strip it on CUDA 12 builds.\n                req = req.replace(\"nvidia-cutlass-dsl[cu13]\", \"nvidia-cutlass-dsl\")\n            if \"humming-kernels[cu13]\" in req and cuda_major == \"12\":\n                req = req.replace(\"humming-kernels[cu13]\", \"humming-kernels[cu12]\")\n            modified_requirements.append(req)\n        requirements = modified_requirements\n    elif _is_hip():\n        requirements = _read_requirements(\"rocm.txt\")\n    elif _is_tpu():\n        requirements = _read_requirements(\"tpu.txt\")\n    elif _is_cpu():\n        requirements = _read_requirements(\"cpu.txt\")\n    elif _is_xpu():\n        requirements = _read_requirements(\"xpu.txt\")\n    else:\n        raise ValueError(\"Unsupported platform, please use CUDA, ROCm, or CPU.\")\n    return requirements\n\n\next_modules = []\n\nif _is_cuda() or _is_hip():\n    ext_modules.append(CMakeExtension(name=\"vllm.cumem_allocator\"))\n    # Optional since this doesn't get built (produce an .so file). This is just\n    # copying the relevant .py files from the source repository.\n    ext_modules.append(CMakeExtension(name=\"vllm.triton_kernels\", optional=True))\n\nif not _is_xpu() and sys.version_info >= (3, 11):\n    ext_modules.append(CMakeExtension(name=\"vllm.spinloop\"))\n    ext_modules.append(CMakeExtension(name=\"vllm.fs_io_C\"))\n\nif _is_hip():\n    ext_modules.append(CMakeExtension(name=\"vllm._rocm_C\"))\n","sourceCodeStart":1333,"sourceCodeEnd":1369,"githubUrl":"https://github.com/vllm-project/vllm/blob/c794754062d49a8fdb63ab3c5215b488b865030c/setup.py#L1333-L1369","documentation":"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.","triggerScenarios":"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).","commonSituations":"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.","solutions":["Export the device explicitly, e.g. `VLLM_TARGET_DEVICE=cpu`, before reinstalling.","Run the install from the documented Linux environment with torch available so the CUDA probe succeeds.","Double-check the spelling of VLLM_TARGET_DEVICE against supported values (cuda, rocm, tpu, cpu, xpu)."],"exampleFix":"# before\nuv pip install -e .\n# -> ValueError: Unsupported platform, please use CUDA, ROCm, or CPU.\n\n# after\nVLLM_TARGET_DEVICE=cpu uv pip install -e .","handlingStrategy":"validation","validationCode":"# Pre-flight check mirroring setup.py's platform selection\nimport importlib.util, shutil, sys\nsupported = False\nif importlib.util.find_spec(\"torch\") is not None:\n    import torch\n    supported = torch.version.cuda is not None or shutil.which(\"rocm-smi\") or True  # cpu fallback\nif not supported and not os.getenv(\"VLLM_TARGET_DEVICE\"):\n    raise SystemExit(\"Set VLLM_TARGET_DEVICE (cuda|rocm|tpu|cpu|xpu) before installing\")","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Export VLLM_TARGET_DEVICE explicitly in Dockerfiles and CI before `uv pip install -e .`.","Keep torch available in the build environment so the CUDA probe works.","Spell-check the env var name; a typo silently falls through to this error."],"tags":["build","requirements","platform","setup-py"],"backgroundTag":null,"analyzedSha":"c794754062d49a8fdb63ab3c5215b488b865030c","analyzedAt":"2026-08-14T21:17:39.825Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}