Repository navigation
Studio diffusion: use an installed HIP SDK for the Windows ROCm sd.cpp build when its bin dir is not on PATH - #15853
Merged
Conversation
…p build when its bin dir is not on PATH
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. |
Member
Author
|
Reached Codex review convergence at oobabooga#428. |
[skip ci]
This was referenced Oct 29, 2026
This was referenced Oct 29, 2026
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.
Reported on Reddit: Anyone manage to get MOSS Image to load?. After #15371 moved Windows AMD hosts without the HIP runtime to Vulkan, the reporter asked what to install to use the HIP build instead.
Problem
On Windows AMD, image generation uses the Vulkan stable-diffusion.cpp build unless
hipblas.dllis found onPATH. The upstreamwin-rocmbundle ships its ownamdhip64_7.dllbut importshipblas.dll, which only the AMD HIP SDK provides. The SDK installer never puts that DLL's folder onPATH: HIP SDK 7.2.3'sROCm_SDK_Core.msisets onlyHIP_PATHandHIP_PATH_72, and AMD's install guide tells users to add thebinfolder toPATHthemselves.As a result, a user who installs the HIP SDK, as the existing log line suggests, still gets Vulkan. Detection (
windows_hip_runtime_missing_dlls()), the installer's start probe (_probe_env()) and every sd-cli/sd-server launch (runtime_env()) look only atPATH.Fix
windows_hip_sdk_bin_dirs()ininstall_sd_cpp_prebuilt.py. It returns the HIP SDKbinfolders fromHIP_PATH, thenROCM_PATH, thenC:\Program Files\AMD\ROCm\<ver>(newest first). It keeps only 7.x folders, meaninghipblas.dllsits next toamdhip64_7.dll.PATH. For a ROCm bundle,_probe_env()andruntime_env()append them after the caller'sPATH.HIP_PATHlookup, and link AMD's download page.Behavior boundaries
PATHkeeps priority.hipblas.dllbindsamdhip64_6.dll, not the bundle's HIP 7 runtime.DELETE /api/settings/diffusion-accelerator-fallback. This is main's existing policy, the same as on Linux ROCm hosts.Verification
test_sd_cpp_install_verify.py. Six of them fail on main, includingpreferred_accelerator("rocm")returning"vulkan"when the SDK is found only throughHIP_PATH.Live A/B on Windows 11 with a Radeon 8060S (gfx1151):
HIP_PATHwas set the way the MSI sets it.PATHwas left unchanged.preferred_accelerator("rocm")andensure_sd_cpp_binary(), then generated an SD-Turbo image throughruntime_env().UNSLOTH_SD_CPP_WINDOWS_ROCM=10xC0000135, fell back to win-vulkan, ROCm recorded as failedbinadded toPATHby handWith this PR the result matches the manual
PATHedit on main, down to an identical output image.