Skip to content

Studio: a Windows host whose NVIDIA GPU is hidden by CUDA_VISIBLE_DEVICES selects the CUDA bundle, not windows-cpu - #10976

Merged
danielhanchen merged 2 commits into
mainfrom
windows-masked-nvidia-selects-cuda
Sep 15, 2026
Merged

danielhanchen merged 2 commits into
mainfrom
windows-masked-nvidia-selects-cuda

Conversation

@danielhanchen

Copy link
Copy Markdown
Member

Windows half of #10909. That PR stopped a Linux host whose NVIDIA GPU is hidden by CUDA_VISIBLE_DEVICES (empty or -1) from installing the CPU bundle over its CUDA one. The Windows branch of resolve_release_asset_choice and of direct_upstream_release_plan had the same gap: both entered CUDA selection on has_usable_nvidia alone, so physical-without-usable fell through to the windows-cpu arm.

The masked run is not exotic. The backend pins GPUs for itself through CUDA_VISIBLE_DEVICES, the in-app llama.cpp update passes its own environment to the installer, and the install tree it replaces outlives the mask. One masked update left a CUDA machine on the CPU bundle for good.

The change

_masked_nvidia_selection_host(host) is the one place that answers "is this the masked case, and which host should selection run against". It returns a host selecting against the physical compute caps (the visible ones are empty by construction, which is the selector's unknown-SM path, so a masked sm_61 host would otherwise accept an sm_70 floor), None for a host with usable ROCm (it keeps ROCm, as on Linux) and for an explicit CPU request (_apply_host_overrides has cleared has_physical_nvidia). Both Windows arms use it, and the Linux branch now calls it instead of carrying its own copy of the logic.

A masked Windows host with no CUDA match raises PrebuiltFallback exactly as a visible one does, so setup.ps1 source-builds with CUDA rather than installing CPU. Torch's runtime preference is read with gpu_hidden_by_mask=True, as on Linux, so a cu12 venv is not handed a CUDA 13 bundle.

Tests

TestWindowsMaskedNvidiaTakesCuda mirrors the Linux class: the masked host takes windows-cuda and nothing else, selection reads the physical caps (an sm_61 host below the bundle floor source-builds instead of taking CPU), the torch preference is read under the mask, a host with usable ROCm never enters CUDA selection, an explicit CPU request still takes windows-cpu, and the direct upstream plan agrees. Four of the six fail on main; the full tests/studio/install suite passes (5052 tests).

…ICES selects the CUDA bundle, not windows-cpu
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 15, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-09-15T05:20:50.330567Z b691595 Manual request
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@unslothai unslothai deleted a comment from chatgpt-codex-connector Bot Sep 15, 2026
@danielhanchen

Copy link
Copy Markdown
Member Author

@codex review

@danielhanchen

Copy link
Copy Markdown
Member Author

@codex security review

danielhanchen added a commit to shimmyshimmer/unsloth-staging-4 that referenced this pull request Sep 15, 2026
@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Can't wait for the next one!

Reviewed commit: b691595a88

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@unslothai unslothai deleted a comment from chatgpt-codex-connector Bot Sep 15, 2026
@danielhanchen
danielhanchen merged commit 3712a3c into main Sep 15, 2026
51 of 53 checks passed
@danielhanchen
danielhanchen deleted the windows-masked-nvidia-selects-cuda branch September 15, 2026 07:13
shaojun pushed a commit to shaojun/unsloth that referenced this pull request Sep 29, 2026
…ICES selects the CUDA bundle, not windows-cpu (unslothai#10976)

* Studio: a Windows host whose NVIDIA GPU is hidden by CUDA_VISIBLE_DEVICES selects the CUDA bundle, not windows-cpu

* Tighten the masked-NVIDIA helper docstring for PR unslothai#10976

---------

Co-authored-by: danielhanchen <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants