summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYiyang Wu <xgreenlandforwyy@gmail.com>2024-04-29 17:54:48 +0800
committerSam James <sam@gentoo.org>2024-06-26 10:18:51 +0100
commitb8b41ed264b9f6afc94e5278ea82faf8f02b4cac (patch)
tree863fd34978ae8fc103af0b37685014a5310ea367 /dev-libs/roct-thunk-interface
parentdev-python/doc8: fix overdependency on tomli (diff)
downloadgentoo-b8b41ed264b9f6afc94e5278ea82faf8f02b4cac.tar.gz
gentoo-b8b41ed264b9f6afc94e5278ea82faf8f02b4cac.tar.bz2
gentoo-b8b41ed264b9f6afc94e5278ea82faf8f02b4cac.zip
dev-libs/roct-thunk-interface: add 6.1.1
Enable test suite: kfdtest Add 3 patches to fix building kfdtest, two have upstream PR Update remote-id in metadata One test fails on 7900XT: https://github.com/ROCm/ROCT-Thunk-Interface/issues/103 Signed-off-by: Yiyang Wu <xgreenlandforwyy@gmail.com> Signed-off-by: Sam James <sam@gentoo.org>
Diffstat (limited to 'dev-libs/roct-thunk-interface')
-rw-r--r--dev-libs/roct-thunk-interface/Manifest1
-rw-r--r--dev-libs/roct-thunk-interface/files/kfdtest-6.1.0-libpath.patch13
-rw-r--r--dev-libs/roct-thunk-interface/files/kfdtest-6.1.0-linklibLLVM.patch31
-rw-r--r--dev-libs/roct-thunk-interface/files/roct-thunk-interface-6.1.0-visibility.patch26
-rw-r--r--dev-libs/roct-thunk-interface/metadata.xml2
-rw-r--r--dev-libs/roct-thunk-interface/roct-thunk-interface-6.1.1.ebuild80
6 files changed, 152 insertions, 1 deletions
diff --git a/dev-libs/roct-thunk-interface/Manifest b/dev-libs/roct-thunk-interface/Manifest
index 5d6ef732ff39..eb9ca50d705f 100644
--- a/dev-libs/roct-thunk-interface/Manifest
+++ b/dev-libs/roct-thunk-interface/Manifest
@@ -4,3 +4,4 @@ DIST roct-thunk-interface-5.4.3.tar.gz 648897 BLAKE2B 9eefc5f417280a98c7c6b6d611
DIST roct-thunk-interface-5.5.1.tar.gz 649617 BLAKE2B 54ecae486e5d8b99363947a93b38bb80f6b129bbacc1b3152d58e44cf093e44254075cdc49f6d0f474a04c5e2a1f3945399a744892ac1e5c1fb3ff38fd02370c SHA512 359ce5c7d8fce1f6100aac236efd24d35ce8098732bf89225e7c07a4731452388b5213eda8767a8d7723afa2041033bbcb287dcb00e88a0df9494acf70f8ebaf
DIST roct-thunk-interface-5.7.1.tar.gz 665529 BLAKE2B 407601d45976ad66e85999c53bcaa62fefa2ea823e1d3296a9aabe8b6a9c915776344de4499fcf6f9ee80193201308b27b387a7225aca5d2cc7e294143eefacd SHA512 c0dc449c8b713ac543f6cd6c876ea0f160dcb1a5c4a52a2b1364fcae0039e9fe195e4223a2644d7d3a7fbc2a48166e798d15b9088e2097b65974e2ba5e48bdcf
DIST roct-thunk-interface-6.0.0.tar.gz 665726 BLAKE2B 634165c1dce2d4e2f635688ea54c0eb3dd0cf0a0ae84fbbf22f07f62675ad77daea168b16c73e7b4912a46b8507d414119310f31bf110475e27d4629209067d9 SHA512 136a512273823738a3a85330158099b33084018485c94cb20244d61b5f6932949d32eba1fe77512b0933f0269da2f5bcec4cef5b503dc810140a9c080cf65e0f
+DIST roct-thunk-interface-6.1.1.tar.gz 666377 BLAKE2B b30d733fb769f7169e97b8a28eaa61c84205aec06b55d662d24f159a3c84190f3252f090413769e56eb621abc789fae521cb7b26d7cdac952ff1e4e120707bc9 SHA512 2c579606d2ced9f8b5e32841db745819771b7d6ce0cef90b818e3710470e30c7715540125d99ed5ea13c4e672d5af6d8ad2dd5975ef76cab7ba993d86cf74eb4
diff --git a/dev-libs/roct-thunk-interface/files/kfdtest-6.1.0-libpath.patch b/dev-libs/roct-thunk-interface/files/kfdtest-6.1.0-libpath.patch
new file mode 100644
index 000000000000..1d7d73ad7a8a
--- /dev/null
+++ b/dev-libs/roct-thunk-interface/files/kfdtest-6.1.0-libpath.patch
@@ -0,0 +1,13 @@
+The built hsakmt library is right under BUILD_DIR, not BUILD_DIR/lib
+===================================================================
+--- a/tests/kfdtest/CMakeLists.txt
++++ b./tests/kfdtest/CMakeLists.txt
+@@ -117,7 +117,7 @@ else()
+ endif()
+
+ if( DEFINED LIBHSAKMT_PATH )
+- set ( HSAKMT_LIBRARY_DIRS ${LIBHSAKMT_PATH}/lib )
++ set ( HSAKMT_LIBRARY_DIRS ${LIBHSAKMT_PATH}/ )
+ set ( HSAKMT_LIBRARIES hsakmt )
+ endif()
+
diff --git a/dev-libs/roct-thunk-interface/files/kfdtest-6.1.0-linklibLLVM.patch b/dev-libs/roct-thunk-interface/files/kfdtest-6.1.0-linklibLLVM.patch
new file mode 100644
index 000000000000..61d8b99bf335
--- /dev/null
+++ b/dev-libs/roct-thunk-interface/files/kfdtest-6.1.0-linklibLLVM.patch
@@ -0,0 +1,31 @@
+https://github.com/ROCm/ROCT-Thunk-Interface/pull/102
+From 6d7d48bb6843405aac2777388edf4c7c2a6f9dc3 Mon Sep 17 00:00:00 2001
+From: Yiyang Wu <xgreenlandforwyy@gmail.com>
+Date: Tue, 30 Apr 2024 13:35:08 +0800
+Subject: [PATCH] Allow linking libLLVM dynamic library rather than separate
+ components
+
+---
+ tests/kfdtest/CMakeLists.txt | 6 +++++-
+ 1 file changed, 5 insertions(+), 1 deletion(-)
+
+diff --git a/tests/kfdtest/CMakeLists.txt b/tests/kfdtest/CMakeLists.txt
+index 9d1172e..ccad7f4 100644
+--- a/tests/kfdtest/CMakeLists.txt
++++ b/tests/kfdtest/CMakeLists.txt
+@@ -154,7 +154,11 @@ include_directories(${LLVM_INCLUDE_DIRS})
+ separate_arguments(LLVM_DEFINITIONS_LIST NATIVE_COMMAND ${LLVM_DEFINITIONS})
+ add_definitions(${LLVM_DEFINITIONS_LIST})
+
+-llvm_map_components_to_libnames(llvm_libs AMDGPUAsmParser Core Support)
++if (LLVM_LINK_LLVM_DYLIB)
++ set(llvm_libs LLVM)
++else()
++ llvm_map_components_to_libnames(llvm_libs AMDGPUAsmParser Core Support)
++endif()
+
+ include_directories(${PROJECT_SOURCE_DIR}/gtest-1.6.0)
+ include_directories(${PROJECT_SOURCE_DIR}/include)
+--
+2.44.0
+
diff --git a/dev-libs/roct-thunk-interface/files/roct-thunk-interface-6.1.0-visibility.patch b/dev-libs/roct-thunk-interface/files/roct-thunk-interface-6.1.0-visibility.patch
new file mode 100644
index 000000000000..d907d2f13e41
--- /dev/null
+++ b/dev-libs/roct-thunk-interface/files/roct-thunk-interface-6.1.0-visibility.patch
@@ -0,0 +1,26 @@
+https://github.com/ROCm/ROCT-Thunk-Interface/pull/102
+From 8385d8795b994f31e00e651dc4f41e18d82ff968 Mon Sep 17 00:00:00 2001
+From: Yiyang Wu <xgreenlandforwyy@gmail.com>
+Date: Tue, 30 Apr 2024 15:07:12 +0800
+Subject: [PATCH] hsaKmtCheckRuntimeDebugSupport should be visible for kfdtest
+
+---
+ src/debug.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/src/debug.c b/src/debug.c
+index 932e829..67c32c8 100644
+--- a/src/debug.c
++++ b/src/debug.c
+@@ -268,7 +268,7 @@ HSAKMT_STATUS HSAKMTAPI hsaKmtDbgAddressWatch(HSAuint32 NodeId,
+ #define HSA_RUNTIME_ENABLE_MAX_MAJOR 1
+ #define HSA_RUNTIME_ENABLE_MIN_MINOR 13
+
+-HSAKMT_STATUS hsaKmtCheckRuntimeDebugSupport(void) {
++HSAKMT_STATUS HSAKMTAPI hsaKmtCheckRuntimeDebugSupport(void) {
+ HsaNodeProperties node = {0};
+ HsaSystemProperties props = {0};
+ HsaVersionInfo versionInfo = {0};
+--
+2.44.0
+
diff --git a/dev-libs/roct-thunk-interface/metadata.xml b/dev-libs/roct-thunk-interface/metadata.xml
index 9af2c0cba14b..67fd1c7363cb 100644
--- a/dev-libs/roct-thunk-interface/metadata.xml
+++ b/dev-libs/roct-thunk-interface/metadata.xml
@@ -14,6 +14,6 @@
<name>Proxy Maintainers</name>
</maintainer>
<upstream>
- <remote-id type="github">RadeonOpenCompute/ROCT-Thunk-Interface</remote-id>
+ <remote-id type="github">ROCm/ROCT-Thunk-Interface</remote-id>
</upstream>
</pkgmetadata>
diff --git a/dev-libs/roct-thunk-interface/roct-thunk-interface-6.1.1.ebuild b/dev-libs/roct-thunk-interface/roct-thunk-interface-6.1.1.ebuild
new file mode 100644
index 000000000000..360a55716fbb
--- /dev/null
+++ b/dev-libs/roct-thunk-interface/roct-thunk-interface-6.1.1.ebuild
@@ -0,0 +1,80 @@
+# Copyright 1999-2024 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+ROCM_SKIP_GLOBALS=1
+inherit cmake linux-info rocm
+
+if [[ ${PV} == *9999 ]] ; then
+ EGIT_REPO_URI="https://github.com/ROCm/ROCT-Thunk-Interface/"
+ inherit git-r3
+else
+ SRC_URI="https://github.com/ROCm/ROCT-Thunk-Interface/archive/rocm-${PV}.tar.gz -> ${P}.tar.gz"
+ S="${WORKDIR}/ROCT-Thunk-Interface-rocm-${PV}"
+ KEYWORDS="~amd64"
+fi
+
+DESCRIPTION="Radeon Open Compute Thunk Interface"
+HOMEPAGE="https://github.com/ROCm/ROCT-Thunk-Interface"
+CONFIG_CHECK="~HSA_AMD ~HMM_MIRROR ~ZONE_DEVICE ~DRM_AMDGPU ~DRM_AMDGPU_USERPTR"
+LICENSE="MIT"
+SLOT="0/$(ver_cut 1-2)"
+
+RDEPEND="sys-process/numactl
+ x11-libs/libdrm[video_cards_amdgpu]"
+DEPEND="${RDEPEND}
+ test? ( sys-devel/llvm
+ dev-cpp/gtest )"
+
+IUSE="test"
+RESTRICT="!test? ( test )"
+
+CMAKE_BUILD_TYPE=Release
+
+PATCHES=(
+ "${FILESDIR}/${PN}-5.7.1-musl.patch"
+ "${FILESDIR}/${PN}-6.1.0-visibility.patch"
+ "${FILESDIR}/kfdtest-6.1.0-linklibLLVM.patch"
+ "${FILESDIR}/kfdtest-6.1.0-libpath.patch"
+)
+
+test_wrapper() {
+ local S="$1"
+ shift 1
+ local CMAKE_USE_DIR="${S}"
+ local BUILD_DIR="${S}_build"
+ cd "${S}" || die
+ $@
+}
+
+src_prepare() {
+ sed -e "s:get_version ( \"1.0.0\" ):get_version ( \"${PV}\" ):" -i CMakeLists.txt || die
+ cmake_src_prepare
+}
+
+src_configure() {
+ local mycmakeargs=(
+ -DCPACK_PACKAGING_INSTALL_PREFIX="${EPREFIX}/usr"
+ )
+ cmake_src_configure
+
+ if use test; then
+ export LIBHSAKMT_PATH="${BUILD_DIR}"
+ test_wrapper "${S}/tests/kfdtest" cmake_src_configure
+ fi
+}
+
+src_compile() {
+ cmake_src_compile
+ if use test; then
+ LIBRARY_PATH="${BUILD_DIR}" test_wrapper "${S}/tests/kfdtest" cmake_src_compile
+ fi
+}
+
+src_test() {
+ check_amdgpu
+ TESTDIR="${S}/tests/kfdtest_build/"
+ cd "${TESTDIR}" || die
+ PATH="${PATH}:${TESTDIR}" ./run_kfdtest.sh
+}