Repository navigation
Say ROCm does not cover RDNA 1 instead of advising a fix that cannot work - #8577
Conversation
An RX 5700 XT (Navi 10, gfx1010, RDNA 1) correctly lands on CPU PyTorch: AMD publishes Windows torch indexes for gfx103X, gfx110X, gfx1150, gfx1151 and gfx120X, and there is no gfx101X index. Because the name-inference table covers only arches that have wheels, the arch stayed null and the installer fell into the "arch unknown" arm, which tells the user to install the HIP SDK or set UNSLOTH_ROCM_GFX_ARCH. Neither can work: UNSLOTH_ROCM_GFX_ARCH=gfx1010 lands on the unmapped-arch path and returns CPU anyway. Add a separate name lookup for AMD generations ROCm PyTorch does not cover, read only to word the report. Product names come from LLVM's AMDGPU GFX10.1 processor table. The lookup never sets the arch the installers route on, so CPU fallback is reached by exactly the same path as before. Mirrored across install.ps1, studio/setup.ps1, install.sh, studio/setup.sh and studio/install_python_stack.py so every install path agrees.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 7ff4e4a8c4
ℹ️ 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".
| _unsup_disp=$(lspci -nn 2>/dev/null | grep -E 'VGA compatible controller|3D controller|Display controller' | grep -E 'AMD|ATI' || true) | ||
| while IFS= read -r _unsup_ln; do | ||
| [ -n "$_unsup_ln" ] || continue | ||
| if _unsup_gfx=$(_infer_unsupported_amd_gfx_arch_from_gpu_name "$_unsup_ln"); then | ||
| echo "$_unsup_gfx" |
There was a problem hiding this comment.
Restrict unsupported detection to the selected AMD adapter
On a multi-AMD host, this scans every display controller and returns the first RDNA 1 match without respecting HIP_VISIBLE_DEVICES/ROCR_VISIBLE_DEVICES or identifying which adapter caused arch detection to fail. For example, a selected MI/CDNA or otherwise supported-but-name-unmapped GPU alongside an RX 5700 will now be told that CPU fallback is expected and that repairing rocminfo cannot help, even though the RX 5700 may be an unused display card and restoring the runtime probe would enable ROCm on the selected GPU. Tie this lookup to the selected adapter, or only issue the categorical warning when all candidate AMD adapters are known unsupported.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Checked and not taking this one.
The new lookup sits inside if [ -z "$_amd_gfx_probe" ] (install.sh:3370), and _probe_amd_gfx_arch greps rocminfo, then amd-smi list, then amd-smi static --asic. On the host you describe the MI/CDNA card is selected and working, so it enumerates, the probe is non-empty, and line 3380 is never reached. _infer_linux_amd_gfx_arch also runs first and returns outright for any supported card the name table knows. The second site (install.sh:4506) is inside case "$TORCH_INDEX_URL" in */cpu), and the runtime-less reroute at 4034 has already rewritten that variable for a name-mapped supported card.
What is left needs a multi-AMD host where rocminfo and amd-smi both fail to enumerate anything, plus a supported card missing from the name table. I ran that case (MI210 + RX 5700, no rocminfo) against both revisions: whl/cpu before, whl/cpu after, in either PCI order. Only the stderr wording differs.
And the pre-existing _infer_linux_amd_gfx_arch (install.sh:2967) does exactly the same thing, one lspci scan, first mapping line wins, no HIP_VISIBLE_DEVICES, with its comment documenting that choice. That one feeds TORCH_INDEX_URL and exports UNSLOTH_ROCM_GFX_ARCH; this one only picks words. Tying the messaging copy to the selected adapter while the routing copy stays first-match would be the wrong half to harden.
Also, HIP_VISIBLE_DEVICES indexes ROCr agent enumeration order, not PCI order, so there is no correct mapping from it onto a list of lspci lines, and on this code path ROCr is by construction not answering.
The previous commit stopped at "ROCm does not cover this GPU", which is true and still a dead end. There is a working path: llama.cpp's Vulkan bundle drives these cards, which is how #8458's reporter got an RX 580 running and how LM Studio drives the same hardware. Nothing routes these users there automatically. _should_auto_vulkan_for_amd_windows opens with `active = _active_rocm_gfx_target(host); if not active: return False`, and a pre-RDNA 2 card resolves to no gfx target at all, so the Windows auto-Vulkan fallback structurally cannot fire for exactly the cards that need it. The environment variable is their only route, so the message now names it. Two things about that advice are load-bearing and both are tested: - The current spelling, UNSLOTH_LLAMA_CPP_BACKEND=vulkan. The legacy UNSLOTH_FORCE_VULKAN still works but force_vulkan_requested() resolves the new variable first and consults the legacy one only when the new one is absent or unparseable, deliberately, so =hip stays a real opt-out that a stale legacy variable cannot overrule. New text must not spread the legacy name. - WHEN to set it. The variable picks the llama.cpp bundle at install/download time; nothing reads it at runtime to choose a binary. #8458's reporter set it after installing, saw no change, and only a clean reinstall worked. Advice that names the variable without naming the moment is worse than none. Also adds Polaris 10/20/30 (RX 470/480/570/580/590, gfx803) to the messaging-only table so #8458's card gets the right message. gfx803 stays out of _GFX_TO_AMD_INDEX_ARCH and every supported-arch table, and routing is untouched; a test pins that directly. Polaris 11/12 (RX 460/550/560) is left out because gfx803 vs gfx804 could not be confirmed for that die, and this table is only worth having while it never guesses. "RX 570" is a prefix of "RX 5700" and "RX 550" of "RX 5500". Python and PowerShell carry (?!0) lookahead guards; POSIX `case` has no lookahead, so in install.sh and studio/setup.sh correctness rests on arm order and the RDNA 1 arms come first. That order is now documented and asserted, and the shipped arms are evaluated in a real shell rather than checked by eye. README leads with the current spelling, since the installer now names a variable and the README is where users check it. Finally, test_cpu_index_note_respects_explicit_pin asserted a pin check appeared within a character window before a note. That is a budget on intervening source, not the ordering property it is for, and this work had already pushed it from 400 to 1400. It now walks the enclosing if/elif chain by indentation, so it tests order and has no distance left to re-tune.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 4c969f6d1f
ℹ️ 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".
| # Repairing rocminfo cannot help a generation ROCm PyTorch never covered: | ||
| # the arch would read fine and still have no wheels (unslothai#8529). Same | ||
| # CPU index either way; only the advice changes. | ||
| if _amd_unsup_gfx=$(_infer_linux_unsupported_amd_gfx_arch 2>/dev/null); then |
There was a problem hiding this comment.
Classify readable unsupported gfx arches before selecting ROCm
On a Linux RDNA 1/Polaris host where rocminfo or amd-smi successfully reports gfx1010/gfx803, _amd_gfx_probe is nonempty, so the outer if [ -z "$_amd_gfx_probe" ] skips this new unsupported lookup entirely. With a readable ROCm version, get_torch_index_url then proceeds to a generic ROCm index instead of this CPU branch, and studio/setup.sh similarly labels any nonempty _setup_gfx as AMD ROCm; thus the normal runtime-readable case never receives the unsupported/Vulkan diagnosis this change adds. Check the probed arch against the unsupported set before continuing to ROCm version/index selection.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
The control-flow reading is right and the failure is real, but it is not this PR's, so no change here.
Verified by running get_torch_index_url from both revisions against a stubbed host:
| host | before | after |
|---|---|---|
| rocminfo reads gfx1010, ROCm 6.4 | whl/rocm6.4 |
whl/rocm6.4 |
| rocminfo reads gfx803, ROCm 6.4 | whl/rocm6.4 |
whl/rocm6.4 |
| rocminfo missing | whl/cpu |
whl/cpu |
Index selection on the readable path is purely ROCm-version-keyed (the case at install.sh:3404); there is no arch allowlist or denylist in front of it, and git show <base>:install.sh | grep -c 'gfx1010\\|gfx803' returns 0. So the mis-route you describe predates this branch and this branch does not touch it. Same for studio/setup.sh: the new arm is an elif after [ -n "$_setup_gfx" ], exactly as before.
It is worth fixing, and separately. It is a routing change, which is the one thing both new tables are commented as never doing, and it needs its own regression coverage: the arch has to be classified before version-tag selection so the host lands on $_base/cpu instead of hipErrorNoBinaryForGpu at the first GPU op. Note also that the ROCm 7.x hsa_init abort on gfx803 already tips those hosts into the empty-probe branch this PR added, so the remaining exposure is ROCm 6.x. I will open that one on its own.
…dvice An RDNA 1 or Polaris user who already installed the HIP SDK never saw the new message: the $HipSdkInstalled arm sits earlier in the chain and told them the ROCm compute driver was missing, which is the impossible remediation this change exists to remove, and those users installed the SDK because the old advice said to. Guard that arm, plus the matching CPU-hint arm in install.ps1, on the unsupported arch. The Vulkan setter was printed as UNSLOTH_LLAMA_CPP_BACKEND=vulkan by the two PowerShell installers and by the Windows-only branch in install_python_stack.py. PowerShell parses that as a command name, so a user who pastes it sets nothing and the next install picks the same CPU bundle. Print $env:UNSLOTH_LLAMA_CPP_BACKEND = "vulkan" there, as the README already does. The arms also said PyTorch training runs on CPU on these GPUs. It does not: with no CUDA or XPU accelerator, unsloth raises NotImplementedError at import, which is why studio/setup.sh already tells its other CPU-torch hosts that training and GPU inference are unavailable. Say the same thing here. README: Vega 20 (Radeon VII, MI50, gfx906) is older than RDNA 2 and does have a ROCm PyTorch path (install.sh routes it to rocm6.3), so name Polaris and RDNA 1 instead of every pre-RDNA 2 AMD GPU.
|
Codex Review: Didn't find any major issues. Breezy! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
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". |
The ban was on one exact literal, so "every AMD GPU older than RDNA 2" passed while contradicting the Vega 20 carve-out two sentences later. Match the phrase family instead, and assert the group is named by its members (Polaris, RDNA 1) rather than by a generation cutoff.
Comments only, no code or user-facing string touched. Every reason a guard exists is kept, just said in fewer lines.
…on block The ROCm summary reads $script:ROCmUnsupportedGfxArch unconditionally, but the assignment sat inside `if (-not $HasNvidiaSmi)`, so an NVIDIA host never defined it and a caller's Set-StrictMode turned the summary into an aborting undefined-variable error. ROCmGfxArch beside it was always initialised at top level; this one was not. The guard asks the PowerShell parser whether any assignment is unnested rather than comparing line numbers: the file has three -not $HasNvidiaSmi blocks, so an ordering check picks the wrong one and passes for the wrong reason.
…p mixed AMD hosts on the arch-unknown advice Adds the Navi 10 / Navi 14 professional boards LLVM's processor table omits (Radeon Pro W5700/W5700X -> gfx1010, Pro W5500/W5500M/W5300M and RX 5300/5300M -> gfx1012) to all five copies of the unsupported-name table. Each mapping comes from libdrm data/amdgpu.ids read against pci.ids and the kernel amdgpu PCI table, not from a guess; the tables still route nothing. studio/setup.sh's KFD sysfs fallback detects the GPU without rocminfo or amd-smi, so it left the marketing name empty and the report fell through to a plain AMD ROCm line on a host with no ROCm. It now reads lspci for that report only, never writing it back into the name the supported table and --rocm-gfx key on. install.ps1's WMI fallback classifies adapter 0 only, so a host pairing an RX 5700 with an RX 7900 was told nothing could enable ROCm, which is false there. The verdict is now withheld when another adapter is covered, leaving the arch-unknown advice that does apply. install_python_stack.py and studio/setup.ps1 already scored every adapter.
|
Codex Review: Didn't find any major issues. Keep it up! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
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". |
|
CI triage for this PR: nothing here is this PR's fault, and two of the red checks are not failures at all. The three Backend failures on Python 3.10 through 3.13 are main's own defect, reproduced on a clean detached worktree at with
|
|
Platform-isolation audit: this one is clean, and I want the reasoning on the record rather than a bare pass. The RDNA 1 message is gated on WSL takes the Linux branch, which is correct. The blocking failures on this PR are main's, not this PR's, and I have posted that separately. Stated plainly: no AMD RDNA 1 hardware here. This is a static trace of the guards, not an observation. |
…oards it was missing A host is not one GPU. On a box pairing an uncovered card with one that has wheels -- an RX 580 beside an RX 7900 XTX, or beside an Instinct MI210 -- "setting UNSLOTH_ROCM_GFX_ARCH will not enable ROCm PyTorch" was false: masking to the other card and pinning its arch installs them, and install.sh routes exactly that host to gfx110X-all a few lines earlier. Every advice site now says what is true of the card it just named and claims nothing beyond it. Deciding it at runtime was tried and dropped. Reading "an AMD adapter neither table names" as a working peer misfires on the Vega-class iGPU (Raven through Cezanne, Mendocino) that sits beside the dGPU on most Ryzen desktops and has no ROCm torch path of its own, which would trade a correct dead stop for the open-ended errand this change exists to remove. Reading only the supported table misses the Instinct and V620 parts that are routable and appear in no name table at all. Neither rule is right often enough to speak for a host. Four real boards are added to all five copies of the message-only table: Radeon Pro 5700 / 5700 XT (pci.ids 7319 and 731b, Navi 10, gfx1010) are the only Navi 10 retail parts whose name carries neither "RX 5700" nor a W prefix, and Radeon Pro WX 7100 / WX 5100 (Ellesmere, gfx803) carry no RX number at all, so both fell through to the generic advice. Provenance from pci.ids as before, and the shell case arms are matched case-sensitively, which is now stated where only the arm ordering was. Tests: - The absolute host-wide phrasings are banned from all five sources, with the scoped replacements required per site so deleting the sentence cannot pass. - test_unsupported_arch_routing_guards_8529.py drives the real index resolvers rather than asserting table shape: install.sh's get_torch_index_url and _amd_arch_index_family_for_gfx under sh, the .ps1 family maps under pwsh (including writes after the declaration, and the -contains list), the Python resolvers on both platforms, the Strix per-arch reroute, and studio/setup.sh's report-only lookup. Positive controls throughout. - _assert_guarded_by_pin_arm matches the pin arm exactly rather than by prefix, binds the message's own enclosing arm, requires the pin arm to still say its note, ignores comment lines, and detects inline and re-indented chain closes. Mutation tested: 13 mutants covering a post-declaration map write in each .ps1, a single-quoted arch in _rocmWheelArches, a bypass inside get_torch_index_url, the Strix arm, feeding the unsupported lookup into _setup_gfx directly and one hop later, an inline-closed pin chain, a re-indented fi, and removing each new table row. All killed.
|
Pushed a follow-up, The verdict spoke for the host, and a host is not one GPUOn a box pairing an uncovered card with one that has wheels, "setting while Every advice site now says what is true of the card it just named. Same in Why there is no peer checkI built one first, softening the sentence when another AMD adapter was present that the tables could not name. It reads the wrong way round on ordinary hardware: the Vega-class iGPU (Raven through Cezanne, plus Mendocino) sits beside the dGPU on most Ryzen desktops, is unroutable, and matches no table, so an RX 5700 XT in a Ryzen 5000G box would have lost "This is expected on this GPU" and been sent back to the errand this PR exists to remove. Confirmed against the real family map: Keying on the supported table instead, which is what Four boards the table should have namedSweeping every AMD display device in
The MPX boards are the only Navi 10 retail parts whose name carries neither I also noted where only the arm ordering was documented that the shell Tests
Mutation tested, all killed: a post-declaration map write in each Suites on this branch: The Backend CI and No AMD hardware was involved. As with all AMD coverage here, everything is mock-based. |
studio/setup.ps1 carries the same WMI scan install.ps1 does, for its own name inference, and it had the same gate. amd-smi can report GPUs with no gfx token and only the first market name, which sets $HasROCm with no arch, so the scan was skipped, $script:ROCmGpuLabels held one name, $gpuNames was one entry, and a host pairing an RX 5700 with an RX 7900 was judged entirely on the 5700 even with HIP_VISIBLE_DEVICES=1 selecting the 7900. The scan is now gated on the arch, which is the condition the inference block below already runs under, so the two can no longer disagree about whether there is anything to infer from. A host that already has an arch still does no WMI work here, and amd-smi's label still wins when it had one: only the peer list is new on that path. The pwsh suite walks the AST from the $script:ROCmGpuLabels assignment to its enclosing if and asserts the condition names the arch and not $HasROCm, as it already does for install.ps1. Restoring the old gate fails it. tests/test_windows_amd_gpu_scan_fallback.py extracts that block with a regex anchored on the literal gate, so its pattern follows the new condition.
The guard added last round only covered setup.sh's lspci fallback, so a named
hit still walked past it. amd-smi reports one market name, the first device's,
so on a host whose RX 5700 precedes an RX 7900 the name IS the uncovered card
and the false verdict came back through the other door.
The scan now runs first, for both paths:
lone RX 5700, named named -> unchanged
lone RX 580, named named -> unchanged
RX 5700 + RX 7900, named 5700 named -> quiet
RX 5700 + RX 7900, no name quiet -> unchanged
It must not become a silencer, so it applies only when lspci can answer: with
no adapter list there is no peer to find, and the single-card host this report
exists for still has to be told. A test drives the lookup with lspci off PATH
and requires the verdict to survive.
Putting the named hit back in front fails the two mixed-host cases while that
no-lspci control still passes, so the ordering is what is pinned, not just the
presence of the guard.
|
Codex Review: Didn't find any major issues. Breezy! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
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". |
install.ps1:3331 was the only live Get-WmiObject call left in the file; every other WMI query in it already asks Get-CimInstance, and the script handles PSEdition Core explicitly. Get-WmiObject was superseded by Get-CimInstance in PowerShell 3.0 and removed outright in PowerShell 7, so on pwsh the call threw, the block's own catch swallowed it, and $wmiAmdNames came back empty. That is the peer list the guard added two rounds ago reads, so on pwsh the guard could never fire and the amd-smi path went back to blaming the uncovered card. Same class, same properties, and the CIM cmdlets ship with 5.1 as well, so the swap costs nothing downlevel and matches what studio/setup.ps1 already does. The harness stubbed Get-WmiObject, so it was answering for a cmdlet the installer no longer calls. It now stubs Get-CimInstance and defines Get-WmiObject to throw, so a revert fails loudly instead of quietly returning nothing through that catch. Reverting the call fails four tests.
|
@codex review |
1 similar comment
|
@codex review |
|
Codex Review: Didn't find any major issues. Hooray! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
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". |
|
@codex review |
|
Codex Review: Didn't find any major issues. Can't wait for the next one! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
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". |
|
Follow-up opened as #8689. Two of the guards I added here went past message-only and changed which PyTorch gets installed on some AMD hosts.
#8689 restores both scans byte-for-byte and moves the peer names into their own variable that only the uncovered-card verdict reads. It also fixes a drift it exposed: the five copies of the unsupported table were never pinned to each other, and the shell globs matched "RX 5800" as Polaris through |
…they exposed (#8689) * Keep the peer guards message-only, and stop the shell Polaris arms over-matching Adversarial verification of the "message-only" claim found two ways this branch had started changing what gets installed, both introduced by my own review fixes. studio/setup.ps1: widening the adapter scan gate from $HasROCm to the arch let CIM fill $script:ROCmGpuLabels on the amd-smi path. That variable feeds $gpuNames and so the arch inference, and the existing unpinned "borrow another adapter's arch" rule then resolved an arch where none was resolved before. On a host where amd-smi confirms a runtime but reports no gfx token, an RX 9070 XT went from CPU torch to gfx1201, and an RX 5700 beside an RX 7900 went to gfx1100, with --rocm-gfx forwarded to the llama.cpp and whisper installers. install.ps1: the Get-WmiObject to Get-CimInstance swap had the same effect on PowerShell 7, where the old call threw and the catch swallowed it. A host CIM can see but the ROCm tools cannot went from CPU torch to a repo.amd.com index. Both scans are now exactly what they were before this branch, byte for byte, and the peer names live in their own variable that only the uncovered-card verdict reads: $wmiAmdNames in install.ps1, $script:ROCmPeerLabels in studio/setup.ps1. Neither block writes a label or an arch. The pwsh suite asserts that through the AST rather than asserting the gate, which is the property that actually matters; appending a label or arch assignment to either block fails it. The PowerShell 7 Get-WmiObject defect is therefore still there. Fixing it changes what every pwsh 7 AMD host without a HIP SDK installs, so it belongs in its own PR. Separately, the five copies of the unsupported table were not pinned to each other, only the supported ones were, and they had already drifted: the regex copies carry (?!0) so "RX 5800" is not Polaris, while the shell globs matched it through "RX 580". The shell arms now carry the same guard, and a new test compares all five tables by EVALUATING them in their own languages over a shared name corpus. Adding a row to one file alone fails it. Also pinned: a blank UNSLOTH_TORCH_INDEX_URL / _FAMILY must not read as a pin in the Python path, which dropping the .strip() previously passed. * Yield the peer suppression to an AMD visible-device mask The peer check walked every adapter without looking at HIP_VISIBLE_DEVICES or ROCR_VISIBLE_DEVICES, so on a mixed host a masked-out supported card could silence the verdict about the card the user had actually selected. Both installers now skip the suppression under a mask, which is the rule studio/setup.ps1 already applies to its arch-borrowing branch: the mask names the card, so the verdict is about that one. HIP and ROCR only, deliberately, not Test-VisibleDevicesPinned's set: CUDA_VISIBLE_DEVICES masks NVIDIA devices and says nothing about which Radeon was chosen, and counting it fired the verdict beside a covered Radeon on every host that sets it, which two of the pwsh cases caught immediately. Three assertions per file pin it. Emptying the mask list fails one, adding CUDA_VISIBLE_DEVICES back fails another. * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Scan adapters with CIM and drop the masked verdict when it may name another card for PR #8689 --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Reported by @AssabTigleG in #8529.
What the user saw
A Radeon RX 5700 XT on Windows, plainly present and working in Task Manager, and an installer that ended on
Torch 2.10.0+cpuafter telling them:Why the CPU fallback is correct, and unchanged
The RX 5700 XT is Navi 10, gfx1010, RDNA 1. AMD publishes Windows torch indexes for gfx103X (RDNA 2), gfx110X (RDNA 3), gfx1150 / gfx1151 (RDNA 3.5) and gfx120X (RDNA 4). There is no gfx101X index, and no PyTorch ROCm build targets gfx101X on Linux either. CPU PyTorch is the right answer on this card and this PR does not change it. Every routing table, wheel index and supported-arch list is untouched, and the tests below re-assert on each path that RDNA 1 still resolves to no arch and still falls back to CPU.
Why the old advice was impossible to act on
The name-inference table only maps arches that have wheels, so an RDNA 1 card left the arch null and fell into the
arch unknownarm. Both remedies that arm names are dead ends:UNSLOTH_ROCM_GFX_ARCH=gfx1010is honoured, lands on the unmapped-arch path, and returns CPU anyway. The user pays for an SDK install and a reboot to reach the same place.Worth noting that the neighbouring branch already had the right words for a known-but-unmapped arch ("no ROCm PyTorch wheels are available for $ROCmGfxArch"). RDNA 1 simply never reached it, because nothing ever named its arch.
The change
A second, separate name lookup for AMD generations ROCm PyTorch does not cover. It is read only to word a message. It never assigns the variable the installers route on, so the CPU fallback is reached by exactly the same code path as before, and a row added to it can never make an arch installable. That property is asserted directly: no arch in the new table may appear in the gfx-to-index family map, and the two tables may not share an arch.
The new arm now says the GPU was detected, names its arch, states that ROCm does not cover it, and points at the one path that does work.
Which arches are named, and which are not
Included, with product names taken from LLVM's AMDGPU processor tables rather than guessed:
Polaris 10/20/30 is here because #8458 is the same defect on an RX 580, and that is the silicon the card reports itself as.
Deliberately left out: Polaris 11/12 (RX 460 / 550 / 560), Vega (gfx900 / gfx906), and gfx1013, which LLVM lists with no product names at all. Polaris 11/12 is a different die and I could not confirm gfx803 against gfx804 for it; the others have no report confirming them and no in-repo evidence for the mappings. A wrong arch printed at a user is worse than no arch, and the value of this table is that it never guesses. Adding a row later is a one-line change per file.
The name collision this table is one keystroke away from
RX 570is a prefix ofRX 5700, andRX 550ofRX 5500. A Polaris row that swallowed an RX 5700 XT would be a straight regression on the card this PR started from.Python and PowerShell carry
(?!0)lookahead guards, so those rows are correct matched on their own. POSIXcasehas no lookahead, so ininstall.shandstudio/setup.shcorrectness rests entirely on arm order: the RDNA 1 arms come first and the Polaris arm comes last. That order is now documented as load-bearing at both sites and asserted directly, and the shippedcasearms are evaluated under a realshrather than checked by eye. Reversing them in a scratch copy does resolveAMD Radeon RX 5700 XTtogfx803, which is what the ordering test exists to catch.Where these users can actually go: llama.cpp on Vulkan
Saying "ROCm does not cover this GPU" is true and still a dead end. Vulkan is not: #8458's reporter got an RX 580 running through it, and LM Studio drives the same card with its Vulkan llama.cpp engine. Torch stays on CPU on these boards, but GGUF chat runs on the GPU.
Nothing sends these users there on its own.
_should_auto_vulkan_for_amd_windowsopens with:A pre-RDNA 2 card resolves to no gfx target at all, so the existing Windows auto-Vulkan fallback structurally cannot fire for exactly the cards that need it most. The environment variable is their only route, which is why the message now names it.
Two things about that advice are load-bearing, and both are asserted per site rather than per file:
Which spelling. Only
UNSLOTH_LLAMA_CPP_BACKEND=vulkanis taught. The legacyUNSLOTH_FORCE_VULKANstill works, butforce_vulkan_requested()resolves the new variable first and consults the legacy one only when the new one is absent or unparseable:That precedence is deliberate and keeps
=hipa real opt-out, so new text spreading the legacy name would work against it. A test bans the legacy spelling from any line that prints, while leaving the back-compat code that reads it alone.When to set it. The variable selects which llama.cpp bundle is downloaded, at install time. The only runtime read is
_vulkan_prebuilt_was_auto_selected, which inspects whether an override was set purely to word a crash message; nothing at runtime swaps a binary. #8458's reporter set the variable after installing, saw nothing happen, and only a clean reinstall worked. Advice that names the variable without naming the moment costs the next person the same evening, so every message that names it also says the bundle is chosen at install time.Files touched
install.ps1-- new$unsupportedNameArchTable, consulted only after the supported table misses; three message sites (thegpusummary, the reroute note, the CPU-only note).studio/setup.ps1-- same table, reusing the existingGet-GfxArchFromGpuName; thegpusummary and therocmstep.install.sh--_infer_unsupported_amd_gfx_arch_from_gpu_nameplus an lspci-driven_infer_linux_unsupported_amd_gfx_arch; the index-selector warning that used to say "repair rocminfo/amd-smi", and the*/cpunote that used to say "install the ROCm/HIP SDK".studio/setup.sh--_setup_unsupported_gfx_from_nameand thegpustep.studio/install_python_stack.py--_UNSUPPORTED_GPU_NAME_ARCH_TABLEand_unsupported_gfx_arch_from_gpu_name; the WMI-name warning in_detect_windows_gfx_arch, which is the exact line the reporter's driver-only host hits.README.md-- the Vulkan instructions now lead withUNSLOTH_LLAMA_CPP_BACKEND=vulkanin both copy-paste blocks, and say that this is the path for pre-RDNA 2 AMD GPUs. The installer now names a variable, and the README is where people will go to check it.tests/studio/install/test_rocm_support.py--test_cpu_index_note_respects_explicit_pinasserted that a pin check appeared within a character window before a note. That is a budget on how much source may sit between the two, not the ordering property the test is named for, and this work had already pushed it from 400 to 1400 with the real distance at ~1121. It now walks the enclosingif/elifchain by indentation and asserts that the pin arm opens the chain and the message sits in a later arm. No distance, nothing left to re-tune.studio/frontend/src/i18n/locales/en.tsis deliberately not touched. See below.The "No visible GPU" string
I looked at whether Studio can honestly say "detected but unsupported" instead of "No visible GPU detected", and it cannot today.
resources-tab.tsxbranches onhasGpu = (displayedGpu?.available ?? false) && metrics.devices.length > 0, and its only input isGET /api/system. That payload'sdeviceslist is populated exclusively fromtorch.cuda/torch.xpu/ MLX inget_backend_visible_gpu_info(); the SMI branch is explicitly skipped on ROCm. Nothing in the response carries an adapter inventory (there is no WMI or lspci enumeration anywhere in the backend), no installer-recorded gfx arch (unsloth_install_manifest.jsonhas no gfx field, and/api/systemnever reads it), and no CPU-only torch flavour tag. The nearest reason field,chat_only_reason, collapses both cases to"no_gpu"and is not on this endpoint anyway.So the frontend genuinely cannot tell an absent GPU from an unusable one. Distinguishing them needs a torch-independent adapter probe plus a torch-unavailability reason surfaced on
/api/system, and new i18n keys inen.tsand all 11 overlays (CI runsnpm run i18n:check:strict). That is a backend change and its own PR. Making the string vaguer in the meantime would trade a specific wrong message for a woolly one, so I left it alone.How it was verified
New coverage:
tests/studio/install/test_rdna1_unsupported_message_8529.py-- 60 tests. The lookup itself; a parity check that all five copies of the table answer identically; the scope guards (no arch here is routable, the supported table still misses RDNA 1); the Windows WMI path driven end to end with hipinfo and amd-smi absent, asserting both that no arch comes back and that the printed text names gfx1010 without teaching the override; the shell copies executed under a realshrather than parsed; and the branch ordering in each installer, with "was found" guards so a renamed branch fails instead of passing vacuously.tests/studio/test_rdna1_unsupported_message_8529.ps1-- now also covers the Polaris rows, the standalone(?!0)guards, and the Vulkan advice per site. Runs the table under the .NET regex engine that actually ships it, which is the only place-matchsemantics are real, and checks the source text with CRLF normalisation.Every new assertion was mutation tested: the source change it covers was reverted, the test confirmed to fail, and the source restored. 48 mutants, 48 killed, no survivors. They cover deleting or gutting each advice site in all five files, dropping the timing clause at each site independently, teaching the legacy spelling, demoting a message to a comment, removing the Polaris row and its
(?!0)guards from each of the five copies, reordering the shellcasearms, making gfx803 routable, claiming Polaris 11/12, reverting each README block, and inverting the pin arm the reworked ordering test guards.Four mutants survived a first pass and each one moved a test rather than being written off:
install.shadvice site whole. Both remaining tests were file-level, so the surviving site answered for the file. There is now an explicit per-site registry with expected counts, anchored on each arm's announcement line.install.ps1was reworded to match, since one arm reached the backend name only through the lowercase value.(?!0)guards from a PowerShell table. Row order already stops the RDNA 1 names from ever reaching the Polaris row, so the guard was untestable through the table. It is now matched standalone in both the Python suite and the pwsh one.Two more things worth stating about how these were checked. The shell
casearms are executed under realdashandbashinstead of being parsed and re-implemented, and the PowerShell rows are matched by the .NET engine that ships them. And the guard against a table becoming a routing change is asserted directly:gfx803must stay absent from_GFX_TO_AMD_INDEX_ARCH.Suites, run serially:
test_rocm_support.pytest_rocm_arch_table_parity.pytest_rdna1_unsupported_message_8529.pytest_cross_platform_parity.pytest_windows_amd_gpu_scan_fallback.pytest_rocm_rdna_routing.pytest_rocm_gfx_spoof_7331.pytest_selection_logic.pytest_pr5940_followups.pytest_install_llama_prebuilt_logic.pytest_rdna1_unsupported_message_8529.ps1test_pre_turing_cap.ps1No AMD hardware was involved. As with all AMD coverage in this repo, everything here is mock-based.