Repository navigation
fix(AMD): route Fedora/Bazzite to per-arch ROCm wheels when no version is readable - #9152
Conversation
…n is readable install.sh polls five sources for a ROCm version and all five miss on Fedora packaging: amd-smi reports the arch but no version, /opt/rocm/.info/version is the AMD-installer layout, hipconfig sits under /opt/rocm rather than on PATH, dpkg is Debian-only, and rocm-core is not a package Fedora ships. With no version the installer put CPU-only PyTorch on a working RX 9070 XT and told the reporter to run pacman on an immutable Fedora image. The version only picks between the generic rocmX.Y leaves. _amd_arch_index_family_for_gfx already maps gfx1201 to gfx120X-all from the arch alone, and the arch was readable throughout. Route on it: the no-version deferral no longer requires UNSLOTH_ROCM_GFX_ARCH, and the runtime-less reroute gets a disjunct for readable-arch/unreadable-version hosts. A readable but UNSUPPORTED version stays a deliberate CPU fallback; only an unreadable one is treated as a detection miss. Also: read hipconfig from ROCM_PATH/bin when it is not on PATH, ask rpm about rocm-runtime and rocm-hip alongside rocm-core (in one query, so a wedged rpm still costs one timeout), and stop claiming no ROCm install was found on a host that has one, naming only a package manager the host actually has.
Codex P1 on a679d3f. The reroute decision is made from the arch rocminfo/amd-smi read, but the body still preferred _infer_linux_amd_gfx_arch and only fell back to the probe when inference came up empty. On a mixed APU + discrete AMD host the two name different GPUs, so the wheels and the exported UNSLOTH_ROCM_GFX_ARCH could target a card the decision never looked at. Reduce the probe to its first token once, in the state computation, and route on it whenever that state is set. The mapping check moves there too, so the state means exactly "get_torch_index_url deferred on this arch" rather than merely "a probe answered". Paths that reached the reroute before are untouched: they get there with an empty probe and still use the inferred arch.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 022cb270a6
ℹ️ 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".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 269e8fd882
ℹ️ 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".
…he version once An APU beside a discrete card reads two different arches. Both the gate and get_torch_index_url took whichever the kernel enumerated first, so a Strix laptop with a 9070 XT in it could take gfx1151 wheels for the discrete card and export that arch to setup.sh as well. Before this PR that host got CPU wheels, so the exposure is new here and worth closing here. _amd_sole_index_arch collapses the duplicate agents rocminfo emits, then requires every distinct arch to land in the same index family. No agreement, no reroute: CPU wheels are useless on such a host but they are not wrong, and UNSLOTH_ROCM_GFX_ARCH still names the card. Both call sites share the helper, so the gate and the function cannot desync. get_torch_index_url runs inside a command substitution, so the version it read cannot reach the reroute and the reroute asked again. On a wedged rpm database that is _rocm_tag_from_rpm's 10s timeout twice, on exactly the Fedora hosts this PR targets. _detect_rocm_version_tag now memoises to a file, which survives the subshell. Opt-in: an unset path means no cache, so a harness that sources the function alone keeps the old behaviour. 11 new assertions, 29/29 in the suite. Mutation-tested: reducing the helper back to first-agent-wins reproduces the APU-takes-the-wheels bug and fails three of them. tests/sh 29/29, 58/58, 64/64. tests/studio/install/test_rocm_support.py and test_unsupported_arch_routing_guards_8529.py 585 passed; the 2 failures there (test_rocm_version_detection_takes_the_highest_source, test_removed_dpkg_rocm_core_cannot_pick_the_wheels) fail identically on clean upstream/main.
|
Pushed Mixed-AMD host takes wheels for whichever GPU the kernel listed first. The ROCm version was probed twice on the target host. 11 new assertions in
Four harnesses that slice functions out of @codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 573a845522
ℹ️ 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".
…nguessable Two things a single helper was conflating. The index FAMILY is a property of the host: the wheels have to work on every AMD GPU in the box, so every agent must agree before anything reroutes. The concrete ARCH is one device's, and gfx1200 beside gfx1201 agree on gfx120X-all while still being two different cards. setup.sh takes UNSLOTH_ROCM_GFX_ARCH as authoritative over its own visibility-aware selection, so exporting an arbitrary member of an agreed family overruled a correct downstream pick with a coin flip and could build llama.cpp for the wrong card. _amd_agreed_index_family answers the first, _amd_sole_index_arch the second, and it declines when there is more than one distinct arch. The wheels still route on the family, because they are right for both cards; only the export and the tip are skipped, and the warning names the family instead. TORCH_CONSTRAINT now keys off the family too, which is safe because a family never straddles that boundary. The memo path was /tmp/unsloth-rocm-tag.1348. /tmp is shared and 1348 is observable, so a local user could pre-create it as a symlink and both feed the probe a chosen ROCm version and redirect the write. It is now a file inside an mktemp -d, created in the parent shell (the subshell's own would die with it) and removed with the other install temporaries. Also fixes the real CI regression: a fifth harness slices functions out of install.sh by name and only runs where sh exists, so Windows skipped it locally while Repo tests (CPU) caught it. Those splices are now one arch_fns blob per harness rather than four ad-hoc ones. _amd_sole_index_arch uses awk rather than wc, which is not in the harnesses' tool allowlist. tests/sh 37/37, 58/58, 64/64. tests/studio/install 2572 passed, 108 skipped, run under WSL so nothing sh-dependent is skipped; the 5 failures in test_install_manifest.py and test_managed_node_runtime.py reproduce with this branch stashed.
Two from the review of abc261d. install.sh has an explicit block that blanks every cleanup target before installing the EXIT and signal traps, precisely so an inherited value cannot be deleted. _ROCM_TAG_MEMO_DIR was not in it, and the trap does rm -rf on it, so an exit before the mktemp -d ran would remove whatever path the caller had exported. Both memo variables are reset there now. _infer_linux_amd_gfx_arch hands an explicit UNSLOTH_ROCM_GFX_ARCH back verbatim, and people copy that out of HIP, which reports gcnArchName: gfx1201:sramecc+:xnack-. The index case table has no arm for the suffix, so the override reroute fell through to CPU while get_torch_index_url, which strips it, had already told the user per-arch wheels were coming. The reroute normalises through the same helper now, so the two agree and a suffixed override reaches gfx120X-all. Mutation-tested both. Dropping the reset fails two assertions; dropping the normalisation fails one shell assertion and the end-to-end reroute case, which needed the harness taught to set the override at all -- the gate's first disjunct is the only way in on a host whose probe reads fine, so every override case there was previously testing nothing. tests/sh 42/42, 58/58, 64/64. tests/studio/install 2572 passed, 108 skipped; the same 5 failures in test_install_manifest.py and test_managed_node_runtime.py reproduce with this branch stashed.
|
Codex Review: Didn't find any major issues. Swish! 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 reroute this PR adds for issue unslothai#8731 is top-level code in install.sh. get_torch_index_url runs inside a command substitution, so it cannot assign TORCH_INDEX_URL; it returns */cpu and defers, and the block underneath is what actually rewrites the index. test_rocm_no_version_arch_route.sh sources functions with sed -n '/^name()/,/^}/p', so it never runs that block. Its reroute assertions are greps against install.sh source text, and the executable half only ever reaches get_torch_index_url, which correctly still answers */cpu. The result is a suite that cannot fail. Deleting the fix entirely, with sed -i 's/_amd_no_rocm_version_reroute=true/_amd_no_rocm_version_reroute=false/' install.sh still leaves it at 42 passed, 0 failed. Nothing in it showed that a Fedora host ends up at a different index. Add tests/sh/test_rocm_no_version_arch_route_e2e.sh, which splices the top-level block out by stable text markers and runs it against a faked host, so every assertion is the final TORCH_INDEX_URL an installer would use. The splice runs past the reroute to the close of the whole index-decision region: the Strix gfx115x reroute and the gfx906 pin can still rewrite the index, so stopping earlier would assert a value the installer does not end up with. Pinned behaviour: Fedora gfx1201, no readable version -> repo.amd.com/rocm/whl/gfx120X-all/ and UNSLOTH_ROCM_GFX_ARCH=gfx1201 handed to setup.sh gfx1100, no readable version -> gfx110X-all/ gfx906, no readable version -> whl/cpu (no per-arch index exists) gfx1201 on a readable ROCm 5.7 -> whl/cpu (a deliberate fallback) gfx1201 beside gfx1036 -> whl/cpu (agents want different wheels) gfx1200 beside gfx1201 -> gfx120X-all/, no card named NVIDIA host, stale ROCm packages -> whl/cu128 GPU-less host, stale ROCm packages -> whl/cpu the reported host on aarch64 -> whl/cpu (ROCm wheels are x86_64-only) Every absolute host path the spliced code probes is redirected into a fake tree, because a CI runner with a real NVIDIA driver would otherwise send every AMD scenario down the CUDA path and the suite would pass while measuring nothing. A broken redirect looks exactly like a working one from the outside, so both controls are asserted: the real driver must be hidden, and a faked driver tree must still be seen. The same pair is asserted for the AMD probe. A splice that silently loses a function answers cpu for every row, so each function the decision needs is checked for at column 0 first, and the block splice must reach its end marker. The last two cases re-run the decision under /bin/sh: install.sh is POSIX, CI runs these files with bash, and a bashism in the reroute would otherwise only surface on a Debian host. Both suites now fail when the reroute is disabled (17 -> 12 passed, 5 failed) and when _amd_agreed_index_family is forced to return 1. Section 8 of the original file keeps its wiring greps, with a comment saying plainly that a grep for the gate's variable names is a wiring check that survives a gate which is wired but always decides no, and pointing at the file that runs it.
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
Consolidating my earlier comments into one summary and deleting the rest. Validated on real AMD hardware (gfx1151 Strix Halo)NO_REGRESSION on the runner, plus a 20-scenario end-to-end harness that actually executes the top-level reroute. Final
Every deliberate CPU fallback is preserved and the three pre-existing reroute paths still fire identically. Byte-identical under Honest limit: the probes are stubbed on Correcting something I said earlierI claimed your test suite "does not cover the fix". That was too broad, and I want it on the record properly. Re-running both mutations:
So the suite is weak at exactly one thing, not uniformly weak. You did mutation-test, and the helper-level mutations are caught. What is invisible is deleting the fix itself, because the reroute is top-level code and the assertions covering it grep for the gate's own variable names. A grep is a wiring check: it survives a gate that is wired but always decides no.
One open item, which I do not think should blockThe new version sources ( The comment pass above is comment-only, verified by |
Checked against Fedora 43's own repodata (Everything/x86_64 filelists plus mdapi), not against the issue thread: - rocm-core IS a Fedora package (F43 6.4.4, F44 7.1.1, F45 7.2.2). Nothing except the `rocm` metapackage requires it, which is why a host running rocm-hip and rocm-runtime answered nothing. The multi-name query is right, the reason written next to it was not. - Fedora's hipconfig is /usr/bin/hipconfig, owned by hipcc, so it is ON PATH. The ROCM_PATH/bin lookup is for AMD's own installer layout, and citing Fedora for it points the next reader at the wrong host shape. - No Fedora package owns any path under /opt/rocm (zero matches across the whole F43 filelist), so Fedora reaches the SDK-hint branch, not the "/opt/rocm exists" one the comment was attached to. No behaviour change.
rocminfo names the agent once and each ISA once, and on gfx1201 under ROCm 7.x there are two ISAs, gfx1201 and gfx12-generic (ROCm/legacy-rocm-build#6110). That is three gfx-bearing Name lines for one card. Pin both halves of the answer: the duplicates still collapse to one device, and gfx12-generic does not widen the host into a two-arch one that the sole-arch check would reject, which would put a working 9070 XT back on cpu wheels.
_amd_gpu_radeon was matched on the whole index URL, and the AMD per-arch mirror is https://repo.amd.com/rocm/whl/gfx120X-all/, so the "rocm" in its BASE PATH set the flag on every host the new no-version reroute sends there. rocminfo calls consumer cards "Radeon", so a stock RX 9070 XT on Fedora, the host this PR exists to fix, then took the Radeon branch: the summary reported "wheels: repo.radeon.com (Radeon)" for wheels fetched from repo.amd.com, the Tauri marker recorded family "radeon", and get_radeon_wheel_url warned it could not read a full ROCm version to select wheels that do not need one. Match _torch_index_leaf instead, which is what the comment 70 lines above already says every index classifier here does, and for the same reason: a mirror whose base path happens to contain "rocm" must not relabel the leaf. Leaves rocm6.4 and rocm-rel-6.4 classified exactly as before and only stops gfx* leaves matching. The two older per-arch reroutes each clear the flag by hand right after setting their index; those lines are now redundant but left alone. Verified against the Strix reroute as a control: it already reported false, and still does.
HSA_OVERRIDE_GFX_VERSION=11.0.0 is the standard Strix Halo workaround, so ROCr reports gfx1100 on a physical gfx1151. The no-version reroute derives both the wheel family and the exported UNSLOTH_ROCM_GFX_ARCH from that probe, and the existing _hsa_spoofed_physical_gfx correction runs further down for the llama.cpp path only, which is too late. Such a host took gfx110X-all wheels and handed setup.sh a gfx1100 to build for. Rank the rpm components by version instead of by argument order. rocm-core, rocm-runtime and rocm-hip are all AMD packages from the same repo, so none outranks the others by provenance the way rocm-core outranks the distro's libhsa-runtime64-1. A partial upgrade leaving rocm-core 5.7 beside rocm-runtime 6.4 read as ROCm 5.7 and sent a supported runtime to CPU wheels. Both mutation-checked: reverting the first fails the two spoof assertions with gfx110X-all and gfx1100, reverting the second routes the split host to cpu.
_hsa_spoofed_physical_gfx returns nothing for two different reasons, and only one of them is "no spoof": it also declines whenever the KFD reports more than one GPU node, because HSA_OVERRIDE_GFX_VERSION can collapse several physical targets into one reported token. Reading that empty result as permission left a mixed gfx1151 plus gfx1201 host agreeing on gfx110X-all, wheels neither GPU can run. Count nodes rather than distinct arches, matching the helper's own rule. Clear a corroborated override once native wheels are chosen. The existing cleanup sits under case "$_torch_index_leaf" in rocm[0-9]*), which this reroute never matches because it produces a gfx* leaf, so the host installed native gfx1151 wheels while ROCr kept reporting gfx1100 and could not use them. Mutation-checked: removing the veto routes the mixed host to gfx110X-all and exports gfx1100; removing the cleanup leaves HSA_OVERRIDE_GFX_VERSION at 11.0.0.
|
Codex Review: Didn't find any major issues. Keep them coming! 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". |
|
Security review completed. No security issues were found in this pull request. Reviewed commit: Only the user who started this review can view the report in Codex. ℹ️ About Codex security reviews in GitHubThis is an experimental Codex feature. Security reviews are triggered when:
Once complete, Codex will leave suggestions, or a comment if no findings are found. |
# Conflicts: # install.sh # tests/sh/test_rocm_version_source_disagreement.sh
|
Codex Review: Didn't find any major issues. Swish! 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". |

Closes #8731.
Problem
_detect_rocm_version_tag()polls five sources and all five miss on the reported host. Checked against Fedora 43's own repodata rather than the issue thread: amd-smi printsROCm version: N/Abecause it dlopens the unversionedlibrocm-core.so, which onlyrocm-core-develships; no Fedora package owns any path under/opt/rocmat all, so.info/versioncannot be there; hipconfig is/usr/bin/hipconfigfromhipcc, which Bazzite does not install; dpkg is Debian-only; androcm-coredoes exist on Fedora, but nothing except therocmmetapackage requires it, so a host runningrocm-hip/rocm-runtimehas norocm-coreto answer.With no version, a working RX 9070 XT got CPU-only PyTorch and the reporter was told to run
sudo pacman -S rocm-hip-sdk, on an immutable Fedora image, for a package he already had.Readable arch plus unreadable version was the one combination nothing covered: the deferral in
get_torch_index_urlrequiredUNSLOTH_ROCM_GFX_ARCH, and the runtime-less reroute excluded any host whose probe returned a gfx.Fix
The version only chooses between the generic
rocmX.Yleaves._amd_arch_index_family_for_gfxalready mapsgfx1201togfx120X-allfrom the arch alone, and the arch was readable throughout.Route on the family, not one card. The deferral now fires for any probed arch that maps to a per-arch index, not just an overridden one. Every agent has to agree on that family first: rocminfo names each agent twice, so a single-GPU host reads
gfx1201\ngfx1201and is one device, while an APU beside a discrete card is two and must not route on whichever the kernel enumerated first.Keep the card separate from the family.
gfx1200besidegfx1201agree ongfx120X-alland are still two cards.setup.shtakesUNSLOTH_ROCM_GFX_ARCHover its own visibility-aware selection, so such a host gets the wheels, which are right for both, without an export naming one at random.Separate "no version readable" from "readable but unsupported". Only the second is a deliberate CPU fallback. A new
_amd_no_rocm_version_rerouteopens the reroute for the first and leaves the second excluded; it is computed behind the*/cpucheck so a healthy ROCm host does not pay a second_detect_rocm_version_tag.More version sources. rpm asked about
rocm-runtimeandrocm-hipalongsiderocm-core, in one query so a wedged rpm still costs one timeout rather than three: that is the Fedora fix. hipconfig fromROCM_PATH/binwhen it is off PATH covers AMD's own installer layout, not Fedora, whose hipconfig is already on PATH.One version probe per install.
get_torch_index_urlruns inside a command substitution, so the version it read cannot reach the reroute, which asked again. On a wedged rpm database that was_rocm_tag_from_rpm's 10s bound twice, on exactly the hosts this targets._detect_rocm_version_tagmemoises to a file inside anmktemp -d, not a$$-derived path in shared/tmp.Honest warnings. Stop claiming no ROCm install was found on a host with
/opt/rocm;_rocm_sdk_install_hintnames only a package manager the host has; and the reroute gets its own branch, since the existing text blames an unreadable arch and would send exactly the wrong user off repairing rocminfo.Do not brand the host a Radeon-repo install.
_amd_gpu_radeonmatched the whole index URL, and the AMD per-arch mirror ishttps://repo.amd.com/rocm/whl/gfx120X-all/, so therocmin its base path set the flag on every host this reroute sends there. rocminfo calls consumer cards "Radeon", so a stock RX 9070 XT on Fedora, the host this PR exists to fix, then reportedwheels: repo.radeon.com (Radeon)for wheels fetched from repo.amd.com and warned it could not read a full ROCm version to select wheels that do not need one. Now matched on_torch_index_leaf, which is what every other index classifier here already does. The two older per-arch reroutes each cleared the flag by hand; matching the leaf is what stops the next one having to.Known gap, not fixed here
studio/install_python_stack.py::_detect_rocm_versionandstudio/install_llama_prebuilt.py::_detect_host_rocm_versioncarry comments claiming they matchinstall.sh. They do not, and this PR widens the gap by two cases: neither has the multi-name rpm query nor the off-PATH hipconfig lookup. That matters because Studio users reachinstall_python_stack.pythroughsetup.shand never runinstall.sh, so a Fedora host withrocm-hipinstalled still resolves differently there.Left for a follow-up rather than fixed here, on purpose: those two files already diverge from
install.shin four larger, older ways (first-answer-wins instead of highest-wins, and no${Status}filter on the dpkg probe, so a package removed withapt removestill reports its version). Fixing two of six leaves the parity comment just as false, and both files are also touched by #8886, which already conflicts with this PR.Scope
Broader than the reported host by design: any arch with a dedicated
repo.amd.comindex (gfx110X, gfx103X, gfx115X, gfx120X, gfx90a, gfx908) now routes on a readable arch with no readable version, where before it took CPU. An arch with no per-arch index (gfx906) still needs a version and still falls back with the warning.Tests
New
tests/sh/test_rocm_no_version_arch_route.sh, 42 assertions across three halves.Routing: mapped arch defers to the reroute, unsupported version stays a CPU fallback, supported version still picks its leaf, unmapped arch still needs a version, both new version sources resolve, warnings stop misdescribing the host.
Which GPU: duplicate agents are one device and name it, two cards in one family agree on the family and name neither, an APU beside a discrete card agrees on nothing, an unmappable agent rejects the whole host, and a same-family pair still routes while exporting no arch.
The memo: two calls report the same tag and probe once, and an unset memo path caches nothing.
Mutation-tested. Restoring the
UNSLOTH_ROCM_GFX_ARCHrequirement reproduces the original bug on the reported host. Reducing the agent check to first-agent-wins reproduces the APU-takes-the-discrete-card's-wheels case and fails five assertions.A second suite,
tests/sh/test_rocm_no_version_arch_route_e2e.sh, executes the reroute rather than grepping for it. The reroute is top-level code, so assertions that reach onlyget_torch_index_urlcannot see it: the suite above passes unchanged when_amd_no_rocm_version_rerouteis forced false, because its reroute assertions grep the gate's own variable names, and a grep survives a gate that is wired but always decides no. The e2e suite splices the block out by stable markers, redirects the host paths and asserts the resultingTORCH_INDEX_URL. 21 assertions; 5 of them fail with the fix removed, and it is the only detector of the core decision anywhere in the test tree. Four are controls on the redirects themselves, since a host with a real NVIDIA GPU sends every AMD scenario down the CUDA path and a broken redirect is indistinguishable from a working one.Existing suites had assertions encoding the old behaviour and were updated in place, keeping their intent:
test_rocm_version_source_disagreement.shcases 9/10, andtest_no_version_cpu_warning_respects_gfx_override, which gains a gfx906 case so the CPU-warning path stays covered. Four harnesses slice functions out ofinstall.shby name and needed the new helpers added; those splices are onearch_fnsblob per harness now, so the next helper is a single edit rather than four.tests/sh: 42/42 and 17/17 new, 58/58 and 64/64 existing. Verified on a real gfx1151 (Strix Halo) runner and identical underdashandbash.Hardware and OS coverage
No hosted CI runner has an AMD GPU, so a green check does not exercise this change on real
silicon. This table is the actual test report.
Where it ran
/dev/kfdtests/sh37/37, 58/58, 64/64;tests/studio/install2572 passed / 108 skipped; both mutationsRun under WSL deliberately: a Windows run silently skips the ~40 tests that need a POSIX
sh, and one of them was the only thing catching a real regression in an earlier push.Not covered
rocm-runtimeandrocm-hipqueries are exercised as shell, never against a real rpm databaseamd_cirunner is a gfx1151 APU, which cannot speak for wheel routing on a discrete cardinstall.shpath. Same arch, wrong OS, so it proves nothing heresetup.shpicking correctly afterwards has never been watched happenBottom line. The routing logic is covered thoroughly and mutation-tested, so the decision this
makes is right by construction. Two things are untested: the probing underneath it on a real rpm
host, which is where the original bug lived, and any host with two AMD GPUs in it, which is what
the agreement check was added for.
Interaction with #8412
The two touch the same regions, but #8412's hunks sit adjacent rather than on these lines: its gfx1033 gate is before version detection, and its reroute change is inside the
*/cpubody while this changes the gate condition. Whichever lands second needs a small manual merge, not a rewrite.Worth flagging: #8412 does not fix #8731, as suggested in that thread. Its reroute hunk is inside a gate that never opens for this host.
Real gfx1151 hardware, executing the reroute
An earlier gfx1151 run could only show the absence of collateral damage, because it sourced individual functions and the reroute is top-level code. This one splices the top-level block and runs it, base vs head vs merge, under both dash and bash:
real_host(this runner's own unstubbed gfx1151 ROCm stack)amd/gfx1151/amd/gfx1151/fedora_no_version_gfx1201(issue 8731)pt/cpuamd/gfx120X-all/gfx1201strix_gfx1151_alonept/cpuamd/gfx1151/gfx1151strix_beside_discrete_gfx1201pt/cpupt/cpugfx906_no_versionpt/cpupt/cpufedora_no_version_aarch64pt/cpupt/cpufedora_no_version_on_darwinpt/cpupt/cpunvidia_with_stale_rocmpt/cu128pt/cu128cpu_only_with_stale_rocmpt/cpupt/cpuVerdict CONFIRMED: the defect reproduces at the base and is absent at the head.
real_hostis the control saying a healthy host did not move. Every other row stubs rocminfo, amd-smi, hipconfig, rpm, dpkg-query, lspci and uname on a hermetic PATH and redirects/opt/rocm,/dev/kfd,/sys/class/kfd,/sys/bus/pci/devicesand/proc/driver/nvidia, so they exercise the routing decision rather than real packaging. The splice was gated first: every required function present, the block ending on its end marker, and theget_torch_index_urlcall still in place, in all three states.Merge order