Repository navigation
Detect CUDA UMD Version from newer nvidia-smi output (fixes #5812) - #5817
Merged
Merged
Conversation
Newer NVIDIA drivers (e.g. 610.x on Windows) print the driver's max CUDA capability as "CUDA UMD Version: X.Y" instead of the legacy "CUDA Version: X.Y" header. The installers and Studio setup scripts were only matching the legacy spelling, so on a fresh RTX 5090 laptop with a 13.x driver they failed to detect any CUDA version and fell through to the cu126 wheel default. Accept both spellings everywhere we parse nvidia-smi output: - install.ps1: Get-TorchIndexUrl regex now allows " UMD" - install.sh: two-expression sed (POSIX BRE has no "?"); the two patterns are mutually exclusive per line, head -1 picks the match - studio/setup.ps1: Get-PytorchCudaTag and the $DriverMaxCuda detector both relaxed - studio/install_llama_prebuilt.py: substring scan replaced with a regex search using the same pattern - tests/sh/test_get_torch_index_url.sh: new make_mock_smi_umd helper plus three UMD cases (13.3 -> cu130, 12.8 -> cu128, 11.8 -> cu118); all 30 tests pass locally
|
Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits. |
Contributor
There was a problem hiding this comment.
Code Review
This pull request updates the installation and setup scripts (install.ps1, install.sh, studio/install_llama_prebuilt.py, and studio/setup.ps1) to support parsing the newer "CUDA UMD Version" header format alongside the legacy "CUDA Version" format from nvidia-smi output. This ensures correct CUDA version detection and PyTorch tag mapping with newer NVIDIA drivers (e.g., 610.x). Additionally, corresponding unit tests have been added to verify this behavior. I have no feedback to provide as there are no review comments and the changes are well-implemented.
danielhanchen
added a commit
to oobabooga/unsloth
that referenced
this pull request
May 31, 2026
…ows + Linux) (unslothai#5879) Make the NVIDIA prebuilt selection version-dynamic and driver-gated on both the Windows (ggml-org) and Linux (unslothai/llama.cpp) paths, so CUDA version bumps are handled with no code change while staying safe across driver versions. - Derive candidate CUDA runtime lines from the driver major; pick the highest upstream-published minor the driver can actually run, so a sub-13.3 driver is never handed an unguaranteed 13.3 build. - Pin b9360's cuda-13.1 build (immutable, hash-verified) as a GPU fallback for a Blackwell host on a 13.1/13.2 driver that the in-release 13.3 build gates off, on both the simple and published install paths. Dormant for every other host and self-disabling once upstream ships a driver-runnable build again. - Seed the published-path ordering from the release's real published minors so a future CUDA major is selectable with no code change. Refs unslothai#5861, unslothai#5817, unslothai#5807, unslothai#5858, unslothai#5854, unslothai#5826, unslothai#5887.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes #5812. Newer NVIDIA drivers (e.g. 610.x on Windows, shipped with the RTX 5090 Laptop) print the driver's max CUDA capability as
CUDA UMD Version: X.Yinstead of the legacyCUDA Version: X.Yheader. Every CUDA-version parser in this repo was only matching the legacy spelling, so on a system with a 13.x driver:install.ps1reportedcould not determine CUDA version from nvidia-smi, defaulting to cu126and installed acu126PyTorch wheel on acu130-capable driver.install.sh.setup.ps1mis-selected the PyTorch CUDA tag and silently left$DriverMaxCudaunset, so the CUDA Toolkit version pin was wrong too.studio/install_llama_prebuilt.pyskipped the line entirely and could route GPU hosts to the CPU-only llama.cpp prebuilt.Reporter's sample
nvidia-smiheader:Changes
install.ps1Get-TorchIndexUrlregex relaxed toCUDA(?: UMD)? Version:\s+(\d+)\.(\d+).install.sh-eexpressions (UMD first, legacy second). The two patterns are mutually exclusive per line sohead -1selects the right match.studio/setup.ps1Get-PytorchCudaTagand the$DriverMaxCudadetector.studio/install_llama_prebuilt.pyre.search(r'CUDA(?: UMD)? Version:\s*(\d+)\.(\d+)', merged).tests/sh/test_get_torch_index_url.shmake_mock_smi_umdhelper plus three UMD cases:13.3 -> cu130,12.8 -> cu128,11.8 -> cu118.Regex sanity check on the reporter's exact sample:
The legacy header still matches and continues to route 12.6 -> cu126, 12.8 -> cu128, 13.0 -> cu130, etc.
Test plan
bash tests/sh/test_get_torch_index_url.sh-> 30 passed, 0 failed (27 existing + 3 new UMD cases).CUDA UMD Version: 13.3line from the issue: routes tocu130.CUDA Version: 12.6line still routes tocu126.irm https://unsloth.ai/install.ps1 | iexand confirminstalling PyTorch (https://download.pytorch.org/whl/cu130)...(cannot run from this environment, requested verification from the reporter).Closes #5812.