diff --git a/.github/workflows/README_BUILD_PACKAGES.md b/.github/workflows/README_BUILD_PACKAGES.md index 8b90088b..2666e4a3 100644 --- a/.github/workflows/README_BUILD_PACKAGES.md +++ b/.github/workflows/README_BUILD_PACKAGES.md @@ -366,6 +366,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-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. + ### Ubuntu/Debian (DEB) ```bash diff --git a/CMakeLists.txt b/CMakeLists.txt index 37572b72..afe046ae 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -319,15 +319,22 @@ 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-*). 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-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) + 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) - 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})") + 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}) set(CPACK_ARCHIVE_COMPONENT_INSTALL ON) set(CPACK_COMPONENTS_ALL applications rvsmodule) @@ -481,26 +488,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()