From 5cbdcb738fa646996cbf8e119465300742bca327 Mon Sep 17 00:00:00 2001 From: "Andrew J. Hesford" Date: Mon, 13 Apr 2020 13:08:09 -0400 Subject: [PATCH 1/9] New package: ROCT-Thunk-Interface-3.3.0 --- common/shlibs | 1 + srcpkgs/ROCT-Thunk-Interface-devel | 1 + .../patches/cmake-dev-libdir.patch | 10 ++++++ .../ROCT-Thunk-Interface/patches/musl.patch | 29 ++++++++++++++++ srcpkgs/ROCT-Thunk-Interface/template | 33 +++++++++++++++++++ srcpkgs/ROCT-Thunk-Interface/update | 1 + 6 files changed, 75 insertions(+) create mode 120000 srcpkgs/ROCT-Thunk-Interface-devel create mode 100644 srcpkgs/ROCT-Thunk-Interface/patches/cmake-dev-libdir.patch create mode 100644 srcpkgs/ROCT-Thunk-Interface/patches/musl.patch create mode 100644 srcpkgs/ROCT-Thunk-Interface/template create mode 100644 srcpkgs/ROCT-Thunk-Interface/update diff --git a/common/shlibs b/common/shlibs index dcb1d8e54b6..4f93db41216 100644 --- a/common/shlibs +++ b/common/shlibs @@ -3981,3 +3981,4 @@ libcglm.so.0 cglm-0.7.6_1 libfcft.so.3 fcft-2.2.2_1 libaml.so.0 aml-0.1.0_1 libneatvnc.so.0 neatvnc-0.2.0_1 +libhsakmt.so.1 ROCT-Thunk-Interface-3.3.0_1 diff --git a/srcpkgs/ROCT-Thunk-Interface-devel b/srcpkgs/ROCT-Thunk-Interface-devel new file mode 120000 index 00000000000..7e43c209e3d --- /dev/null +++ b/srcpkgs/ROCT-Thunk-Interface-devel @@ -0,0 +1 @@ +ROCT-Thunk-Interface \ No newline at end of file diff --git a/srcpkgs/ROCT-Thunk-Interface/patches/cmake-dev-libdir.patch b/srcpkgs/ROCT-Thunk-Interface/patches/cmake-dev-libdir.patch new file mode 100644 index 00000000000..98c7f1e459c --- /dev/null +++ b/srcpkgs/ROCT-Thunk-Interface/patches/cmake-dev-libdir.patch @@ -0,0 +1,10 @@ +--- CMakeLists.txt.old 2020-04-18 19:45:17.306081135 -0400 ++++ CMakeLists.txt 2020-04-18 19:46:51.300753636 -0400 +@@ -146,6 +146,7 @@ + COMMAND ${CMAKE_COMMAND} + -DSOURCE_DIR="${SOURCE_DIR}" + -DCMAKE_INSTALL_PREFIX="${CMAKE_INSTALL_PREFIX}" ++ -DCMAKE_INSTALL_LIBDIR="${CMAKE_INSTALL_LIBDIR}" + -DCPACK_RPM_PACKAGE_REQUIRES="hsakmt-roct" + -DCPACK_PACKAGING_INSTALL_PREFIX="${CPACK_PACKAGING_INSTALL_PREFIX}" + -DVERSION="${BUILD_VERSION_STRING}" diff --git a/srcpkgs/ROCT-Thunk-Interface/patches/musl.patch b/srcpkgs/ROCT-Thunk-Interface/patches/musl.patch new file mode 100644 index 00000000000..aeea9832411 --- /dev/null +++ b/srcpkgs/ROCT-Thunk-Interface/patches/musl.patch @@ -0,0 +1,29 @@ +diff -r -u old/src/libhsakmt.h new/src/libhsakmt.h +--- src/libhsakmt.h 2020-03-04 15:00:47.000000000 -0500 ++++ src/libhsakmt.h 2020-04-13 12:58:30.444865992 -0400 +@@ -54,6 +54,10 @@ + #define CHECK_KFD_OPEN() \ + do { if (kfd_open_count == 0 || hsakmt_forked) return HSAKMT_STATUS_KERNEL_IO_CHANNEL_NOT_OPENED; } while (0) + ++/*On some platforms, a PAGE_SIZE macro eclipses the extern variable*/ ++#ifdef PAGE_SIZE ++#undef PAGE_SIZE ++#endif + extern int PAGE_SIZE; + extern int PAGE_SHIFT; + +diff -r -u old/src/topology.c new/src/topology.c +--- src/topology.c 2020-03-04 15:00:47.000000000 -0500 ++++ src/topology.c 2020-04-13 13:01:31.209870701 -0400 +@@ -38,6 +38,11 @@ + #include "libhsakmt.h" + #include "fmm.h" + ++/*Needed on MUSL*/ ++#ifndef MAXNAMLEN ++#define MAXNAMLEN PATH_MAX ++#endif ++ + /* Number of memory banks added by thunk on top of topology + * This only includes static heaps like LDS, scratch and SVM, + * not for MMIO_REMAP heap. MMIO_REMAP memory bank is reported diff --git a/srcpkgs/ROCT-Thunk-Interface/template b/srcpkgs/ROCT-Thunk-Interface/template new file mode 100644 index 00000000000..8c680b2af29 --- /dev/null +++ b/srcpkgs/ROCT-Thunk-Interface/template @@ -0,0 +1,33 @@ +# Template file for 'ROCT-Thunk-Interface' +pkgname=ROCT-Thunk-Interface +version=3.3.0 +revision=1 +archs="x86_64*" +wrksrc="${pkgname}-roc-${version}" +build_style=cmake +make_build_target="all build-dev" +make_install_target="install install-dev" +hostmakedepends="cmake pkg-config" +makedepends="pciutils-devel libnuma-devel" +short_desc="Radeon Open Compute thunk interface" +maintainer="Andrew J. Hesford " +license="MIT" +homepage="https://github.com/RadeonOpenCompute/ROCT-Thunk-Interface" +distfiles="${homepage}/archive/roc-${version}.tar.gz" +checksum=2cabe9d2cfa72031c05d11290837c476182e72d8dec2049298f691143fdd212b +nocross=yes + +post_install() { + vlicense LICENSE.md +} + +ROCT-Thunk-Interface-devel_package() { + depends="${sourcepkg}>=${version}_${revision}" + short_desc+=" - development files" + pkg_install() { + vmove usr/include + vmove "usr/lib/*.so" + vmove usr/share/pkgconfig + vmove usr/lib/cmake + } +} diff --git a/srcpkgs/ROCT-Thunk-Interface/update b/srcpkgs/ROCT-Thunk-Interface/update new file mode 100644 index 00000000000..8385f4d1215 --- /dev/null +++ b/srcpkgs/ROCT-Thunk-Interface/update @@ -0,0 +1 @@ +pattern='roc-\K[\d.]+' From 8738399f72c96ba594d928abc2c165da2cc0772b Mon Sep 17 00:00:00 2001 From: "Andrew J. Hesford" Date: Mon, 13 Apr 2020 15:27:27 -0400 Subject: [PATCH 2/9] New package: ROCR-Runtime-3.3.0 --- common/shlibs | 1 + srcpkgs/ROCR-Runtime-devel | 1 + srcpkgs/ROCR-Runtime/patches/cmake.patch | 27 +++++++++++++++++++++ srcpkgs/ROCR-Runtime/template | 30 ++++++++++++++++++++++++ srcpkgs/ROCR-Runtime/update | 1 + 5 files changed, 60 insertions(+) create mode 120000 srcpkgs/ROCR-Runtime-devel create mode 100644 srcpkgs/ROCR-Runtime/patches/cmake.patch create mode 100644 srcpkgs/ROCR-Runtime/template create mode 100644 srcpkgs/ROCR-Runtime/update diff --git a/common/shlibs b/common/shlibs index 4f93db41216..944ab37c190 100644 --- a/common/shlibs +++ b/common/shlibs @@ -3982,3 +3982,4 @@ libfcft.so.3 fcft-2.2.2_1 libaml.so.0 aml-0.1.0_1 libneatvnc.so.0 neatvnc-0.2.0_1 libhsakmt.so.1 ROCT-Thunk-Interface-3.3.0_1 +libhsa-runtime64.so.1 ROCR-Runtime-3.3.0_1 diff --git a/srcpkgs/ROCR-Runtime-devel b/srcpkgs/ROCR-Runtime-devel new file mode 120000 index 00000000000..a733fb9fbab --- /dev/null +++ b/srcpkgs/ROCR-Runtime-devel @@ -0,0 +1 @@ +ROCR-Runtime \ No newline at end of file diff --git a/srcpkgs/ROCR-Runtime/patches/cmake.patch b/srcpkgs/ROCR-Runtime/patches/cmake.patch new file mode 100644 index 00000000000..93b74cd2297 --- /dev/null +++ b/srcpkgs/ROCR-Runtime/patches/cmake.patch @@ -0,0 +1,27 @@ +--- src/CMakeLists.txt.old 2020-04-18 20:01:48.549636995 -0400 ++++ src/CMakeLists.txt 2020-04-18 20:04:00.177179781 -0400 +@@ -108,8 +108,8 @@ + ## ROCr build internal versioning + add_definitions ( -DROCR_BUILD_ID=${PACKAGE_VERSION_STRING} ) + +-## Set RUNPATH - ../../lib covers use of the legacy symlink in /hsa/lib/ +-set(CMAKE_INSTALL_RPATH "$ORIGIN;$ORIGIN/../../lib;$ORIGIN/../../lib64;$ORIGIN/../lib64") ++## Set RUNPATH ++set(CMAKE_INSTALL_RPATH "$ORIGIN;$ORIGIN/../lib") + + ## ------------------------- Linux Compiler and Linker options ------------------------- + set ( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Werror -fexceptions -fno-rtti -fvisibility=hidden -Wno-error=sign-compare -Wno-sign-compare -Wno-write-strings -Wno-conversion-null -fno-math-errno -fno-threadsafe-statics -fmerge-all-constants -fms-extensions -Wno-error=comment -Wno-comment -Wno-error=pointer-arith -Wno-pointer-arith -Wno-error=unused-variable -Wno-error=unused-function" ) +@@ -185,11 +185,8 @@ + add_custom_target ( hsa_lib_link2 ALL WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} COMMAND ${CMAKE_COMMAND} -E create_symlink ../hsa/lib/${CORE_RUNTIME_LIBRARY}.so.${SO_MAJOR} ${CORE_RUNTIME_LIBRARY}-link.so.${SO_MAJOR} ) + + ## Set install information +-install ( TARGETS ${CORE_RUNTIME_TARGET} LIBRARY DESTINATION hsa/lib ) +-install ( DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/inc/ DESTINATION hsa/include/hsa ) +-install ( FILES ${CMAKE_CURRENT_BINARY_DIR}/hsa_include_link DESTINATION include PERMISSIONS OWNER_WRITE OWNER_READ RENAME hsa ) +-install ( FILES ${CMAKE_CURRENT_BINARY_DIR}/${CORE_RUNTIME_LIBRARY}-link.so DESTINATION lib PERMISSIONS OWNER_WRITE OWNER_READ RENAME ${CORE_RUNTIME_LIBRARY}.so ) +-install ( FILES ${CMAKE_CURRENT_BINARY_DIR}/${CORE_RUNTIME_LIBRARY}-link.so.${SO_MAJOR} DESTINATION lib PERMISSIONS OWNER_WRITE OWNER_READ RENAME ${CORE_RUNTIME_LIBRARY}.so.${SO_MAJOR} ) ++install ( TARGETS ${CORE_RUNTIME_TARGET} LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} ) ++install ( DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/inc/ DESTINATION include/hsa ) + + ## Packaging directives + set ( CPACK_GENERATOR "DEB;RPM" CACHE STRING "Package types to build") diff --git a/srcpkgs/ROCR-Runtime/template b/srcpkgs/ROCR-Runtime/template new file mode 100644 index 00000000000..95b7e701afb --- /dev/null +++ b/srcpkgs/ROCR-Runtime/template @@ -0,0 +1,30 @@ +# Template file for 'ROCR-Runtime' +pkgname=ROCR-Runtime +version=3.3.0 +revision=1 +archs="x86_64*" +wrksrc="${pkgname}-rocm-${version}" +build_wrksrc="src" +build_style=cmake +hostmakedepends="cmake pkg-config" +makedepends="ROCT-Thunk-Interface-devel elfutils-devel" +short_desc="Radeon Open Compute HSA runtime" +maintainer="Andrew J. Hesford " +license="NCSA" +homepage="https://github.com/RadeonOpenCompute/ROCR-Runtime" +distfiles="${homepage}/archive/rocm-${version}.tar.gz" +checksum=fa2d2d1f8a61d8a6952d377cf288d78c61776c3c2a666f163cafc3aa19ab0b61 +nocross=yes + +post_install() { + vlicense ../LICENSE.txt +} + +ROCR-Runtime-devel_package() { + depends="${sourcepkg}>=${version}_${revision}" + short_desc+=" - development files" + pkg_install() { + vmove usr/include + vmove "usr/lib/*.so" + } +} diff --git a/srcpkgs/ROCR-Runtime/update b/srcpkgs/ROCR-Runtime/update new file mode 100644 index 00000000000..86197bc3eea --- /dev/null +++ b/srcpkgs/ROCR-Runtime/update @@ -0,0 +1 @@ +pattern='rocm-\K[\d.]+' From 0ee0f3f609c9c3743099173482d2c4a26a045b1f Mon Sep 17 00:00:00 2001 From: "Andrew J. Hesford" Date: Mon, 13 Apr 2020 18:07:34 -0400 Subject: [PATCH 3/9] New package: ROCm-llvm-3.3.0 --- srcpkgs/ROCm-llvm/template | 26 ++++++++++++++++++++++++++ srcpkgs/ROCm-llvm/update | 1 + 2 files changed, 27 insertions(+) create mode 100644 srcpkgs/ROCm-llvm/template create mode 100644 srcpkgs/ROCm-llvm/update diff --git a/srcpkgs/ROCm-llvm/template b/srcpkgs/ROCm-llvm/template new file mode 100644 index 00000000000..4c3095b21f4 --- /dev/null +++ b/srcpkgs/ROCm-llvm/template @@ -0,0 +1,26 @@ +# Template file for 'ROCm-llvm' +pkgname=ROCm-llvm +version=3.3.0 +revision=1 +archs="x86_64*" +wrksrc="llvm-project-rocm-ocl-${version}" +build_wrksrc=llvm +build_style=cmake +configure_args="-DCMAKE_INSTALL_PREFIX:PATH=/usr/lib/rocm-llvm + -DLLVM_ENABLE_PROJECTS='llvm;clang;lld' -DLLVM_TARGETS_TO_BUILD='AMDGPU' + -DLLVM_BUILD_DOCS=NO -DLLVM_ENABLE_OCAMLDOC=OFF + -DLLVM_ENABLE_SPHINX=NO -DLLVM_ENABLE_DOXYGEN=OFF + -DLLVM_INSTALL_UTILS=ON -DLLVM_VERSION_SUFFIX=roc -DOCAMLFIND=NO" +hostmakedepends="cmake pkg-config python3" +short_desc="Radeon Open Compute LLVM toolchain" +maintainer="Andrew J. Hesford " +license="Apache-2.0, NCSA, custom:LLVM-Exceptions" +homepage="https://github.com/RadeonOpenCompute/llvm-project" +distfiles="${homepage}/archive/rocm-ocl-${version}.tar.gz" +checksum=a2bef7042e8e2f2cd8548cb246b88322e1c77188839983dcac8312d56f544dc8 +python_version=3 +nocross=yes + +post_install() { + vlicense LICENSE.TXT +} diff --git a/srcpkgs/ROCm-llvm/update b/srcpkgs/ROCm-llvm/update new file mode 100644 index 00000000000..6a73667d3c1 --- /dev/null +++ b/srcpkgs/ROCm-llvm/update @@ -0,0 +1 @@ +pattern='rocm-ocl-\K[\d.]+' From 7d6f1904eed5b3c2a8eff961859916d886c4eefb Mon Sep 17 00:00:00 2001 From: "Andrew J. Hesford" Date: Tue, 14 Apr 2020 10:25:31 -0400 Subject: [PATCH 4/9] New package: ROCm-Device-Libs-3.3.0 --- srcpkgs/ROCm-Device-Libs/template | 37 +++++++++++++++++++++++++++++++ srcpkgs/ROCm-Device-Libs/update | 1 + 2 files changed, 38 insertions(+) create mode 100644 srcpkgs/ROCm-Device-Libs/template create mode 100644 srcpkgs/ROCm-Device-Libs/update diff --git a/srcpkgs/ROCm-Device-Libs/template b/srcpkgs/ROCm-Device-Libs/template new file mode 100644 index 00000000000..8086cd86450 --- /dev/null +++ b/srcpkgs/ROCm-Device-Libs/template @@ -0,0 +1,37 @@ +# Template file for 'ROCm-Device-Libs' +pkgname=ROCm-Device-Libs +version=3.3.0 +revision=1 +archs="x86_64*" +wrksrc="${pkgname}-rocm-ocl-${version}" +build_style=cmake +configure_args="-DLLVM_DIR:PATH=/usr/lib/rocm-llvm + -DCMAKE_INSTALL_LIBDIR:PATH=lib/rocm-device-libs" +hostmakedepends="cmake ROCm-llvm" +short_desc="Radeon Open Compute device libraries" +maintainer="Andrew J. Hesford " +license="NCSA" +homepage="https://github.com/RadeonOpenCompute/ROCm-Device-Libs" +distfiles="${homepage}/archive/rocm-ocl-${version}.tar.gz" +checksum=706b08230790e08ca6a7a2fb7687d6131fd39a562148340e00fa37a6c06769c5 +nocross=yes + +pre_configure() { + # Put bytecodes in a lib/ subdirectory + vsed -i Packages.cmake -e 's@/lib/@/${CMAKE_INSTALL_LIBDIR}/@' + vsed -i OCL.cmake -e 's@DESTINATION lib$@DESTINATION ${CMAKE_INSTALL_LIBDIR}@' + + # Build the prepare-builtins executable with native compiler + mkdir -p utils/build + cd utils/build + _prepare_builtins="$PWD/prepare-builtins/prepare-builtins" + cmake ${configure_args} .. + make ${makejobs} + + # Add path to prepare-builtins for cmake + configure_args+=" -DPREPARE_BUILTINS='${_prepare_builtins}'" +} + +post_install() { + vlicense LICENSE +} diff --git a/srcpkgs/ROCm-Device-Libs/update b/srcpkgs/ROCm-Device-Libs/update new file mode 100644 index 00000000000..6a73667d3c1 --- /dev/null +++ b/srcpkgs/ROCm-Device-Libs/update @@ -0,0 +1 @@ +pattern='rocm-ocl-\K[\d.]+' From bfdd38fd81a2c6a06c9a65c129cf11d937616f2e Mon Sep 17 00:00:00 2001 From: "Andrew J. Hesford" Date: Mon, 13 Apr 2020 18:30:00 -0400 Subject: [PATCH 5/9] New package: ROCm-CompilerSupport-3.3.0 --- common/shlibs | 1 + srcpkgs/ROCm-CompilerSupport-devel | 1 + srcpkgs/ROCm-CompilerSupport/template | 32 +++++++++++++++++++++++++++ srcpkgs/ROCm-CompilerSupport/update | 1 + 4 files changed, 35 insertions(+) create mode 120000 srcpkgs/ROCm-CompilerSupport-devel create mode 100644 srcpkgs/ROCm-CompilerSupport/template create mode 100644 srcpkgs/ROCm-CompilerSupport/update diff --git a/common/shlibs b/common/shlibs index 944ab37c190..393e464f683 100644 --- a/common/shlibs +++ b/common/shlibs @@ -3983,3 +3983,4 @@ libaml.so.0 aml-0.1.0_1 libneatvnc.so.0 neatvnc-0.2.0_1 libhsakmt.so.1 ROCT-Thunk-Interface-3.3.0_1 libhsa-runtime64.so.1 ROCR-Runtime-3.3.0_1 +libamd_comgr.so.1 ROCm-CompilerSupport-3.3.0_1 diff --git a/srcpkgs/ROCm-CompilerSupport-devel b/srcpkgs/ROCm-CompilerSupport-devel new file mode 120000 index 00000000000..877aeafeeae --- /dev/null +++ b/srcpkgs/ROCm-CompilerSupport-devel @@ -0,0 +1 @@ +ROCm-CompilerSupport \ No newline at end of file diff --git a/srcpkgs/ROCm-CompilerSupport/template b/srcpkgs/ROCm-CompilerSupport/template new file mode 100644 index 00000000000..df56f7a3837 --- /dev/null +++ b/srcpkgs/ROCm-CompilerSupport/template @@ -0,0 +1,32 @@ +# Template file for 'ROCm-CompilerSupport' +pkgname=ROCm-CompilerSupport +version=3.3.0 +revision=1 +archs="x86_64*" +wrksrc="${pkgname}-rocm-${version}" +build_wrksrc="lib/comgr" +build_style=cmake +configure_args="-DClang_DIR:PATH=/usr/lib/rocm-llvm/lib/cmake/clang" +hostmakedepends="cmake pkg-config ROCm-llvm" +makedepends="ROCm-Device-Libs" +short_desc="Radeon Open Compute compiler support" +maintainer="Andrew J. Hesford " +license="BSD-3-Clause" +homepage="https://github.com/RadeonOpenCompute/ROCm-CompilerSupport" +distfiles="${homepage}/archive/rocm-${version}.tar.gz" +checksum=01e2524e0f28ecd6f46c9720f279207de935d826b0172158792aa3ec86af9ca7 +nocross=yes + +post_install() { + vlicense LICENSE.txt +} + +ROCm-CompilerSupport-devel_package() { + depends="${sourcepkg}>=${version}_${revision}" + short_desc+=" - development files" + pkg_install() { + vmove usr/include + vmove "usr/lib/*.so" + vmove usr/lib/cmake + } +} diff --git a/srcpkgs/ROCm-CompilerSupport/update b/srcpkgs/ROCm-CompilerSupport/update new file mode 100644 index 00000000000..86197bc3eea --- /dev/null +++ b/srcpkgs/ROCm-CompilerSupport/update @@ -0,0 +1 @@ +pattern='rocm-\K[\d.]+' From 0d1c2fc7c9a0e8962f7d7dae390cb6c0f7a44fc5 Mon Sep 17 00:00:00 2001 From: "Andrew J. Hesford" Date: Fri, 17 Apr 2020 12:11:25 -0400 Subject: [PATCH 6/9] New package: rocminfo-3.3.0 --- srcpkgs/rocminfo/template | 22 ++++++++++++++++++++++ srcpkgs/rocminfo/update | 1 + 2 files changed, 23 insertions(+) create mode 100644 srcpkgs/rocminfo/template create mode 100644 srcpkgs/rocminfo/update diff --git a/srcpkgs/rocminfo/template b/srcpkgs/rocminfo/template new file mode 100644 index 00000000000..7a075c7f7ac --- /dev/null +++ b/srcpkgs/rocminfo/template @@ -0,0 +1,22 @@ +# Template file for 'rocminfo' +pkgname=rocminfo +version=3.3.0 +revision=1 +archs="x86_64*" +wrksrc="${pkgname}-rocm-${version}" +build_style=cmake +configure_args="-DROCM_DIR=/usr" +hostmakedepends="cmake pkg-config" +makedepends="ROCR-Runtime-devel" +short_desc="Radeon Open Compute system information reporter" +maintainer="Andrew J. Hesford " +license="NCSA" +homepage="https://github.com/RadeonOpenCompute/rocminfo" +distfiles="${homepage}/archive/rocm-${version}.tar.gz" +checksum=e666f662c9e465aaabbbd0b109d87e017243cdf1a0898fabf5a90947bb3dbcd7 +nocross=yes +python_version=3 + +post_install() { + vlicense License.txt +} diff --git a/srcpkgs/rocminfo/update b/srcpkgs/rocminfo/update new file mode 100644 index 00000000000..86197bc3eea --- /dev/null +++ b/srcpkgs/rocminfo/update @@ -0,0 +1 @@ +pattern='rocm-\K[\d.]+' From dd624a7ed799d5688b2caaddcef83bd3505d6097 Mon Sep 17 00:00:00 2001 From: "Andrew J. Hesford" Date: Sun, 19 Apr 2020 15:01:40 -0400 Subject: [PATCH 7/9] New package: rocm_bandwidth_test-3.3.0 --- srcpkgs/rocm_bandwidth_test/template | 20 ++++++++++++++++++++ srcpkgs/rocm_bandwidth_test/update | 1 + 2 files changed, 21 insertions(+) create mode 100644 srcpkgs/rocm_bandwidth_test/template create mode 100644 srcpkgs/rocm_bandwidth_test/update diff --git a/srcpkgs/rocm_bandwidth_test/template b/srcpkgs/rocm_bandwidth_test/template new file mode 100644 index 00000000000..6de7f2d6614 --- /dev/null +++ b/srcpkgs/rocm_bandwidth_test/template @@ -0,0 +1,20 @@ +# Template file for 'rocm_bandwidth_test' +pkgname=rocm_bandwidth_test +version=3.3.0 +revision=1 +archs="x86_64*" +wrksrc="${pkgname}-rocm-${version}" +build_style=cmake +hostmakedepends="cmake" +makedepends="ROCR-Runtime-devel ROCT-Thunk-Interface-devel" +short_desc="Radeon Open Compute bandwidth test" +maintainer="Andrew J. Hesford " +license="NCSA" +homepage="https://github.com/RadeonOpenCompute/rocm_bandwidth_test" +distfiles="${homepage}/archive/rocm-${version}.tar.gz" +checksum=f5f914073018619dc91662d5bf630903dfa4db9136d603591917fdfb3c9164ce +nocross=yes + +post_install() { + vlicense LICENSE.txt +} diff --git a/srcpkgs/rocm_bandwidth_test/update b/srcpkgs/rocm_bandwidth_test/update new file mode 100644 index 00000000000..86197bc3eea --- /dev/null +++ b/srcpkgs/rocm_bandwidth_test/update @@ -0,0 +1 @@ +pattern='rocm-\K[\d.]+' From c18eb5f651c6749d6fff87791f9f8511011c2ceb Mon Sep 17 00:00:00 2001 From: "Andrew J. Hesford" Date: Tue, 14 Apr 2020 10:25:54 -0400 Subject: [PATCH 8/9] New package: ROCm-OpenCL-Runtime-3.3.0 --- common/shlibs | 2 + srcpkgs/ROCm-OpenCL-Runtime-clinfo | 1 + srcpkgs/ROCm-OpenCL-Runtime-devel | 1 + .../files/libelf-musl.patch | 21 +++ .../files/runtime-musl.patch | 11 ++ .../ROCm-OpenCL-Runtime/patches/cmake.patch | 126 ++++++++++++++++++ srcpkgs/ROCm-OpenCL-Runtime/template | 84 ++++++++++++ srcpkgs/ROCm-OpenCL-Runtime/update | 1 + 8 files changed, 247 insertions(+) create mode 120000 srcpkgs/ROCm-OpenCL-Runtime-clinfo create mode 120000 srcpkgs/ROCm-OpenCL-Runtime-devel create mode 100644 srcpkgs/ROCm-OpenCL-Runtime/files/libelf-musl.patch create mode 100644 srcpkgs/ROCm-OpenCL-Runtime/files/runtime-musl.patch create mode 100644 srcpkgs/ROCm-OpenCL-Runtime/patches/cmake.patch create mode 100644 srcpkgs/ROCm-OpenCL-Runtime/template create mode 100644 srcpkgs/ROCm-OpenCL-Runtime/update diff --git a/common/shlibs b/common/shlibs index 393e464f683..28250aa3a3f 100644 --- a/common/shlibs +++ b/common/shlibs @@ -3984,3 +3984,5 @@ libneatvnc.so.0 neatvnc-0.2.0_1 libhsakmt.so.1 ROCT-Thunk-Interface-3.3.0_1 libhsa-runtime64.so.1 ROCR-Runtime-3.3.0_1 libamd_comgr.so.1 ROCm-CompilerSupport-3.3.0_1 +libOpenCL-ROCm.so.1 ROCm-OpenCL-Runtime-3.3.0_1 +libamdocl64.so ROCm-OpenCL-Runtime-3.3.0_1 diff --git a/srcpkgs/ROCm-OpenCL-Runtime-clinfo b/srcpkgs/ROCm-OpenCL-Runtime-clinfo new file mode 120000 index 00000000000..21f2041b8fb --- /dev/null +++ b/srcpkgs/ROCm-OpenCL-Runtime-clinfo @@ -0,0 +1 @@ +ROCm-OpenCL-Runtime \ No newline at end of file diff --git a/srcpkgs/ROCm-OpenCL-Runtime-devel b/srcpkgs/ROCm-OpenCL-Runtime-devel new file mode 120000 index 00000000000..21f2041b8fb --- /dev/null +++ b/srcpkgs/ROCm-OpenCL-Runtime-devel @@ -0,0 +1 @@ +ROCm-OpenCL-Runtime \ No newline at end of file diff --git a/srcpkgs/ROCm-OpenCL-Runtime/files/libelf-musl.patch b/srcpkgs/ROCm-OpenCL-Runtime/files/libelf-musl.patch new file mode 100644 index 00000000000..29469a9a351 --- /dev/null +++ b/srcpkgs/ROCm-OpenCL-Runtime/files/libelf-musl.patch @@ -0,0 +1,21 @@ +--- compiler/lib/loaders/elf/utils/libelf/_libelf.h 2020-04-28 15:50:53.243438174 -0400 ++++ compiler/lib/loaders/elf/utils/libelf/_libelf.h 2020-04-28 15:51:54.293435415 -0400 +@@ -35,6 +35,7 @@ + #include "_libelf_config.h" + + #include "_elftc.h" ++#include + + /* + * Library-private data structures. +--- compiler/lib/loaders/elf/utils/libelf/libelf.h 2020-04-28 15:50:53.244438174 -0400 ++++ compiler/lib/loaders/elf/utils/libelf/libelf.h 2020-04-28 15:52:12.375434593 -0400 +@@ -36,6 +36,8 @@ + #define EM_HSAIL 0xAF5A + #endif + ++#include ++ + /* Library private data structures */ + typedef struct _Elf Elf; + typedef struct _Elf_Scn Elf_Scn; diff --git a/srcpkgs/ROCm-OpenCL-Runtime/files/runtime-musl.patch b/srcpkgs/ROCm-OpenCL-Runtime/files/runtime-musl.patch new file mode 100644 index 00000000000..ea18e90e09c --- /dev/null +++ b/srcpkgs/ROCm-OpenCL-Runtime/files/runtime-musl.patch @@ -0,0 +1,11 @@ +--- runtime/os/os_posix.cpp.orig 2020-04-19 09:13:51.701982901 -0400 ++++ runtime/os/os_posix.cpp 2020-04-19 09:14:04.156947422 -0400 +@@ -44,6 +44,8 @@ + #include + #include + ++#include // for basename ++ + + namespace amd { + diff --git a/srcpkgs/ROCm-OpenCL-Runtime/patches/cmake.patch b/srcpkgs/ROCm-OpenCL-Runtime/patches/cmake.patch new file mode 100644 index 00000000000..2c96b99d45a --- /dev/null +++ b/srcpkgs/ROCm-OpenCL-Runtime/patches/cmake.patch @@ -0,0 +1,126 @@ +--- OpenCL-ICD-Loader-6c03f8b58fafd9dd693eaac826749a5cfad515f8/CMakeLists.txt 2019-09-10 11:53:28.000000000 -0400 ++++ OpenCL-ICD-Loader-6c03f8b58fafd9dd693eaac826749a5cfad515f8/CMakeLists.txt 2020-04-16 20:16:13.481180757 -0400 +@@ -73,11 +73,11 @@ + + set (OPENCL_ICD_LOADER_HEADERS_DIR ${CMAKE_CURRENT_SOURCE_DIR}/inc CACHE PATH "Path to OpenCL Headers") + +-add_library (OpenCL ${OPENCL_ICD_LOADER_SOURCES}) +-set_target_properties (OpenCL PROPERTIES VERSION "1.2" SOVERSION "1") ++add_library (OpenCL-ROCm ${OPENCL_ICD_LOADER_SOURCES}) ++set_target_properties (OpenCL-ROCm PROPERTIES VERSION "1.2" SOVERSION "1") + + if (WIN32) +- target_link_libraries (OpenCL cfgmgr32.lib) ++ target_link_libraries (OpenCL-ROCm cfgmgr32.lib) + + option (OPENCL_ICD_LOADER_REQUIRE_WDK "Build with D3DKMT support, which requires the Windows WDK." ON) + if (OPENCL_ICD_LOADER_REQUIRE_WDK) +@@ -92,10 +92,10 @@ + get_filename_component(WDK_DIRECTORY ${LATEST_D3DKMT_HEADER} DIRECTORY) + get_filename_component(WDK_DIRECTORY ${WDK_DIRECTORY} DIRECTORY) + message(STATUS "Found the Windows WDK in: ${WDK_DIRECTORY}") +- target_compile_definitions(OpenCL PRIVATE OPENCL_ICD_LOADER_REQUIRE_WDK) +- target_include_directories(OpenCL PRIVATE ${WDK_DIRECTORY}/um) +- target_include_directories(OpenCL PRIVATE ${WDK_DIRECTORY}/km) +- target_include_directories(OpenCL PRIVATE ${WDK_DIRECTORY}/shared) ++ target_compile_definitions(OpenCL-ROCm PRIVATE OPENCL_ICD_LOADER_REQUIRE_WDK) ++ target_include_directories(OpenCL-ROCm PRIVATE ${WDK_DIRECTORY}/um) ++ target_include_directories(OpenCL-ROCm PRIVATE ${WDK_DIRECTORY}/km) ++ target_include_directories(OpenCL-ROCm PRIVATE ${WDK_DIRECTORY}/shared) + else() + message(FATAL_ERROR "The Windows WDK was not found. Consider disabling OPENCL_ICD_LOADER_REQUIRE_WDK. Aborting.") + endif() +@@ -113,25 +113,25 @@ + endif() + else() + if (APPLE) +- target_link_libraries (OpenCL ${CMAKE_THREAD_LIBS_INIT}) ++ target_link_libraries (OpenCL-ROCm ${CMAKE_THREAD_LIBS_INIT}) + else () +- set_target_properties (OpenCL PROPERTIES LINK_FLAGS "-Wl,--version-script -Wl,${CMAKE_CURRENT_SOURCE_DIR}/loader/linux/icd_exports.map") +- target_link_libraries (OpenCL ${CMAKE_THREAD_LIBS_INIT}) ++ set_target_properties (OpenCL-ROCm PROPERTIES LINK_FLAGS "-Wl,--version-script -Wl,${CMAKE_CURRENT_SOURCE_DIR}/loader/linux/icd_exports.map") ++ target_link_libraries (OpenCL-ROCm ${CMAKE_THREAD_LIBS_INIT}) + endif () + endif () + + include_directories (${OPENCL_ICD_LOADER_HEADERS_DIR}) + add_definitions (-DCL_TARGET_OPENCL_VERSION=220) + +-target_include_directories (OpenCL PRIVATE ${CMAKE_CURRENT_BINARY_DIR} loader) +-target_link_libraries (OpenCL ${CMAKE_DL_LIBS}) ++target_include_directories (OpenCL-ROCm PRIVATE ${CMAKE_CURRENT_BINARY_DIR} loader) ++target_link_libraries (OpenCL-ROCm ${CMAKE_DL_LIBS}) + + include (CTest) + if (BUILD_TESTING) + add_subdirectory (test) + endif() + +-install (TARGETS OpenCL ++install (TARGETS OpenCL-ROCm + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} + ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}) +--- OpenCL-ICD-Loader-6c03f8b58fafd9dd693eaac826749a5cfad515f8/test/loader_test/CMakeLists.txt 2019-09-10 11:53:28.000000000 -0400 ++++ OpenCL-ICD-Loader-6c03f8b58fafd9dd693eaac826749a5cfad515f8/test/loader_test/CMakeLists.txt 2020-04-16 20:16:56.647026589 -0400 +@@ -12,4 +12,4 @@ + test_clgl.c + test_image_objects.c ) + +-target_link_libraries (icd_loader_test OpenCL IcdLog) ++target_link_libraries (icd_loader_test OpenCL-ROCm IcdLog) +--- ROCm-OpenCL-Runtime-roc-3.3.0/CMakeLists.txt 2020-04-28 07:29:51.864446603 -0400 ++++ ROCm-OpenCL-Runtime-roc-3.3.0/CMakeLists.txt 2020-04-28 07:32:45.245793180 -0400 +@@ -101,30 +101,30 @@ + rocm_setup_version( VERSION "2.0.0" ) + + # MAIN package +-install(PROGRAMS $ +- DESTINATION bin/x86_64 ++install(PROGRAMS $ ++ DESTINATION bin + COMPONENT MAIN) + install(PROGRAMS $ +- DESTINATION lib/x86_64 ++ DESTINATION lib + COMPONENT MAIN) +-install(PROGRAMS $ +- DESTINATION lib/x86_64 ++install(PROGRAMS $ ++ DESTINATION lib + COMPONENT MAIN) +-install(PROGRAMS $ +- DESTINATION lib/x86_64 ++install(PROGRAMS $ ++ DESTINATION lib + COMPONENT MAIN) + + # DEV package + install(DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/api/opencl/khronos/headers/opencl2.2/CL" +- DESTINATION include ++ DESTINATION include/rocm + COMPONENT DEV + USE_SOURCE_PERMISSIONS + PATTERN cl_d3d10.h EXCLUDE + PATTERN cl_d3d11.h EXCLUDE + PATTERN cl_dx9_media_sharing.h EXCLUDE + PATTERN cl_egl.h EXCLUDE) +-install(PROGRAMS $ +- DESTINATION lib/x86_64 ++install(PROGRAMS $ ++ DESTINATION lib + COMPONENT DEV) + + # Generic CPACK variables +--- ROCm-OpenCL-Runtime-roc-3.3.0/tools/clinfo/CMakeLists.txt 2020-04-28 07:29:51.882446535 -0400 ++++ ROCm-OpenCL-Runtime-roc-3.3.0/tools/clinfo/CMakeLists.txt 2020-04-28 07:30:05.627394732 -0400 +@@ -6,6 +6,6 @@ + + add_definitions(-DHAVE_CL2_HPP) + +-add_executable(clinfo clinfo.cpp) ++add_executable(rocm-clinfo clinfo.cpp) + +-target_link_libraries(clinfo OpenCL) ++target_link_libraries(rocm-clinfo OpenCL-ROCm) diff --git a/srcpkgs/ROCm-OpenCL-Runtime/template b/srcpkgs/ROCm-OpenCL-Runtime/template new file mode 100644 index 00000000000..f6699a1d4c0 --- /dev/null +++ b/srcpkgs/ROCm-OpenCL-Runtime/template @@ -0,0 +1,84 @@ +# Template file for 'ROCm-OpenCL-Runtime' +pkgname=ROCm-OpenCL-Runtime +version=3.3.0 +revision=1 +_ocl_icd_name="OpenCL-ICD-Loader" +_ocl_icd_ver="6c03f8b58fafd9dd693eaac826749a5cfad515f8" +archs="x86_64*" +create_wrksrc=yes +build_wrksrc="${pkgname}-roc-${version}" +build_style=cmake +configure_args="-DUSE_COMGR_LIBRARY=yes" +hostmakedepends="cmake pkg-config" +makedepends="libglvnd-devel ROCm-CompilerSupport-devel + ROCT-Thunk-Interface-devel ROCR-Runtime-devel" +depends="ROCm-CompilerSupport" +short_desc="Radeon Open Compute OpenCL runtime" +maintainer="Andrew J. Hesford " +license="MIT" +homepage="https://github.com/RadeonOpenCompute/ROCm-OpenCL-Runtime" +_rocroot="https://github.com/RadeonOpenCompute" +distfiles="${_rocroot}/ROCm-OpenCL-Runtime/archive/roc-${version}.tar.gz + ${_rocroot}/rocm-cmake/archive/rocm-${version}.tar.gz + https://github.com/KhronosGroup/${_ocl_icd_name}/archive/${_ocl_icd_ver}.tar.gz" +checksum="ac6999f1a491ab066286c2bd6adf50f08f831286f56e267879f9f7eced22f98e + 76ed3ee8e56cf3246011cf7723c2abda539e1136e7e7f6909bfa45d268b8644f + c94d5bb6dc980c4d41d73e2b81663a19aabe494e923e2d0eec72a4c95b318438" +nocross=yes + +if [ "$XBPS_LIBC" = "musl" ]; then + makedepends+=" musl-legacy-compat" +fi + +post_patch() { + if [ "$XBPS_LIBC" = "musl" ]; then + # Remove dependence on glibc + patch -Np0 < ${FILESDIR}/libelf-musl.patch + patch -Np0 < ${FILESDIR}/runtime-musl.patch + vsed -e '/glibc_functions.cpp/d' -i api/opencl/amdocl/CMakeLists.txt + fi +} + +pre_configure() { + # ROCm requires a very specific Khronos ICD loader version in the tree + # Keep the ICD loader config in /etc/OpenCL/rocm-vendors to avoid conflicts + _ocl_icd_dir="${_ocl_icd_name}-${_ocl_icd_ver}" + ln -sf "${wrksrc}/${_ocl_icd_dir}" api/opencl/khronos/icd + vsed -i "${wrksrc}/${_ocl_icd_dir}/loader/icd_platform.h" \ + -e 's@/etc/OpenCL/vendors/@/etc/OpenCL/rocm-vendors/@g' + + # CMake modules probably not useful anywhere but for this build + ln -sf "${wrksrc}/rocm-cmake-rocm-${version}/share/rocm/cmake"/*.cmake cmake + + # Fix the dlopen macro to point to versioned libamd_comgr shared object + vsed -i 'runtime/device/comgrctx.cpp' \ + -e 's/\blibamd_comgr\(32\)\?.so\b/&.1/g' +} + +post_install() { + vlicense License + + # Create descriptor to allow the ICD loader to find the driver + vmkdir etc/OpenCL/rocm-vendors + echo "libamdocl64.so" > "${DESTDIR}/etc/OpenCL/rocm-vendors/amdocl64.icd" + vmkdir etc/OpenCL/vendors + ln -s ../../OpenCL/rocm-vendors/amdocl64.icd \ + ${DESTDIR}/etc/OpenCL/vendors/rocm-amdocl64.icd +} + +ROCm-OpenCL-Runtime-devel_package() { + depends="${sourcepkg}>=${version}_${revision}" + short_desc+=" - development files" + pkg_install() { + vmove usr/lib/libOpenCL-ROCm.so + vmove usr/include + } +} + +ROCm-OpenCL-Runtime-clinfo_package() { + depends="${sourcepkg}>=${version}_${revision}" + short_desc+=" - clinfo" + pkg_install() { + vmove usr/bin/rocm-clinfo + } +} diff --git a/srcpkgs/ROCm-OpenCL-Runtime/update b/srcpkgs/ROCm-OpenCL-Runtime/update new file mode 100644 index 00000000000..8385f4d1215 --- /dev/null +++ b/srcpkgs/ROCm-OpenCL-Runtime/update @@ -0,0 +1 @@ +pattern='roc-\K[\d.]+' From 8fb59c86f69c5f43726fc0be4f813444a06fde38 Mon Sep 17 00:00:00 2001 From: "Andrew J. Hesford" Date: Thu, 30 Apr 2020 13:11:12 -0400 Subject: [PATCH 9/9] New package: ROCR-Runtime-hsa-ext-3.3.0 [ci skip] --- common/shlibs | 2 ++ srcpkgs/ROCR-Runtime-hsa-ext-devel | 1 + srcpkgs/ROCR-Runtime-hsa-ext/template | 43 +++++++++++++++++++++++++++ srcpkgs/ROCR-Runtime-hsa-ext/update | 2 ++ 4 files changed, 48 insertions(+) create mode 120000 srcpkgs/ROCR-Runtime-hsa-ext-devel create mode 100644 srcpkgs/ROCR-Runtime-hsa-ext/template create mode 100644 srcpkgs/ROCR-Runtime-hsa-ext/update diff --git a/common/shlibs b/common/shlibs index 28250aa3a3f..66392db5c99 100644 --- a/common/shlibs +++ b/common/shlibs @@ -3986,3 +3986,5 @@ libhsa-runtime64.so.1 ROCR-Runtime-3.3.0_1 libamd_comgr.so.1 ROCm-CompilerSupport-3.3.0_1 libOpenCL-ROCm.so.1 ROCm-OpenCL-Runtime-3.3.0_1 libamdocl64.so ROCm-OpenCL-Runtime-3.3.0_1 +libhsa-ext-image64.so.1 ROCR-Runtime-hsa-ext-3.3.0_1 +libhsa-runtime-tools64.so.1 ROCR-Runtime-hsa-ext-3.3.0_1 diff --git a/srcpkgs/ROCR-Runtime-hsa-ext-devel b/srcpkgs/ROCR-Runtime-hsa-ext-devel new file mode 120000 index 00000000000..6ee1b14911b --- /dev/null +++ b/srcpkgs/ROCR-Runtime-hsa-ext-devel @@ -0,0 +1 @@ +ROCR-Runtime-hsa-ext \ No newline at end of file diff --git a/srcpkgs/ROCR-Runtime-hsa-ext/template b/srcpkgs/ROCR-Runtime-hsa-ext/template new file mode 100644 index 00000000000..235ae92146b --- /dev/null +++ b/srcpkgs/ROCR-Runtime-hsa-ext/template @@ -0,0 +1,43 @@ +# Template file for 'ROCR-Runtime-hsa-ext' +pkgname=ROCR-Runtime-hsa-ext +version=3.3.0 +revision=1 +archs="x86_64" +hostmakedepends="tar" +short_desc="Radeon Open Compute HSA runtime extensions" +maintainer="Andrew J. Hesford " +license="NCSA" +homepage="https://github.com/RadeonOpenCompute" +_hsa_deb="hsa-ext-rocr-dev_1.1.30300.0-rocm-rel-3.3-19-23fc088b_amd64.deb" +distfiles="https://repo.radeon.com/rocm/apt/debian/pool/main/h/hsa-ext-rocr-dev/$_hsa_deb" +checksum=6b44e286b395d946b865ec1f3cc546356396785ac1fde591d07af02d0aa7c25d +repository=nonfree +restricted=yes + +do_extract() { + ar x "${XBPS_SRCDISTDIR}/${pkgname}-${version}/${_hsa_deb}" + tar xvf data.tar.gz +} + +do_install() { + _rocm_includes="opt/rocm-${version}/hsa/include" + + vmkdir usr + vcopy opt/rocm-${version}/hsa/lib usr + vcopy "$_rocm_includes" usr + + # Extract license from one of the header files + awk 'BEGIN{HEADER=0} /\/\//{HEADER=1; print $0;} /^[^/]/{if(HEADER==1) exit;}' \ + < "${_rocm_includes}/hsa/amd_hsa_tools_interfaces.h" \ + | sed 's@^///*\( \|$\)@@' > LICENSE + vlicense LICENSE +} + +ROCR-Runtime-hsa-ext-devel_package() { + depends="${sourcepkg}>=${version}_${revision}" + short_desc+=" - development files" + pkg_install() { + vmove usr/include + vmove "usr/lib/*.so" + } +} diff --git a/srcpkgs/ROCR-Runtime-hsa-ext/update b/srcpkgs/ROCR-Runtime-hsa-ext/update new file mode 100644 index 00000000000..84252d2e3b8 --- /dev/null +++ b/srcpkgs/ROCR-Runtime-hsa-ext/update @@ -0,0 +1,2 @@ +site='https://repo.radeon.com/rocm/apt/debian/pool/main/h/' +pattern='hsa-ext-rocr-dev\K[\d.]+'