summaryrefslogtreecommitdiff
path: root/dev-util
diff options
context:
space:
mode:
Diffstat (limited to 'dev-util')
-rw-r--r--dev-util/Tensile/Manifest1
-rw-r--r--dev-util/Tensile/Tensile-4.3.0.ebuild74
-rw-r--r--dev-util/Tensile/files/Tensile-4.3.0-hsaco-compile-specified-arch.patch96
-rw-r--r--dev-util/Tensile/files/Tensile-4.3.0-output-commands.patch23
-rw-r--r--dev-util/Tensile/metadata.xml10
-rw-r--r--dev-util/hip/hip-4.3.0-r2.ebuild112
-rw-r--r--dev-util/ostree/Manifest2
-rw-r--r--dev-util/ostree/ostree-2022.2.ebuild (renamed from dev-util/ostree/ostree-2021.6.ebuild)2
8 files changed, 318 insertions, 2 deletions
diff --git a/dev-util/Tensile/Manifest b/dev-util/Tensile/Manifest
new file mode 100644
index 000000000000..fd4cac044af8
--- /dev/null
+++ b/dev-util/Tensile/Manifest
@@ -0,0 +1 @@
+DIST rocm-Tensile-4.3.0.tar.gz 14250149 BLAKE2B 030138eaca2a0aadd96801e6dbd72e510716dd90553ef3795c5e04e00a34a05ecae82b24f755e4033a4acfcdb1cf26291da1e7902bb090f89a010d403e832beb SHA512 126db0b413c716fba8d5be9bff7a44fd1badacbf32f3db8d0db649819177db37ebd56fd22dd3c809655f5d29675be115e698cd10bc3d0b4b23878ae3726fce47
diff --git a/dev-util/Tensile/Tensile-4.3.0.ebuild b/dev-util/Tensile/Tensile-4.3.0.ebuild
new file mode 100644
index 000000000000..7e8a6242bf24
--- /dev/null
+++ b/dev-util/Tensile/Tensile-4.3.0.ebuild
@@ -0,0 +1,74 @@
+# Copyright 1999-2022 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+PYTHON_COMPAT=( python3_{7,8,9,10} )
+DISTUTILS_USE_PEP517=setuptools
+inherit distutils-r1
+
+DESCRIPTION="Stretching GPU performance for GEMMs and tensor contractions"
+HOMEPAGE="https://github.com/ROCmSoftwarePlatform/Tensile"
+SRC_URI="https://github.com/ROCmSoftwarePlatform/Tensile/archive/rocm-${PV}.tar.gz -> rocm-Tensile-${PV}.tar.gz"
+S="${WORKDIR}/${PN}-rocm-${PV}"
+
+LICENSE="MIT"
+KEYWORDS="~amd64"
+SLOT="0/$(ver_cut 1-2)"
+
+# Not compatible with recent versions of pytest
+RESTRICT="test"
+
+RDEPEND="${PYTHON_DEPS}
+ dev-python/pyyaml[${PYTHON_USEDEP}]
+ dev-python/msgpack[${PYTHON_USEDEP}]
+"
+DEPEND="${RDEPEND}
+ dev-util/hip:${SLOT}
+"
+BDEPEND="test? (
+ dev-util/rocminfo:${SLOT}
+)"
+
+PATCHES=(
+ "${FILESDIR}/Tensile-${PV}-hsaco-compile-specified-arch.patch" # backported from upstream, should remove after 4.3.0
+ "${FILESDIR}/Tensile-4.3.0-output-commands.patch"
+)
+
+CMAKE_USE_DIR="${WORKDIR}/Source"
+
+distutils_enable_tests pytest
+
+src_prepare() {
+ distutils-r1_src_prepare
+
+ mv ${PN}/Source "${WORKDIR}"/ || die
+ sed -e "/ROCM_SMI_ROOT/s,lib,$(get_libdir)," \
+ -i "${WORKDIR}"/Source/cmake/FindROCmSMI.cmake || die
+ sed -r -e "/TENSILE_USE_LLVM/s/ON/OFF/" \
+ -i "${WORKDIR}"/Source/CMakeLists.txt || die
+
+ sed -e "/HipClangVersion/s/0,0,0/$(ver_rs 1-3 ,)/" \
+ -e "/SourcePath/s,os\.path\.join.*$,\"${EPREFIX}/usr/share/${PN}\"," \
+ -i ${PN}/Common.py || die
+
+ sed -e "s|os\.path\.dirname.*$|\"${EPREFIX}/usr/share/Tensile\", end='')|" \
+ -i ${PN}/__init__.py || die
+}
+
+src_test() {
+ ROCM_PATH="${EPREFIX}/usr/" distutils-r1_src_test
+}
+
+src_install() {
+ distutils-r1_src_install
+
+ # Move the cmake files to the correct directory
+ mkdir -p "${ED}/usr/$(get_libdir)/cmake/${PN}" || die
+ mv "${ED}/usr/cmake/"* "${ED}/usr/$(get_libdir)/cmake/${PN}" || die
+ rm -r "${ED}/usr/cmake" || die
+
+ insinto /usr/share/${PN}
+ doins -r "${WORKDIR}"/Source/*
+ dosym . /usr/share/${PN}/Source
+}
diff --git a/dev-util/Tensile/files/Tensile-4.3.0-hsaco-compile-specified-arch.patch b/dev-util/Tensile/files/Tensile-4.3.0-hsaco-compile-specified-arch.patch
new file mode 100644
index 000000000000..8e6753781a2a
--- /dev/null
+++ b/dev-util/Tensile/files/Tensile-4.3.0-hsaco-compile-specified-arch.patch
@@ -0,0 +1,96 @@
+https://github.com/ROCmSoftwarePlatform/Tensile/issues/1395
+https://github.com/ROCmSoftwarePlatform/Tensile/pull/1398
+
+--- a/Tensile/TensileCreateLibrary.py
++++ b/Tensile/TensileCreateLibrary.py
+@@ -136,6 +136,35 @@ def which(p):
+ return candidate
+ return None
+
++def splitArchs():
++ # Helper for architecture
++ def isSupported(arch):
++ return globalParameters["AsmCaps"][arch]["SupportedISA"] and \
++ globalParameters["AsmCaps"][arch]["SupportedSource"]
++
++ if ";" in globalParameters["Architecture"]:
++ wantedArchs = globalParameters["Architecture"].split(";")
++ else:
++ wantedArchs = globalParameters["Architecture"].split("_")
++ archs = []
++ cmdlineArchs = []
++ if "all" in wantedArchs:
++ for arch in globalParameters['SupportedISA']:
++ if isSupported(arch):
++ if (arch == (9,0,6) or arch == (9,0,8) or arch == (9,0,10)):
++ if (arch == (9,0,10)):
++ archs += [gfxName(arch) + '-xnack+']
++ cmdlineArchs += [gfxName(arch) + ':xnack+']
++ archs += [gfxName(arch) + '-xnack-']
++ cmdlineArchs += [gfxName(arch) + ':xnack-']
++ else:
++ archs += [gfxName(arch)]
++ cmdlineArchs += [gfxName(arch)]
++ else:
++ for arch in wantedArchs:
++ archs += [re.sub(":", "-", arch)]
++ cmdlineArchs += [arch]
++ return archs, cmdlineArchs
+
+ def buildSourceCodeObjectFile(CxxCompiler, outputPath, kernelFile):
+ buildPath = ensurePath(os.path.join(globalParameters['WorkingPath'], 'code_object_tmp'))
+@@ -149,24 +178,8 @@ def buildSourceCodeObjectFile(CxxCompiler, outputPath, kernelFile):
+ objectFilename = base + '.o'
+ soFilename = base + '.so'
+
+- def isSupported(arch):
+- return globalParameters["AsmCaps"][arch]["SupportedISA"] and \
+- globalParameters["AsmCaps"][arch]["SupportedSource"]
+-
+ if (CxxCompiler == "hipcc"):
+- archs = []
+- cmdlineArchs = []
+- for arch in globalParameters['SupportedISA']:
+- if isSupported(arch):
+- if (arch == (9,0,6) or arch == (9,0,8) or arch == (9,0,10)):
+- if (arch == (9,0,10)):
+- archs += [gfxName(arch) + '-xnack+']
+- cmdlineArchs += [gfxName(arch) + ':xnack+']
+- archs += [gfxName(arch) + '-xnack-']
+- cmdlineArchs += [gfxName(arch) + ':xnack-']
+- else:
+- archs += [gfxName(arch)]
+- cmdlineArchs += [gfxName(arch)]
++ archs, cmdlineArchs = splitArchs()
+
+ archFlags = ['--offload-arch=' + arch for arch in cmdlineArchs]
+
+@@ -1063,11 +1076,6 @@ def buildObjectFileNames(solutionWriter, kernelWriterSource, kernelWriterAssembl
+ sourceKernels = list([k for k in kernels if k['KernelLanguage'] == 'Source'])
+ asmKernels = list([k for k in kernels if k['KernelLanguage'] == 'Assembly'])
+
+- # Helper for architecture
+- def isSupported(arch):
+- return globalParameters["AsmCaps"][arch]["SupportedISA"] and \
+- globalParameters["AsmCaps"][arch]["SupportedSource"]
+-
+ # Build a list of kernel object names.
+ for kernel in sourceKernels:
+ sourceKernelNames += [kernelWriterSource.getKernelFileBase(kernel)]
+@@ -1081,15 +1089,7 @@ def buildObjectFileNames(solutionWriter, kernelWriterSource, kernelWriterAssembl
+
+ # Source based kernels are built for all supported architectures
+ if (cxxCompiler == 'hipcc'):
+- sourceArchs = []
+- for arch in globalParameters['SupportedISA']:
+- if isSupported(arch):
+- if (arch == (9,0,6) or arch == (9,0,8) or arch == (9,0,10)):
+- if (arch == (9,0,10)):
+- sourceArchs += [gfxName(arch) + '-xnack+']
+- sourceArchs += [gfxName(arch) + '-xnack-']
+- else:
+- sourceArchs += [gfxName(arch)]
++ sourceArchs, _ = splitArchs()
+ else:
+ raise RuntimeError("Unknown compiler %s" % cxxCompiler)
+
diff --git a/dev-util/Tensile/files/Tensile-4.3.0-output-commands.patch b/dev-util/Tensile/files/Tensile-4.3.0-output-commands.patch
new file mode 100644
index 000000000000..be5a4db21429
--- /dev/null
+++ b/dev-util/Tensile/files/Tensile-4.3.0-output-commands.patch
@@ -0,0 +1,23 @@
+diff --color -uprN orig/Tensile/cmake/TensileConfig.cmake Tensile-rocm-4.3.0/Tensile/cmake/TensileConfig.cmake
+--- orig/Tensile/cmake/TensileConfig.cmake 2021-08-18 17:48:00.115478470 +0800
++++ Tensile-rocm-4.3.0/Tensile/cmake/TensileConfig.cmake 2021-08-18 17:48:49.963478801 +0800
+@@ -234,6 +234,7 @@ function(TensileCreateLibraryFiles
+ COMMENT "Generating Tensile Libraries"
+ OUTPUT ${Tensile_EMBED_LIBRARY_SOURCE};${Tensile_MANIFEST_CONTENTS}
+ COMMAND ${CommandLine}
++ USES_TERMINAL
+ )
+
+ set("${Tensile_VAR_PREFIX}_ALL_FILES" ${Tensile_MANIFEST_CONTENTS} PARENT_SCOPE)
+diff --color -uprN orig/Tensile/Common.py Tensile-rocm-4.3.0/Tensile/Common.py
+--- orig/Tensile/Common.py 2021-08-18 17:48:00.075478470 +0800
++++ Tensile-rocm-4.3.0/Tensile/Common.py 2021-08-18 17:48:23.287478624 +0800
+@@ -179,7 +179,7 @@ globalParameters["PrintTensorD"] = 0
+ globalParameters["PrintTensorRef"] = 0 # Print reference tensor. 0x1=after init; 0x2=after copy-back; 0x3=both
+ globalParameters["PrintIndexAssignments"] = 0 # Print the tensor index assignment info
+ globalParameters["PrintWinnersOnly"] = False # Only print the solutions which become the fastest
+-globalParameters["PrintCodeCommands"] = False # print the commands used to generate the code objects (asm,link,hip-clang, etc)
++globalParameters["PrintCodeCommands"] = True # print the commands used to generate the code objects (asm,link,hip-clang, etc)
+ globalParameters["DumpTensors"] = False # If True, dump tensors to binary files instead of printing them.
+
+ # TODO - remove this when NewClient is mainstream
diff --git a/dev-util/Tensile/metadata.xml b/dev-util/Tensile/metadata.xml
new file mode 100644
index 000000000000..b6a015d28efa
--- /dev/null
+++ b/dev-util/Tensile/metadata.xml
@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "https://liguros.gitlab.io/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer type="project">
+ <email>sci@gentoo.org</email>
+ <name>Science Project</name>
+ </maintainer>
+
+ <origin>gentoo-staging</origin>
+</pkgmetadata> \ No newline at end of file
diff --git a/dev-util/hip/hip-4.3.0-r2.ebuild b/dev-util/hip/hip-4.3.0-r2.ebuild
new file mode 100644
index 000000000000..9547abd69ae1
--- /dev/null
+++ b/dev-util/hip/hip-4.3.0-r2.ebuild
@@ -0,0 +1,112 @@
+# Copyright 1999-2022 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+inherit cmake prefix
+
+DESCRIPTION="C++ Heterogeneous-Compute Interface for Portability"
+HOMEPAGE="https://github.com/ROCm-Developer-Tools/HIP"
+SRC_URI="https://github.com/ROCm-Developer-Tools/HIP/archive/rocm-${PV}.tar.gz -> rocm-hip-${PV}.tar.gz
+ https://github.com/RadeonOpenCompute/ROCm-OpenCL-Runtime/archive/rocm-${PV}.tar.gz -> rocm-opencl-runtime-${PV}.tar.gz"
+S="${WORKDIR}/HIP-rocm-${PV}"
+
+KEYWORDS="~amd64"
+LICENSE="MIT"
+SLOT="0/$(ver_cut 1-2)"
+
+IUSE="debug profile"
+
+DEPEND="
+ dev-libs/rocclr:${SLOT}
+ dev-util/rocminfo:${SLOT}
+ dev-libs/roct-thunk-interface:${SLOT}
+ =sys-devel/llvm-roc-${PV}*[runtime]
+ profile? ( dev-util/roctracer:${SLOT} )"
+RDEPEND="${DEPEND}
+ dev-perl/URI-Encode"
+
+PATCHES=(
+ "${FILESDIR}/${PN}-4.1.0-DisableTest.patch"
+ "${FILESDIR}/${PN}-3.9.0-add-include-directories.patch"
+ "${FILESDIR}/${PN}-4.2.0-config-cmake-in.patch"
+ "${FILESDIR}/${PN}-4.3.0-hip_vector_types.patch"
+ "${FILESDIR}/${PN}-4.2.0-cancel-hcc-header-removal.patch"
+)
+
+src_prepare() {
+ cmake_src_prepare
+
+ # Use Gentoo slot number, otherwise git hash is attempted in vain.
+ sed -e "/set (HIP_LIB_VERSION_STRING/cset (HIP_LIB_VERSION_STRING ${SLOT#*/})" -i CMakeLists.txt || die
+
+ # disable PCH, because it results in a build error in ROCm 4.0.0
+ sed -e "s:option(__HIP_ENABLE_PCH:#option(__HIP_ENABLE_PCH:" -i CMakeLists.txt || die
+
+ # remove forcing set USE_PROF_API to 1
+ sed -e '/set(USE_PROF_API "1")/d' -i rocclr/CMakeLists.txt || die
+
+ # "hcc" is deprecated and not installed, new platform is "rocclr";
+ # Setting HSA_PATH to "/usr" results in setting "-isystem /usr/include"
+ # which makes "stdlib.h" not found when using "#include_next" in header files;
+ sed -e "/FLAGS .= \" -isystem \$HSA_PATH/d" \
+ -e "s:\$ENV{'DEVICE_LIB_PATH'}:'/usr/lib/amdgcn/bitcode':" \
+ -e "/rpath/s,--rpath=[^ ]*,," \
+ -i bin/hipcc || die
+
+ # correctly find HIP_CLANG_INCLUDE_PATH using cmake
+ sed -e "/set(HIP_CLANG_ROOT/s:\"\${ROCM_PATH}/llvm\":/usr/lib/llvm/roc:" -i hip-config.cmake.in || die
+
+ # change --hip-device-lib-path to "/usr/lib/amdgcn/bitcode", must align with "dev-libs/rocm-device-libs"
+ sed -e "s:\${AMD_DEVICE_LIBS_PREFIX}/lib:/usr/lib/amdgcn/bitcode:" \
+ -i "${S}/hip-config.cmake.in" || die
+
+ einfo "prefixing hipcc and its utils..."
+ hprefixify $(grep -rl --exclude-dir=build/ "/usr" "${S}")
+
+ cp "$(prefixify_ro "${FILESDIR}"/hipvars.pm)" bin/ || die "failed to replace hipvars.pm"
+ sed -e "s,@HIP_BASE_VERSION_MAJOR@,$(ver_cut 1)," -e "s,@HIP_BASE_VERSION_MINOR@,$(ver_cut 2)," \
+ -e "s,@HIP_VERSION_PATCH@,$(ver_cut 3)," -i bin/hipvars.pm || die
+
+ cp -a "${WORKDIR}"/ROCm-OpenCL-Runtime-rocm-${PV}/amdocl/cl_vk_amd.hpp amdocl/ || die
+
+ # Bug 790164
+ rm amdocl/CL/cl{,_icd,_gl,_gl_ext,_platform}.h || die
+ sed -i 's/CL_EXT_SUFFIX/CL_API_SUFFIX/' amdocl/cl_icd_amd.h amdocl/CL/cl_ext.h rocclr/cl_lqdflash_amd.h || die
+}
+
+src_configure() {
+ use debug && CMAKE_BUILD_TYPE="Debug"
+
+ # TODO: Currently a GENTOO configuration is build,
+ # this is also used in the cmake configuration files
+ # which will be installed to find HIP;
+ # Other ROCm packages expect a "RELEASE" configuration,
+ # see "hipBLAS"
+ local mycmakeargs=(
+ -DCMAKE_PREFIX_PATH="${EPREFIX}/usr/lib/llvm/roc"
+ -DCMAKE_BUILD_TYPE=${buildtype}
+ -DCMAKE_INSTALL_PREFIX="${EPREFIX}/usr/lib/hip"
+ -DBUILD_HIPIFY_CLANG=OFF
+ -DHIP_PLATFORM=rocclr
+ -DHIP_COMPILER=clang
+ -DROCM_PATH="${EPREFIX}/usr"
+ -DHSA_PATH="${EPREFIX}/usr"
+ -DUSE_PROF_API=$(usex profile 1 0)
+ -DPROF_API_HEADER_PATH="${EPREFIX}"/usr/include/roctracer/ext
+ -DROCclr_DIR="${EPREFIX}"/usr/include/rocclr
+ )
+
+ cmake_src_configure
+}
+
+src_install() {
+ echo "PATH=${EPREFIX}/usr/lib/hip/bin" >> 99hip || die
+ echo "LDPATH=${EPREFIX}/usr/lib/hip/lib" >> 99hip || die
+ echo "ROOTPATH=${EPREFIX}/usr/lib/hip/bin" >> 99hip || die
+
+ doenvd 99hip
+
+ cmake_src_install
+
+ rm "${ED}/usr/lib/hip/include/hip/hcc_detail" || die
+}
diff --git a/dev-util/ostree/Manifest b/dev-util/ostree/Manifest
index 7f54282d51b5..e2b7b5c49f39 100644
--- a/dev-util/ostree/Manifest
+++ b/dev-util/ostree/Manifest
@@ -1,2 +1,2 @@
-DIST ostree-2021.6.tar.xz 2100784 BLAKE2B 40b5c7bb6af272e7f40e7590bb7d12f4c7d95b13b4122103cb9ba6468b26246f529d223338c43cadd6d763b0396e10479ae8d50e0036e920605e10652026bb0e SHA512 5fcb8053530eb3b687198331a8f84f7913bba32be29c1828251e1ba70b436b0364531e54f75b6d04580d79304131892d4b72e32f6ba653d0e1caddf902ae660c
DIST ostree-2022.1.tar.xz 2101172 BLAKE2B 52f6723acfb2889ef232f0fdec39fc50a879b110fcc89aa318dc0eb336e50ef2c3cc0d4df4319601b6198b7789da3605a55979d0c9ee31029ae47832b0cb385f SHA512 73da367d3b9b5facc5ba894bd0f9297a7fc688fa69871b668e6568663fefc1f44433c8be352d57c23153b09144c6535e52d8c184a2ab103190ec37dc1abc2818
+DIST ostree-2022.2.tar.xz 2059592 BLAKE2B 73bb563be473f3f62ab2d0e1ec6e2b659c8c12aaba828ae6fd5bab4b6bd3a978ffe5d76e17734e40c0569e3e74f13b85aaf9ae467747c5bbb309c73b373e9909 SHA512 07be16101aa00f541833dc6123f015ee1af65e40e2c237322a129e944fa19791e7cad6f0b29ced3c128adbe23bdb3c8708688fadd4ed80b160acab584b84abfe
diff --git a/dev-util/ostree/ostree-2021.6.ebuild b/dev-util/ostree/ostree-2022.2.ebuild
index 0e424e4efab7..bd790d202bde 100644
--- a/dev-util/ostree/ostree-2021.6.ebuild
+++ b/dev-util/ostree/ostree-2022.2.ebuild
@@ -1,4 +1,4 @@
-# Copyright 2021 Liguros Authors
+# Copyright 2021-2022 Liguros Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=8