#Image support is x86 only %ifarch x86_64 %global enableimage 1 %endif %global rocm_release 6.3 %global rocm_patch 0 %global rocm_version %{rocm_release}.%{rocm_patch} Name: rocm-runtime Version: %{rocm_version} %if 0%{?rhel} && 0%{?rhel} < 10 Release: 1%{?dist} %else Release: 0.%autorelease %endif Summary: ROCm Runtime Library License: NCSA URL: https://github.com/RadeonOpenCompute/ROCR-Runtime #Source0: https://github.com/RadeonOpenCompute/ROCR-Runtime/archive/refs/tags/rocm-%{version}.tar.gz#/%{name}-%{version}.tar.gz Source0: https://github.com/ROCm/ROCR-Runtime/archive/0f241d406114a392a082791c2d09809f7635c87e/%{name}-0f241d406114a392a082791c2d09809f7635c87e.tar.gz # LLVM 18 doesn't have gfx 1152 yet: Patch0: 0001-Revert-Add-support-for-GC-11.5.2.patch ExclusiveArch: x86_64 BuildRequires: cmake BuildRequires: elfutils-libelf-devel BuildRequires: libdrm-devel BuildRequires: libffi-devel BuildRequires: numactl-devel BuildRequires: pciutils-devel BuildRequires: rocm-compilersupport-macros BuildRequires: rocm-device-libs BuildRequires: vim-common %description The ROCm Runtime Library is a thin, user-mode API that exposes the necessary interfaces to access and interact with graphics hardware driven by the AMDGPU driver set and the AMDKFD kernel driver. Together they enable programmers to directly harness the power of AMD discrete graphics devices by allowing host applications to launch compute kernels directly to the graphics hardware. %package devel Summary: ROCm Runtime development files Requires: %{name}%{?_isa} = %{version}-%{release} Requires: hsakmt(rocm) = %{rocm_release} %description devel ROCm Runtime development files %package -n kfdtest Summary: Test suite for ROCm's KFD kernel module Requires: rocm-smi %description -n kfdtest This package includes ROCm's KFD kernel module test suite (kfdtest), the list of excluded tests for each ASIC, and a convenience script to run the test suite. %prep %autosetup -n ROCR-Runtime-0f241d406114a392a082791c2d09809f7635c87e -p1 # Allow us to build kfdtest at the same time as hsakmt using LIBHSAKMT_PATH # The CMake logic assumes hsakmt is an installed library sed -i "s/{HSAKMT_LIBRARY_DIRS}/{LIBHSAKMT_PATH}/" libhsakmt/tests/kfdtest/CMakeLists.txt %build LLVM_CMAKEDIR=`llvm-config-%{rocmllvm_version} --cmakedir` if [ ! -d ${LLVM_CMAKEDIR} ]; then echo "Something wrong with llvm-config" false fi %cmake -DCMAKE_BUILD_TYPE=RelWithDebInfo \ -DCMAKE_PREFIX_PATH=%{_libdir}/llvm%{rocmllvm_version} \ -DCMAKE_INSTALL_LIBDIR=%{_lib} \ -DINCLUDE_PATH_COMPATIBILITY=OFF \ %{?!enableimage:-DIMAGE_SUPPORT=OFF} %cmake_build export LIBHSAKMT_PATH=$(pwd)/%__cmake_builddir/libhsakmt/archive cd libhsakmt/tests/kfdtest %cmake -DCMAKE_BUILD_TYPE=RelWithDebInfo -DCMAKE_SKIP_RPATH=ON -DLLVM_DIR=${LLVM_CMAKEDIR} %cmake_build %install %cmake_install cd libhsakmt/tests/kfdtest %cmake_install %ldconfig_scriptlets %files %doc README.md %license LICENSE.txt %{_libdir}/libhsa-runtime64.so.1{,.*} %exclude %{_docdir}/hsa-runtime64/LICENSE.md %files devel %{_includedir}/hsa/ %{_libdir}/libhsa-runtime64.so %{_libdir}/cmake/hsa-runtime64/ %files -n kfdtest %doc libhsakmt/tests/kfdtest/README.txt %license libhsakmt/tests/kfdtest/LICENSE.kfdtest %{_bindir}/kfdtest %{_bindir}/run_kfdtest.sh %{_datadir}/kfdtest # We don't need to redistribute hsakmt anymore: %exclude %{_libdir}/libhsakmt.a %exclude %{_includedir}/hsakmt %exclude %{_libdir}/cmake/hsakmt/ %exclude %{_libdir}/pkgconfig/libhsakmt.pc %changelog %autochangelog