{"record":{"id":"61deab08efbd7522","repo":"vllm-project/vllm","slug":"unknown-runtime-environment","errorCode":null,"errorMessage":"Unknown runtime environment","messagePattern":"Unknown runtime environment","errorType":"exception","errorClass":"RuntimeError","httpStatus":null,"severity":"error","filePath":"setup.py","lineNumber":1295,"sourceCode":"                # skip this for source tarball, required for pypi\n                if \"sdist\" not in sys.argv:\n                    version += f\"{sep}cu{cuda_version_str}\"\n    elif _is_hip():\n        # Get the Rocm Version\n        rocm_version = get_rocm_version() or torch.version.hip\n        if rocm_version and rocm_version != envs.VLLM_MAIN_CUDA_VERSION:\n            version += f\"{sep}rocm{rocm_version.replace('.', '')[:3]}\"\n    elif _is_tpu():\n        version += f\"{sep}tpu\"\n    elif _is_cpu():\n        # Check the local VLLM_TARGET_DEVICE (may be set by auto-detect above),\n        # not envs.VLLM_TARGET_DEVICE, so CPU-only hosts still get `+cpu`.\n        if VLLM_TARGET_DEVICE == \"cpu\":\n            version += f\"{sep}cpu\"\n    elif _is_xpu():\n        version += f\"{sep}xpu\"\n    else:\n        raise RuntimeError(\"Unknown runtime environment\")\n\n    return version\n\n\ndef get_requirements() -> list[str]:\n    \"\"\"Get Python package dependencies from requirements.txt.\"\"\"\n    requirements_dir = ROOT_DIR / \"requirements\"\n\n    def _read_requirements(filename: str) -> list[str]:\n        with open(requirements_dir / filename) as f:\n            requirements = f.read().strip().split(\"\\n\")\n        resolved_requirements = []\n        for line in requirements:\n            if line.startswith(\"-r \"):\n                resolved_requirements += _read_requirements(line.split()[1])\n            elif (\n                not line.startswith(\"--\")\n                and not line.startswith(\"#\")","sourceCodeStart":1277,"sourceCodeEnd":1313,"githubUrl":"https://github.com/vllm-project/vllm/blob/c794754062d49a8fdb63ab3c5215b488b865030c/setup.py#L1277-L1313","documentation":"get_vllm_version() appends a local-version suffix (+cu, +rocm, +tpu, +cpu, +xpu) by classifying the build machine through _is_cuda()/_is_hip()/_is_tpu()/_is_cpu()/_is_xpu(). If none of the probes match, the environment is unrecognized and the RuntimeError aborts the version computation during setup.py execution.","triggerScenarios":"Running setup.py (`uv pip install -e .` or `python setup.py develop`) on a platform outside CUDA/ROCm/TPU/CPU/XPU support, or on a supported OS where device auto-detection fails to classify (e.g. detection helpers raise or return falsy for every category).","commonSituations":"Attempting to build vLLM on macOS or Windows; a Linux container where torch is absent, nvidia-smi is missing, and VLLM_TARGET_DEVICE is unset so auto-detect cannot classify the host; stale forks where a new hardware backend was added without a version suffix branch.","solutions":["Set VLLM_TARGET_DEVICE explicitly for the device class you intend (e.g. `export VLLM_TARGET_DEVICE=cpu`) so classification succeeds.","Build inside a supported Linux environment with torch installed (CUDA hosts: torch with a CUDA runtime and nvidia-smi on PATH).","Verify you are on a supported platform per docs (Linux x86_64 with CUDA/ROCm, TPU, CPU, or Intel XPU); macOS/Windows source builds are unsupported."],"exampleFix":"# before\nuv pip install -e .\n# -> RuntimeError: Unknown runtime environment\n\n# after\nexport VLLM_TARGET_DEVICE=cpu\nuv pip install -e .","handlingStrategy":"validation","validationCode":"# Before running setup.py, verify the environment classifies\nimport os, sys\nif sys.platform not in (\"linux\", \"linux2\"):\n    raise SystemExit(\"vLLM builds require Linux; use a Linux container\")\nos.environ.setdefault(\"VLLM_TARGET_DEVICE\", \"cpu\")  # explicit beats auto-detect","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Always export VLLM_TARGET_DEVICE in build scripts so classification never depends on probes.","Run builds inside the documented Linux environment with torch preinstalled.","Never attempt setup.py on macOS/Windows hosts."],"tags":["build","environment-detection","setup-py","platform"],"backgroundTag":null,"analyzedSha":"c794754062d49a8fdb63ab3c5215b488b865030c","analyzedAt":"2026-08-14T21:17:39.825Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}