%global rocm_release 5.5 %global rocm_patch 1 %global rocm_version %{rocm_release}.%{rocm_patch} Name: rocm_smi_lib Version: %{rocm_version} Release: 1%{?dist} Summary: ROCm System Management Interface Library License: NCSA and MIT and BSD URL: https://github.com/RadeonOpenCompute/%{name} Source0: %{url}/archive/refs/tags/rocm-%{version}.tar.gz#/%{name}-%{version}.tar.gz Patch0: 0001-Fix-version-file-generation.patch Patch1: 0002-Fix-python-script-install-permissions.patch # SMI requires the AMDGPU kernel module, which only builds on: ExclusiveArch: x86_64 aarch64 ppc64le BuildRequires: cmake # Fedora 38 has doxygen 1.9.6 %if 0%{?fedora} > 38 BuildRequires: doxygen >= 1.9.7 BuildRequires: doxygen-latex >= 1.9.7 %endif BuildRequires: gcc-c++ # rocm-smi was rewritten as rocm_smi_lib and replaced the old rocm-smi in 4.1.0 Provides: rocm-smi = %{version}-%{release} Obsoletes: rocm-smi < 4.1.0 %description The ROCm System Management Interface Library, or ROCm SMI library, is part of the Radeon Open Compute ROCm software stack . It is a C library for Linux that provides a user space interface for applications to monitor and control GPU applications. %package devel Summary: ROCm SMI Library development files Requires: %{name}%{?_isa} = %{version}-%{release} %description devel ROCm System Management Interface Library development files %prep %autosetup -n %{name}-rocm-%{version} -p1 # TODO: sent patch upstream to fix this path logic to find the smi library: # - logic should allow finding the library without hard coding paths # - python library should try to find the .so.1 file instead of .so sed -i 's|/lib/librocm_smi64.so|/%{_lib}/librocm_smi64.so.1|' \ python_smi_tools/*.py # Fix source permissions find ./ -type f \( -name \*.cc -o -iname \*.h \) -exec chmod 644 {} \; # Don't change default C FLAGS and CXX FLAGS: sed -i '/CMAKE_C.*_FLAGS/d' CMakeLists.txt %build %cmake -DFILE_REORG_BACKWARD_COMPATIBILITY=OFF %cmake_build %install %cmake_install # For Fedora < 38, the README is not installed if doxygen is disabled: install -D -m 644 README.md %{buildroot}%{_docdir}/rocm_smi/README.md %files %doc %{_docdir}/rocm_smi %license License.txt %{_bindir}/rocm-smi %{_libexecdir}/rocm_smi %{_libdir}/librocm_smi64.so.1{,.*} %{_libdir}/liboam.so.1{,.*} %exclude %{_docdir}/rocm_smi/LICENSE.txt %files devel %{_includedir}/rocm_smi/ %{_includedir}/oam/ %{_libdir}/librocm_smi64.so %{_libdir}/liboam.so %{_libdir}/cmake/rocm_smi/ %changelog * Fri Jun 23 2023 Jeremy Newton - 5.5.1-1 - Initial Package