{"record":{"id":"bf17e3a0ae89372a","repo":"jamiepine/voicebox","slug":"downloadable-cuda-backend-releases-are-currently-o-bf17e3","errorCode":null,"errorMessage":"Downloadable CUDA backend releases are currently only published for Windows.","messagePattern":"Downloadable CUDA backend releases are currently only published for Windows\\.","errorType":"exception","errorClass":"RuntimeError","httpStatus":null,"severity":"error","filePath":"backend/services/cuda.py","lineNumber":84,"sourceCode":"\n\ndef is_cuda_download_supported() -> bool:\n    \"\"\"Return whether this platform has a matching CUDA release asset.\"\"\"\n    return sys.platform == \"win32\"\n\n\ndef get_cuda_download_unsupported_reason() -> str | None:\n    \"\"\"Explain why this platform cannot use the release-download flow.\"\"\"\n    if is_cuda_download_supported():\n        return None\n    return CUDA_DOWNLOAD_UNSUPPORTED_REASON\n\n\ndef ensure_cuda_download_supported() -> None:\n    \"\"\"Raise if downloading would fetch an asset built for another platform.\"\"\"\n    reason = get_cuda_download_unsupported_reason()\n    if reason:\n        raise RuntimeError(reason)\n\n\ndef get_cuda_binary_path() -> Optional[Path]:\n    \"\"\"Return path to the CUDA executable if it exists inside the onedir.\"\"\"\n    p = get_cuda_dir() / get_cuda_exe_name()\n    if p.exists():\n        return p\n    return None\n\n\ndef get_cuda_libs_manifest_path() -> Path:\n    \"\"\"Path to the cuda-libs.json manifest inside the CUDA dir.\"\"\"\n    return get_cuda_dir() / \"cuda-libs.json\"\n\n\ndef get_installed_cuda_libs_version() -> Optional[str]:\n    \"\"\"Read the installed CUDA libs version from cuda-libs.json, or None.\"\"\"\n    manifest_path = get_cuda_libs_manifest_path()","sourceCodeStart":66,"sourceCodeEnd":102,"githubUrl":"https://github.com/jamiepine/voicebox/blob/51f49dea198384b4eb6087b72c17057c6eb1c1cd/backend/services/cuda.py#L66-L102","documentation":"The CUDA backend ships as a prebuilt PyInstaller --onedir bundle downloaded from GitHub Releases, but those release assets are only published for Windows. ensure_cuda_download_supported() calls is_cuda_download_supported() which returns (sys.platform == 'win32'); on any other OS it raises RuntimeError with CUDA_DOWNLOAD_UNSUPPORTED_REASON. This is a hard platform gate enforced before any network call in _download_cuda_binary_locked().","triggerScenarios":"Invoking download_cuda_binary() or check_and_update_cuda_binary() (or an HTTP endpoint / server-startup hook that calls them) on macOS or Linux. sys.platform is not 'win32', so get_cuda_download_unsupported_reason() returns the reason string and ensure_cuda_download_supported() raises.","commonSituations":"Running Voicebox on Linux/macOS and triggering the CUDA backend download from the UI; server-startup auto-update running on a Linux host; CI on Linux exercising the CUDA code path. On Linux the ROCm backend (rocm.py, docker-compose.rocm.yml) is the supported GPU path.","solutions":["On Linux/macOS use the ROCm backend (see backend/services/rocm.py and docker-compose.rocm.yml) or run the app on Windows.","Gate any UI/API affordance behind get_cuda_download_unsupported_reason() and surface the reason instead of calling download_cuda_binary().","Run on Windows where the release assets (voicebox-server-cuda.tar.gz, cuda-libs-*.tar.gz) are actually published."],"exampleFix":"// before\nawait download_cuda_binary(version)\n\n// after\nfrom backend.services.cuda import get_cuda_download_unsupported_reason\nreason = get_cuda_download_unsupported_reason()\nif reason:\n    return {\"error\": reason}  # route to ROCm/CPU backend instead\nawait download_cuda_binary(version)","handlingStrategy":"validation","validationCode":"from backend.services.cuda import get_cuda_download_unsupported_reason\nreason = get_cuda_download_unsupported_reason()\nif reason:\n    # platform unsupported: surface to user, route to ROCm/CPU backend\n    raise SystemExit(reason)","typeGuard":null,"tryCatchPattern":"try:\n    await download_cuda_binary(version)\nexcept RuntimeError as e:\n    if \"only published for Windows\" in str(e):\n        # platform gate — not retriable; switch backend\n        ...\n    raise","preventionTips":["Call get_cuda_download_unsupported_reason() before exposing the download action; hide it when reason is non-None.","On non-Windows hosts route GPU work through the ROCm backend (rocm.py).","Treat this RuntimeError as permanent for the host — don't retry."],"tags":["cuda","platform","windows","backend","gpu"],"backgroundTag":null,"analyzedSha":"51f49dea198384b4eb6087b72c17057c6eb1c1cd","analyzedAt":"2026-08-12T16:51:42.824Z","schemaVersion":2},"datasetVersion":"2026-08-12T18:17:37.767Z"}