Skip to content

Studio: don't silently fall back to a CPU prebuilt on NVIDIA Linux GPU hosts - #6310

Merged
oobabooga merged 1 commit into
unslothai:mainfrom
oobabooga:studio-no-silent-cpu-fallback-nvidia-linux
Jun 14, 2026
Merged

oobabooga merged 1 commit into
unslothai:mainfrom
oobabooga:studio-no-silent-cpu-fallback-nvidia-linux

Conversation

@oobabooga

Copy link
Copy Markdown
Member

This PR is a preparation for merging unslothai/llama.cpp#23.

Currently, on a Linux device with a usable NVIDIA GPU, if no CUDA prebuilt covers the GPU, a source compilation is triggered. After unslothai/llama.cpp#23 is merged and runs, the manifest will also include CPU builds, and _linux_published_attempts would then fall through a bare else and append the manifest's linux-cpu bundle. That silently installs a CPU-only llama.cpp on a GPU box, instead of raising so the caller source-builds with CUDA.

Every other GPU path already avoids this (ROCm excludes CPU, Windows NVIDIA returns before its CPU line). The bare else came in with #5963.

Fix

Exclude usable-NVIDIA hosts from the CPU branch (now a flat if has_usable_nvidia / elif has_rocm / else), so an empty CUDA selection source-builds with CUDA instead. No effect today; this lands ahead of unslothai/llama.cpp#23 so its CPU builds don't start shadowing GPU hosts.

Added a live-path test; test_selection_logic.py 246 passed.

@oobabooga
oobabooga requested a review from danielhanchen as a code owner June 14, 2026 04:16

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request updates the _linux_published_attempts function in studio/install_llama_prebuilt.py to prevent NVIDIA-enabled hosts from silently falling back to a CPU-only binary if their CUDA selection fails. It changes the ROCm check to an elif block and adds comments explaining the CPU-only gate logic. Additionally, corresponding unit tests are added in tests/studio/install/test_selection_logic.py to verify this behavior. I have no further feedback to provide as the changes are well-implemented and covered by tests.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

@oobabooga

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Delightful!

Reviewed commit: b1eb1d9a9b

ℹ️ About Codex in GitHub

Codex has been enabled to automatically 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 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

@oobabooga
oobabooga merged commit a3ca5d2 into unslothai:main Jun 14, 2026
33 of 35 checks passed
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.

1 participant