Skip to content

bug(install): GPU detection misses WSL2 (bare nvidia-smi), so mistral and dolphin are never pulled and six agent roles point at absent models #19731

Open
0 of 1 issue completed

Description

@mrveiss

Problem

On a Windows (WSL2) host with an NVIDIA GPU, the installer decides there is no GPU and skips every GPU-only model. On 2026-10-26, on a local install at c1312f2eec:

  • the install log reads GPU detected: False on a machine with a discrete NVIDIA GPU;
  • the backend env points six roles at models that were never pulled: mistral:7b-instruct (instruction, RAG, KB and knowledge extraction) and dolphin-llama3:8b (system, commands, security and failsafe). ollama list has neither;
  • the log has 9 "agent initialized with model=mistral" lines. Whether any call against it was ever attempted is not established.

Root cause

  • autobot-slm-backend/ansible/roles/llm/tasks/main.yml:16 detects the GPU by running plain nvidia-smi. Under WSL2 that binary lives in /usr/lib/wsl/lib. That this directory is not on the playbook's PATH is the leading explanation; it is not verified yet.
  • The GPU-only model list (main.yml:46, and pulls at :204-232) is then skipped.
  • The post-pull check confirms only the node's own pull list ("All 4 models present"). It never checks that the models the env file points at are present, so the install reports success.

Fix

  • GPU detection that works on bare metal, WSL2 and containers: search the known locations, or use a capability probe, not one bare binary name. Record the result and its reason.
  • After pulling, the check enumerates every model the rendered env and config reference, and fails the install naming any that are absent.

Acceptance criteria

  • On a WSL2 host with an NVIDIA GPU, detection reports the GPU. A test covers each location (bare metal, WSL2 lib path, absent).
  • The post-install check fails, naming the model and the role, when any env-referenced model is not installed. A test pins this.
  • Host: after the builtin update, ollama list contains every model the backend env references.

Activity

  1. mrveiss commented on Oct 28, 2026

    @mrveiss
    OwnerAuthor

    This probe has a second instance. Found by the out-of-box install audit and verified on main at 248a8dd:

    • autobot-slm-backend/ansible/roles/backend/tasks/main.yml:1007 runs the same bare nvidia-smi --query-gpu=name --format=csv,noheader when backend_has_gpu == "auto", and uses it to choose CUDA vs CPU torch. A WSL2 backend therefore also gets CPU torch.
    • Choosing the LLM GPU role does not set llm_has_gpu: playbooks/deploy_role.yml (~:102-106) maps autobot-llm-cpu and autobot-llm-gpu to the same llm role, roles/llm/defaults/main.yml:40 sets llm_has_gpu: "auto", and llm_has_gpu is set nowhere outside roles/llm/. The GPU role still depends on the probe.

    Proposed scope: fix the probe once and use it at both sites. The GPU role should force llm_has_gpu.

  2. mrveiss commented on Oct 30, 2026

    @mrveiss
    OwnerAuthor

    Correction to the plan here: the host criterion says "after the builtin update", but update-all-nodes.yml does not run the llm role, so an update alone will not pull the GPU models. It needs deploy_role or provisioning on the LLM node, or the updater needs to apply the role.

  3. mrveiss commented on Oct 31, 2026

    @mrveiss
    OwnerAuthor

    Follow-ups from review of merge train PR #20104, not yet fixed:

    • _shared/tasks/detect_nvidia_gpu.yml: nvidia_smi_extra_path reaches the shell inside double quotes. Use a shell-safe quoting filter.
    • llm/tasks/main.yml: with llm_has_gpu overridden the role skips the probe but still prints nvidia_smi_probe, possibly the backend role's. Print it only when this role probed.
    • gpu_detection_finds_wsl2_19731_test.py: the include check is a substring match that a YAML comment satisfies. Parse the task file.
  4. mrveiss commented on Oct 31, 2026

    @mrveiss
    OwnerAuthor

    0 of 3 criteria ticked after the merge train (PR #20104), main b0d727e.

    Delivered, on origin/main: roles/_shared/tasks/detect_nvidia_gpu.yml is the one probe, included from llm/tasks/main.yml:16 and backend/tasks/main.yml:1012. repo_tests/gpu_detection_finds_wsl2_19731_test.py test_each_location covers bare-metal, wsl2-lib-path and absent with a fake binary.

    Remaining:

    • First criterion: its test half is covered, but "on a WSL2 host" needs a run on a real host, so it stays unticked.
    • Post-install check: not delivered. llm/tasks/main.yml:223 still asserts only the node's own pull list, not the models the env references.
    • Host check on ollama list: not run. Per the correction above, an update alone does not run the llm role.
    • The three follow-ups above.
  5. mrveiss commented on Oct 31, 2026

    @mrveiss
    OwnerAuthor

    Maintainer decision on the post-install check, 2026-10-31: on a CPU-only node, the backend env points the roles that use GPU-class models at a model the node holds. The check then fails only when a referenced model is really missing. A check alone would have failed every CPU-only install, since the llm role skips those models on purpose.

    Not started: roles/backend and roles/llm are in PRs #20205 and #20190 on train #20238, so this follows them. Open design point: which models count as held when the model server is on another node (#19861).

  6. mrveiss commented on Oct 31, 2026

    @mrveiss
    OwnerAuthor

    Follow-ups from review of #20385, not blocking it:

    • An endpoint with a /v1 suffix (giving /v1/api/tags, a 404) or a self-signed certificate silently skips the remap. It should at least print that the check could not ask the server.
    • The endpoint test only greps for the variable's name. It should exercise a real URL.
  7. github-actions commented on Nov 1, 2026

    @github-actions
    Contributor

    Landed via the merge train (#20455, merge 25ab945e81) via #20385

  8. mrveiss commented on Nov 1, 2026

    @mrveiss
    OwnerAuthor

    Refs only. The merge train (PR #20455), via #20385, landed the backend env naming models the server holds (autobot-slm-backend/ansible/_shared/files/resolve_backend_models.py, roles/backend/tasks/resolve_models.yml) with tests repo_tests/backend_models_resolved_for_the_server_19731_test.py and repo_tests/gpu_detection_finds_wsl2_19731_test.py. The host criterion (every env-referenced model present after the builtin update) has no host evidence from this merge, so the issue stays open.

  9. mrveiss commented on Nov 6, 2026

    @mrveiss
    OwnerAuthor

    Re-filed into M1 per maintainer decision 2026-11-06; order: the shared probe #20874 (with #19731, #15180) -> install acts on it (#19865, #20082) -> runtime reporting (#16280, #16297, #15226) -> consumers (#20095, #15164, #13028, #2871) -> CI proof (#20451).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions