Skip to content

Prepare Windows HIP/ROCm builds for distribution releases - #153

Merged
0xShug0 merged 4 commits into
0xShug0:mainfrom
IIIIIllllIIIIIlllll:hip-windows-distribution
Jul 30, 2026
Merged

Prepare Windows HIP/ROCm builds for distribution releases#153
0xShug0 merged 4 commits into
0xShug0:mainfrom
IIIIIllllIIIIIlllll:hip-windows-distribution

Conversation

@IIIIIllllIIIIIlllll

@IIIIIllllIIIIIlllll IIIIIllllIIIIIlllll commented Jul 29, 2026

Copy link
Copy Markdown
Contributor

Hello! It's time to prepare prebuilt packages for the ROCm builds — everything new in this PR is listed below. One thing I'd like to confirm: do you have plans to publish ROCm release packages? Thanks!

Groundwork for prebuilt Windows HIP/ROCm packages
Goal: ship Windows prebuilt packages that run on AMD GPUs without a ROCm SDK installation on end-user machines. Both release tracks were verified locally with side-by-side builds.

Changes

scripts/build_windows_hip.ps1 — distribution-ready options: -NoNativeCpu (don't bake build-machine ISA into CPU kernels), -DeploymentBuild (embed model_specs/), -BuildDir (side-by-side ROCm version builds); fix -GpuTargets being silently ignored on re-configure (stale GPU_BUILD_TARGETS cache); -DGGML_OPENMP=OFF to prevent an accidental libomp140.x86_64.dll dependency.

external/sentencepiece — fix -fPIC breaking Windows HIP builds (ROCm clang rejects it for x86_64-pc-windows-msvc).

docs/build/windows-hip-distribution.md — packaging guide: dual tracks (ROCm 6.4 = 8 arches incl. gfx1102; ROCm 7.1 = 7 arches), DLL + kernel library checklists (incl. hipblaslt/library, fatal to omit), bundled HIP runtime rationale (Adrenalin 26.5.1 dropped the ROCm 6 runtime), measured sizes, filtering scripts.

Verification
ROCm 6.4: 8 arches × 145 .cu; dumpbin clean (amdhip64_6 + hipblas + hipblaslt + CRT only); TTS inference confirmed on gfx1103 (780M).
ROCm 7.1: 7 arches, same checks passed; new DLL naming confirmed (amdhip64_7, libhipblas, libhipblaslt).

- Add -NoNativeCpu: keep ggml CPU kernels off the build machine's native
  ISA. A distribution binary built with the default (native) can crash
  with 'illegal instruction' on older CPUs.
- Add -DeploymentBuild: forward AUDIOCPP_DEPLOYMENT_BUILD so model_specs
  are compiled into the binary for self-contained packages.
- Add -BuildDir: allow side-by-side build trees (e.g. ROCm 6.4 and 7.1).
- Clear stale GPU_BUILD_TARGETS/AMDGPU_TARGETS cache entries (-U):
  hip-config-amd.cmake caches GPU_BUILD_TARGETS, so a previous
  configure's arch list silently overrode a new -GpuTargets value.
- Force -DGGML_OPENMP=OFF: ggml probes for OpenMP on its own and, in a
  vcvars environment, finds LLVM libomp, adding a libomp140.x86_64.dll
  runtime dependency to otherwise-clean HIP binaries.
ROCm clang (GNU driver) targets x86_64-pc-windows-msvc and rejects
-fPIC ('unsupported option'), which breaks every Windows HIP build at
the sentencepiece protobuf-lite sources. PIC is meaningless on Windows,
so skip the flag on WIN32.
Documents how to build and package Windows HIP binaries that run on end
user machines without a ROCm SDK installation:

- Dual release tracks: ROCm 6.4 (8 arches incl. gfx1102) and ROCm 7.1
  (7 arches; 7.1 hipBLASLt ships no gfx1102 kernels).
- Runtime DLL bundling, including the hipblaslt kernel library (fatal
  to omit: it is the default GEMM path and the only one covering
  gfx1103) and the bundled HIP runtime (Adrenalin 26.5.1+ drivers no
  longer ship the ROCm 6 runtime, so relying on the driver is not
  viable for either track).
- Kernel library filtering per architecture with measured sizes.
- Build environment requirements: MSVC 14.44 toolset (14.51 breaks
  ROCm clang), -NoNativeCpu, GGML_OPENMP off, dumpbin dependency
  verification checklist.

Also documents the -NoNativeCpu option in HIP.md. Both tracks were
verified locally with side-by-side builds.
@0xShug0

0xShug0 commented Jul 29, 2026

Copy link
Copy Markdown
Owner

@IIIIIllllIIIIIlllll A big yes to ROCm prebuilts! Would you be willing to set up a repo and publish the ROCm prebuilts there? Since I don't have a ROCm machine, I can't validate the correctness of the prebuilts myself. I can direct users to your repo for the downloads.

@IIIIIllllIIIIIlllll

Copy link
Copy Markdown
Contributor Author

@IIIIIllllIIIIIlllll A big yes to ROCm prebuilts! Would you be willing to set up a repo and publish the ROCm prebuilts there? Since I don't have a ROCm machine, I can't validate the correctness of the prebuilts myself. I can direct users to your repo for the downloads.

No problem

@0xShug0
0xShug0 merged commit c04c3a5 into 0xShug0:main Jul 30, 2026
4 checks passed
@0xShug0

0xShug0 commented Jul 30, 2026

Copy link
Copy Markdown
Owner

@IIIIIllllIIIIIlllll Merged and thank you!

@IIIIIllllIIIIIlllll

IIIIIllllIIIIIlllll commented Jul 30, 2026

Copy link
Copy Markdown
Contributor Author

@0xShug0
I've just published the first HIP/ROCm prebuilt release (v0.2.0-hip) from my fork — two packages: ROCm 6.4 and ROCm 7.1.

Since we'll be maintaining releases on both sides, I'd like to keep things aligned:

Versioning — should the HIP packages follow your release tags/versioning scheme, or is an independent suffix like -hip fine with you?
Release notes — anything specific you'd like me to include or avoid mentioning (e.g. references to upstream)?
README — would you accept a PR that adds a link to the HIP/ROCm prebuilt packages in the README's download section? Happy to word it as "community-maintained" to set expectations.

Thanks!

Releases: https://github.com/IIIIIllllIIIIIlllll/audio.cpp/releases

@0xShug0

0xShug0 commented Jul 30, 2026

Copy link
Copy Markdown
Owner

@IIIIIllllIIIIIlllll For versioning, please align it with the audio.cpp Windows release so the versions are easy to match. I'll create a tag for each release, and you can pin your release to that tag in the release notes. There are no other requirements for the wording in the release notes :)

README: Feel free to submit a PR. Mentioning "community-maintained" as the WebUI would be great.

mpulukkinen pushed a commit to mpulukkinen/audio.cpp that referenced this pull request Aug 2, 2026
* Harden Windows HIP build script for distribution builds

- Add -NoNativeCpu: keep ggml CPU kernels off the build machine's native
  ISA. A distribution binary built with the default (native) can crash
  with 'illegal instruction' on older CPUs.
- Add -DeploymentBuild: forward AUDIOCPP_DEPLOYMENT_BUILD so model_specs
  are compiled into the binary for self-contained packages.
- Add -BuildDir: allow side-by-side build trees (e.g. ROCm 6.4 and 7.1).
- Clear stale GPU_BUILD_TARGETS/AMDGPU_TARGETS cache entries (-U):
  hip-config-amd.cmake caches GPU_BUILD_TARGETS, so a previous
  configure's arch list silently overrode a new -GpuTargets value.
- Force -DGGML_OPENMP=OFF: ggml probes for OpenMP on its own and, in a
  vcvars environment, finds LLVM libomp, adding a libomp140.x86_64.dll
  runtime dependency to otherwise-clean HIP binaries.

* Fix sentencepiece -fPIC build failure with Windows clang

ROCm clang (GNU driver) targets x86_64-pc-windows-msvc and rejects
-fPIC ('unsupported option'), which breaks every Windows HIP build at
the sentencepiece protobuf-lite sources. PIC is meaningless on Windows,
so skip the flag on WIN32.

* Add Windows HIP/ROCm distribution guide

Documents how to build and package Windows HIP binaries that run on end
user machines without a ROCm SDK installation:

- Dual release tracks: ROCm 6.4 (8 arches incl. gfx1102) and ROCm 7.1
  (7 arches; 7.1 hipBLASLt ships no gfx1102 kernels).
- Runtime DLL bundling, including the hipblaslt kernel library (fatal
  to omit: it is the default GEMM path and the only one covering
  gfx1103) and the bundled HIP runtime (Adrenalin 26.5.1+ drivers no
  longer ship the ROCm 6 runtime, so relying on the driver is not
  viable for either track).
- Kernel library filtering per architecture with measured sizes.
- Build environment requirements: MSVC 14.44 toolset (14.51 breaks
  ROCm clang), -NoNativeCpu, GGML_OPENMP off, dumpbin dependency
  verification checklist.

Also documents the -NoNativeCpu option in HIP.md. Both tracks were
verified locally with side-by-side builds.

* Polish sentencepiece Windows HIP CMake hunk

---------

Co-authored-by: 0xShug0 <231717474+0xShug0@users.noreply.github.com>
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.

2 participants