Skip to content

[ROCM-24669] pkg: drop hsa-rocr dep, warn at install time instead#300

Merged
thananon merged 1 commit into
developfrom
pkg/drop-hsa-rocr-dep
May 15, 2026
Merged

[ROCM-24669] pkg: drop hsa-rocr dep, warn at install time instead#300
thananon merged 1 commit into
developfrom
pkg/drop-hsa-rocr-dep

Conversation

@thananon
Copy link
Copy Markdown
Contributor

@thananon thananon commented May 14, 2026

Fixes ROCM-24669 — amdrocm7-transferbench DEB/RPM declares a hard dependency on hsa-rocr, which ROCm 7.13 no longer ships. Install fails on TheRock 7.13 with Package hsa-rocr is not configured yet.

Summary

  • Drop the hard hsa-rocr dep from CPACK_DEBIAN_PACKAGE_DEPENDS, CPACK_RPM_PACKAGE_REQUIRES, and the legacy rocm_package_add_dependencies call. The dep was wrong for the relocatable artifact in general — it ships against the TheRock SDK and is meant to install on systems where ROCm came from a tarball and is not tracked by apt/dpkg at all.
  • Add packaging/postinst-check-hsa.sh and wire it as both the DEB postinst (via CPACK_DEBIAN_PACKAGE_CONTROL_EXTRA) and the RPM %post (via CPACK_RPM_POST_INSTALL_SCRIPT_FILE). It probes ldconfig and the standard /opt/rocm{,-*,/extras-*,/core-*}/lib prefixes for libhsa-runtime64.so.1 and prints a stderr warning when none have it. Always exits 0 — install never fails on its account; the warning surfaces a missing runtime at install time instead of as a confusing dynamic-linker error on first invocation.
  • numactl / libnuma1 stay in the dep list since those are real OS packages that exist independent of any ROCm install.

Behavior matrix

Scenario Before After
TheRock tarball under /opt/rocm/* install fails (hsa-rocr not in dpkg) install succeeds, no warning
System apt ROCm with hsa-rocr installed install succeeds install succeeds, no warning
Bare system, no ROCm anywhere install fails install succeeds with WARNING block to stderr; runtime linker error on first run if user never installs ROCm

Test plan

  • CI relocatable build passes on Ubuntu 22.04 (DEB) and manylinux_2_28 (RPM).
  • Inspect the produced DEB: dpkg-deb -I amdrocm7-transferbench_*.deb shows Depends: numactl, libnuma1 (no hsa-rocr) and lists a postinst in the control archive.
  • Inspect the produced RPM: rpm -qp --requires amdrocm7-transferbench-*.rpm shows only numactl (no hsa-rocr); rpm -qp --scripts shows the %post body.
  • Install the DEB on the original ROCm 7.13 / TheRock repro box from the ticket and confirm dpkg -i configures cleanly and TransferBench launches.
  • Install the DEB on a bare Ubuntu container with no ROCm and confirm the install succeeds with the warning visible on stderr.

The relocatable DEB/RPM hard-depended on hsa-rocr, but ROCm 7.13 no
longer ships a package by that name -- install fails on TheRock 7.13
with "amdrocm7-transferbench depends on hsa-rocr; however: Package
hsa-rocr is not configured yet" (ROCM-24669).

The dep also never made sense for the relocatable artifact: it is
built from the TheRock SDK and meant to install on systems where ROCm
came from a tarball and is not tracked by apt/dpkg at all. Any apt
dep on a ROCm component breaks that audience.

Drop hsa-rocr from CPACK_DEBIAN_PACKAGE_DEPENDS,
CPACK_RPM_PACKAGE_REQUIRES, and the legacy
rocm_package_add_dependencies call. Wire a shared scriptlet
(packaging/postinst-check-hsa.sh) as the DEB postinst and the RPM
%post that probes ldconfig + the standard /opt/rocm{,-*,/extras-*,
/core-*}/lib prefixes for libhsa-runtime64.so.1 and prints a stderr
warning when none of them have it. Always exits 0 so install never
fails on its account -- the warning surfaces the missing runtime at
install time instead of as a dynamic-linker error on first run.

numactl / libnuma1 stay in the dep list since those are real OS
packages that exist independent of any ROCm install.
@thananon thananon requested a review from a team as a code owner May 14, 2026 21:39
@thananon thananon changed the title pkg: drop hsa-rocr dep, warn at install time instead [ROCM-24669] pkg: drop hsa-rocr dep, warn at install time instead May 14, 2026
@thananon thananon merged commit a4cd6e5 into develop May 15, 2026
10 checks passed
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.

3 participants