From fe4847a847a4bf8478f7adf0bf343eb22f0dd10b Mon Sep 17 00:00:00 2001 From: Paul Date: Thu, 4 Jun 2026 12:34:36 -0700 Subject: [PATCH 1/3] set dependency range for ROCm components RVS is expected to work with any version of ROCm that has same major number version.Hence setting the version depenency to the range of versions. --- CMakeLists.txt | 51 +++++++++++++++++++++++++++++++++++++------------- 1 file changed, 38 insertions(+), 13 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index b838e070..99fa2bb2 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -319,15 +319,33 @@ message(STATUS "RVS_VERSION (rvs -v / CPack, not get_version input): ${RVS_VERSI set(CPACK_PACKAGE_VENDOR "Advanced Micro Devices Inc.") set(CPACK_PACKAGE_CONTACT "${PKG_MAINTAINER_NM} <${PKG_MAINTAINER_EMAIL}>") -# Package dependencies: support both legacy (ROCm <=6.x) and new amdrocm-* naming (TheRock/ROCm 8.x per RFC0009) -# DEB uses "old | new" OR syntax, RPM uses "(old or new)" boolean dependency syntax -# rocm-llvm: ROCm LLVM (includes libomp used by HIP/RVS); pull OpenMP runtime from the ROCm stack, not host libgomp. -set(ROCM_DEB_DEPS "hip-runtime-amd | amdrocm-runtimes, comgr | amdrocm-runtimes, hsa-rocr | amdrocm-runtimes, rocblas | amdrocm-blas, amd-smi-lib | amdrocm-amdsmi, hiprand | amdrocm-rand, hipblaslt | amdrocm-blas, rocm-llvm | amdrocm-llvm") -set(ROCM_RPM_DEPS "(hip-runtime-amd or amdrocm-runtimes), (comgr or amdrocm-runtimes), (hsa-rocr or amdrocm-runtimes), (rocblas or amdrocm-blas), (amd-smi-lib or amdrocm-amdsmi), (hiprand or amdrocm-rand), (hipblaslt or amdrocm-blas), (rocm-llvm or amdrocm-llvm)") +# Package dependencies: TheRock / ROCm SDK (amdrocm-*). Stack range [min, major(min)+1.0) on each component. +# amdrocm-llvm: ROCm LLVM (includes libomp used by HIP/RVS); pull OpenMP runtime from the ROCm stack, not host libgomp. +set(RVS_ROCM_VERSION_MIN "7.14" CACHE STRING "Minimum ROCm stack version in package Depends (inclusive)") +string(REGEX MATCH "^([0-9]+)" _rvs_rocm_min_major "${RVS_ROCM_VERSION_MIN}") +math(EXPR _rvs_rocm_max_major "${_rvs_rocm_min_major} + 1") +set(RVS_ROCM_VERSION_MAX "${_rvs_rocm_max_major}.0") +set(_rvs_amdrocm_pkgs amdrocm-runtimes amdrocm-blas amdrocm-amdsmi amdrocm-rand amdrocm-llvm) +set(_rvs_deb_dep_parts "") +set(_rvs_rpm_dep_parts "") +foreach(_rvs_pkg IN LISTS _rvs_amdrocm_pkgs) + list(APPEND _rvs_deb_dep_parts + "${_rvs_pkg} (>= ${RVS_ROCM_VERSION_MIN})" + "${_rvs_pkg} (<< ${RVS_ROCM_VERSION_MAX})") + list(APPEND _rvs_rpm_dep_parts + "${_rvs_pkg} >= ${RVS_ROCM_VERSION_MIN}" + "${_rvs_pkg} < ${RVS_ROCM_VERSION_MAX}") +endforeach() if(FETCH_ROCMPATH_FROM_ROCMCORE) - set(ROCM_DEB_DEPS "${ROCM_DEB_DEPS}, ${ROCM_CORE} | amdrocm-base") - set(ROCM_RPM_DEPS "${ROCM_RPM_DEPS}, (${ROCM_CORE} or amdrocm-base)") + list(APPEND _rvs_deb_dep_parts + "amdrocm-base (>= ${RVS_ROCM_VERSION_MIN})" + "amdrocm-base (<< ${RVS_ROCM_VERSION_MAX})") + list(APPEND _rvs_rpm_dep_parts + "amdrocm-base >= ${RVS_ROCM_VERSION_MIN}" + "amdrocm-base < ${RVS_ROCM_VERSION_MAX}") endif() +string(JOIN ", " ROCM_DEB_DEPS ${_rvs_deb_dep_parts}) +string(JOIN ", " ROCM_RPM_DEPS ${_rvs_rpm_dep_parts}) set(CPACK_ARCHIVE_COMPONENT_INSTALL ON) set(CPACK_COMPONENTS_ALL applications rvsmodule) @@ -481,26 +499,33 @@ endif() # Package dependencies - yaml-cpp is conditionally required based on linking type +if(ROCM_DEB_DEPS) + set(_rvs_rocm_deb_prefix "${ROCM_DEB_DEPS}, ") + set(_rvs_rocm_rpm_prefix "${ROCM_RPM_DEPS}, ") +else() + set(_rvs_rocm_deb_prefix "") + set(_rvs_rocm_rpm_prefix "") +endif() if (YAML_CPP_STATIC_FOUND) # Static linking - no runtime yaml-cpp dependency needed if (${RVS_OS_TYPE} STREQUAL "ubuntu") - set(CPACK_DEBIAN_PACKAGE_DEPENDS "${ROCM_DEB_DEPS}, libpci3") + set(CPACK_DEBIAN_PACKAGE_DEPENDS "${_rvs_rocm_deb_prefix}libpci3") elseif (${RVS_OS_TYPE} STREQUAL "sles") - set(CPACK_RPM_PACKAGE_REQUIRES "${ROCM_RPM_DEPS}, libpci3") + set(CPACK_RPM_PACKAGE_REQUIRES "${_rvs_rocm_rpm_prefix}libpci3") else () # other supported rpm distros - RHEL, CentOS - set(CPACK_RPM_PACKAGE_REQUIRES "${ROCM_RPM_DEPS}, pciutils-libs") + set(CPACK_RPM_PACKAGE_REQUIRES "${_rvs_rocm_rpm_prefix}pciutils-libs") endif() message(STATUS "Package dependencies: yaml-cpp statically linked, no runtime dependency") else() # Dynamic linking - yaml-cpp runtime dependency required if (${RVS_OS_TYPE} STREQUAL "ubuntu") - set(CPACK_DEBIAN_PACKAGE_DEPENDS "${ROCM_DEB_DEPS}, libpci3, libyaml-cpp-dev") + set(CPACK_DEBIAN_PACKAGE_DEPENDS "${_rvs_rocm_deb_prefix}libpci3, libyaml-cpp-dev") elseif (${RVS_OS_TYPE} STREQUAL "sles") - set(CPACK_RPM_PACKAGE_REQUIRES "${ROCM_RPM_DEPS}, libpci3, libyaml-cpp0_6") + set(CPACK_RPM_PACKAGE_REQUIRES "${_rvs_rocm_rpm_prefix}libpci3, libyaml-cpp0_6") else () # other supported rpm distros - RHEL, CentOS - set(CPACK_RPM_PACKAGE_REQUIRES "${ROCM_RPM_DEPS}, pciutils-libs, yaml-cpp") + set(CPACK_RPM_PACKAGE_REQUIRES "${_rvs_rocm_rpm_prefix}pciutils-libs, yaml-cpp") endif() message(STATUS "Package dependencies: yaml-cpp dynamically linked, runtime dependency included") endif() From 8f2de33dd112136eb2e1447d51f55ffe272e27ac Mon Sep 17 00:00:00 2001 From: Paul Date: Fri, 5 Jun 2026 15:52:03 -0700 Subject: [PATCH 2/3] update depenency to min version of ROCm Setting version upper bound will restrict upgrade of ROCm stack if RVS build for ROCm 7 series is already installed on the system. With ROCm upgraded to higher major version assuming all libraries that RVS depend on remain same major version RVS should continue to work. If major version of any of the dependency change rvs will fail at the dependency load time. --- .github/workflows/README_BUILD_PACKAGES.md | 9 +++++++++ CMakeLists.txt | 21 +++++---------------- 2 files changed, 14 insertions(+), 16 deletions(-) diff --git a/.github/workflows/README_BUILD_PACKAGES.md b/.github/workflows/README_BUILD_PACKAGES.md index e95b4ee4..66daf2e9 100644 --- a/.github/workflows/README_BUILD_PACKAGES.md +++ b/.github/workflows/README_BUILD_PACKAGES.md @@ -364,6 +364,15 @@ If no matching `v` tag is found, the patch defaults to `0` from `project(VERSION ## Installing Generated Packages +### ROCm SDK package dependencies (DEB/RPM) + +`amdrocm-rvs` packages declare **minimum-only** dependencies on the TheRock / ROCm SDK (`amdrocm-*` packages, per RFC0009): + +- **Always required** (each with `>= 7.14`): `amdrocm-runtimes`, `amdrocm-blas`, `amdrocm-amdsmi`, `amdrocm-rand`, `amdrocm-llvm` (ROCm LLVM / `libomp` for HIP/RVS — not host `libgomp`). +- **`amdrocm-base (>= 7.14)`** is included when the package is built with `FETCH_ROCMPATH_FROM_ROCMCORE=ON` (default in CI and `build_packages_local.sh`). + +There is **no upper bound** on these dependencies so `apt`/`dnf` can upgrade the system ROCm stack to **8.0+** without being forced to remove an installed `amdrocm7-rvs` package. **`amdrocm7-rvs` is built and tested against ROCm 7.x** (layout from 7.14); after a major stack upgrade, 7.x RVS may not run correctly until you install **`amdrocm8-rvs`** (when available). **`rpm --nodeps`** and **TGZ** installs do not enforce these metadata fields. + ### Ubuntu/Debian (DEB) ```bash diff --git a/CMakeLists.txt b/CMakeLists.txt index 99fa2bb2..4e196d5f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -319,30 +319,19 @@ message(STATUS "RVS_VERSION (rvs -v / CPack, not get_version input): ${RVS_VERSI set(CPACK_PACKAGE_VENDOR "Advanced Micro Devices Inc.") set(CPACK_PACKAGE_CONTACT "${PKG_MAINTAINER_NM} <${PKG_MAINTAINER_EMAIL}>") -# Package dependencies: TheRock / ROCm SDK (amdrocm-*). Stack range [min, major(min)+1.0) on each component. +# Package dependencies: TheRock / ROCm SDK (amdrocm-*). Minimum stack version on each component (no upper bound). # amdrocm-llvm: ROCm LLVM (includes libomp used by HIP/RVS); pull OpenMP runtime from the ROCm stack, not host libgomp. set(RVS_ROCM_VERSION_MIN "7.14" CACHE STRING "Minimum ROCm stack version in package Depends (inclusive)") -string(REGEX MATCH "^([0-9]+)" _rvs_rocm_min_major "${RVS_ROCM_VERSION_MIN}") -math(EXPR _rvs_rocm_max_major "${_rvs_rocm_min_major} + 1") -set(RVS_ROCM_VERSION_MAX "${_rvs_rocm_max_major}.0") set(_rvs_amdrocm_pkgs amdrocm-runtimes amdrocm-blas amdrocm-amdsmi amdrocm-rand amdrocm-llvm) set(_rvs_deb_dep_parts "") set(_rvs_rpm_dep_parts "") foreach(_rvs_pkg IN LISTS _rvs_amdrocm_pkgs) - list(APPEND _rvs_deb_dep_parts - "${_rvs_pkg} (>= ${RVS_ROCM_VERSION_MIN})" - "${_rvs_pkg} (<< ${RVS_ROCM_VERSION_MAX})") - list(APPEND _rvs_rpm_dep_parts - "${_rvs_pkg} >= ${RVS_ROCM_VERSION_MIN}" - "${_rvs_pkg} < ${RVS_ROCM_VERSION_MAX}") + list(APPEND _rvs_deb_dep_parts "${_rvs_pkg} (>= ${RVS_ROCM_VERSION_MIN})") + list(APPEND _rvs_rpm_dep_parts "${_rvs_pkg} >= ${RVS_ROCM_VERSION_MIN}") endforeach() if(FETCH_ROCMPATH_FROM_ROCMCORE) - list(APPEND _rvs_deb_dep_parts - "amdrocm-base (>= ${RVS_ROCM_VERSION_MIN})" - "amdrocm-base (<< ${RVS_ROCM_VERSION_MAX})") - list(APPEND _rvs_rpm_dep_parts - "amdrocm-base >= ${RVS_ROCM_VERSION_MIN}" - "amdrocm-base < ${RVS_ROCM_VERSION_MAX}") + list(APPEND _rvs_deb_dep_parts "amdrocm-base (>= ${RVS_ROCM_VERSION_MIN})") + list(APPEND _rvs_rpm_dep_parts "amdrocm-base >= ${RVS_ROCM_VERSION_MIN}") endif() string(JOIN ", " ROCM_DEB_DEPS ${_rvs_deb_dep_parts}) string(JOIN ", " ROCM_RPM_DEPS ${_rvs_rpm_dep_parts}) From f6b64a8ae359b45b2bdd523f2cb8e03b671eb983 Mon Sep 17 00:00:00 2001 From: Paul Date: Mon, 15 Jun 2026 12:04:36 -0700 Subject: [PATCH 3/3] fix type on amdrocm-runtimes package name for ROCm runtime,comgr,hip is amdrocm-runtime. --- .github/workflows/README_BUILD_PACKAGES.md | 2 +- CMakeLists.txt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/README_BUILD_PACKAGES.md b/.github/workflows/README_BUILD_PACKAGES.md index 66daf2e9..cbc63d2b 100644 --- a/.github/workflows/README_BUILD_PACKAGES.md +++ b/.github/workflows/README_BUILD_PACKAGES.md @@ -368,7 +368,7 @@ If no matching `v` tag is found, the patch defaults to `0` from `project(VERSION `amdrocm-rvs` packages declare **minimum-only** dependencies on the TheRock / ROCm SDK (`amdrocm-*` packages, per RFC0009): -- **Always required** (each with `>= 7.14`): `amdrocm-runtimes`, `amdrocm-blas`, `amdrocm-amdsmi`, `amdrocm-rand`, `amdrocm-llvm` (ROCm LLVM / `libomp` for HIP/RVS — not host `libgomp`). +- **Always required** (each with `>= 7.14`): `amdrocm-runtime`, `amdrocm-blas`, `amdrocm-amdsmi`, `amdrocm-rand`, `amdrocm-llvm` (ROCm LLVM / `libomp` for HIP/RVS — not host `libgomp`). - **`amdrocm-base (>= 7.14)`** is included when the package is built with `FETCH_ROCMPATH_FROM_ROCMCORE=ON` (default in CI and `build_packages_local.sh`). There is **no upper bound** on these dependencies so `apt`/`dnf` can upgrade the system ROCm stack to **8.0+** without being forced to remove an installed `amdrocm7-rvs` package. **`amdrocm7-rvs` is built and tested against ROCm 7.x** (layout from 7.14); after a major stack upgrade, 7.x RVS may not run correctly until you install **`amdrocm8-rvs`** (when available). **`rpm --nodeps`** and **TGZ** installs do not enforce these metadata fields. diff --git a/CMakeLists.txt b/CMakeLists.txt index 4e196d5f..53add3e4 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -322,7 +322,7 @@ set(CPACK_PACKAGE_CONTACT "${PKG_MAINTAINER_NM} <${PKG_MAINTAINER_EMAIL}>") # Package dependencies: TheRock / ROCm SDK (amdrocm-*). Minimum stack version on each component (no upper bound). # amdrocm-llvm: ROCm LLVM (includes libomp used by HIP/RVS); pull OpenMP runtime from the ROCm stack, not host libgomp. set(RVS_ROCM_VERSION_MIN "7.14" CACHE STRING "Minimum ROCm stack version in package Depends (inclusive)") -set(_rvs_amdrocm_pkgs amdrocm-runtimes amdrocm-blas amdrocm-amdsmi amdrocm-rand amdrocm-llvm) +set(_rvs_amdrocm_pkgs amdrocm-runtime amdrocm-blas amdrocm-amdsmi amdrocm-rand amdrocm-llvm) set(_rvs_deb_dep_parts "") set(_rvs_rpm_dep_parts "") foreach(_rvs_pkg IN LISTS _rvs_amdrocm_pkgs)