{"record":{"id":"b12175d511fcddb2","repo":"unslothai/unsloth","slug":"stable-diffusion-cpp-could-not-be-installed-or-sta","errorCode":null,"errorMessage":"stable-diffusion.cpp could not be installed or started for MiniMax-H3.","messagePattern":"stable-diffusion\\.cpp could not be installed or started for MiniMax-H3\\.","errorType":"exception","errorClass":"RuntimeError","httpStatus":null,"severity":"error","filePath":"studio/backend/core/inference/video.py","lineNumber":1685,"sourceCode":"            # next chat/image acquire evicted a model to make room for one that was never there.\n            binary = ensure_h3_sd_cpp_binary(allow_install = allow_install, accelerator = \"cpu\")\n            native_device = \"cpu\"\n            # The baseline this branch is compared against is the DECISION, not a fresh probe of\n            # what came back. An install can replace the returned CPU binary with a GPU build\n            # between that ensure and this line, and probing here would record ITS answer -- after\n            # which the re-check under the claim below compares the replacement against itself,\n            # passes, and commits CPU resource accounting around a CUDA executable that runs on\n            # VRAM nothing accounted for. native_device is \"cpu\" precisely because the build must\n            # offer no accelerator device, so that -- False -- is what the claim has to still find.\n            listed_accelerator = False\n        # And refuse a preflight that produced nothing, HERE rather than at the claimed re-vet\n        # below. ensure_h3_sd_cpp_binary legitimately returns None -- auto-install switched off, an\n        # unsupported platform, no network, or a stale managed copy something else is running out\n        # of -- and leaving the only `not binary` check after the download loop meant every one of\n        # those cases still fetched the four-file bundle first. The re-vet keeps its own check: it\n        # guards a replacement arriving mid-download, which is a different question.\n        if not binary:\n            raise RuntimeError(\n                \"stable-diffusion.cpp could not be installed or started for MiniMax-H3.\"\n            )\n        # And again on the way out. The ensure above takes no cancel_event and can spend minutes\n        # downloading and extracting the prebuilt, so a cancel arriving during it is already late;\n        # without this a CPU or MPS target (which skips the claimed accelerator probe, the only\n        # other cancel-aware step here) would go on to make four sequential model_info calls before\n        # the download loop finally noticed.\n        if cancel_event.is_set():\n            raise RuntimeError(VIDEO_CANCELLED_MSG)\n\n        requests = (\n            (repo_id, filename),\n            (self._h3_text_encoder_repo(repo_id, qwen_filename), qwen_filename),\n            (H3_COMPONENT_REPO, H3_VIDEO_VAE),\n            (H3_COMPONENT_REPO, H3_AUDIO_VAE),\n        )\n        total = 0\n        try:","sourceCodeStart":1667,"sourceCodeEnd":1703,"githubUrl":"https://github.com/unslothai/unsloth/blob/203007d19051dcd2ae33876786d117c99f6b0368/studio/backend/core/inference/video.py#L1667-L1703","documentation":"Raised when ensure_h3_sd_cpp_binary returns None: the prebuilt stable-diffusion.cpp binary needed for native MiniMax-H3 inference could not be obtained — auto-install disabled, unsupported platform, no network, or the managed copy is in use/stale. The check runs BEFORE the four-file model download so the user does not fetch tens of GB only to be refused.","triggerScenarios":"Starting an h3-native GGUF load when _install_allowed() is False (installs disabled by policy/env), the platform has no prebuilt sd-cli artifact, the machine is offline, or a stale managed copy is locked by another process.","commonSituations":"Hardened/CI environments with auto-install switched off; air-gapped machines; first run on an OS without a prebuilt binary; two Studio instances sharing one managed binaries directory.","solutions":["Enable the managed installer (set the env/config that makes _install_allowed() true) and retry.","Pre-install the sd-cli prebuilt for your platform manually into the managed location, then retry.","Ensure network access to the binary release source; check no other process holds the managed copy.","On unsupported platforms, run H3 via the Diffusers path instead of the native sd.cpp path."],"exampleFix":"# before: installs disallowed\nSTUDIO_AUTO_INSTALL=0 python backend  # then h3 load -> RuntimeError\n\n# after\nSTUDIO_AUTO_INSTALL=1 python backend  # ensure_h3_sd_cpp_binary can fetch the prebuilt","handlingStrategy":"fallback","validationCode":"from core.inference.sd_cpp_backend import ensure_h3_sd_cpp_binary\n\nbinary = ensure_h3_sd_cpp_binary(allow_install=_install_allowed(), accelerator=...)\nif binary is None:\n    raise SystemExit('sd.cpp unavailable: enable installs or pre-provision the binary')","typeGuard":"def h3_native_ready() -> bool:\n    return ensure_h3_sd_cpp_binary(allow_install=_install_allowed(), accelerator=...) is not None","tryCatchPattern":"try:\n    run_h3_load(...)\nexcept RuntimeError as e:\n    if 'could not be installed or started' in str(e):\n        preinstall_sd_cpp()  # or fall back to the Diffusers (pipeline) H3 path\n    else:\n        raise","preventionTips":["Pre-provision the sd-cli prebuilt during machine setup rather than at first load.","Keep auto-install enabled in environments meant to run H3.","Health-check ensure_h3_sd_cpp_binary at backend startup, before users queue loads."],"tags":["video","minimax-h3","sd-cpp","installation","environment"],"backgroundTag":null,"analyzedSha":"203007d19051dcd2ae33876786d117c99f6b0368","analyzedAt":"2026-08-15T02:48:39.846Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}