Skip to content

Commit

Permalink
Void Linux support (formalizes lamikr#117)
Browse files Browse the repository at this point in the history
- Add the necessary dependencies
- Include necessary patches for systems where /bin/sh is not bash (including
  but not limited to Void Linux)
- Fix an incompatibility in hipBLASLt between Clang 17 and GCC 13
- Take latest version of ucc (latest release is compatible with ROCm 6.x)
- Remove building the "native" architecture from ucc -- this doesn't work in
  headless setups. The default list should be complete.

Signed-off-by: Jeroen Mostert <[email protected]>
  • Loading branch information
jeroen-mostert committed Aug 5, 2024
1 parent 836d401 commit 9233b3b
Show file tree
Hide file tree
Showing 22 changed files with 300 additions and 39 deletions.
4 changes: 2 additions & 2 deletions binfo/core/015_02_ucc_openmpi.binfo
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@ BINFO_APP_SRC_TOPDIR_BASENAME=${BINFO_APP_NAME}
BINFO_APP_SRC_DIR="${SDK_SRC_ROOT_DIR}/${BINFO_APP_SRC_TOPDIR_BASENAME}"
BINFO_APP_UPSTREAM_REPO_URL=https://github.com/openucx/ucc.git
# v.1.2.0 does not work with rocm 6.0, use snapshot from unreleased v1.3.x branch
BINFO_APP_UPSTREAM_REPO_VERSION_TAG=985947a521d7c00e6866f032b4db4c18e5bf9e6a
#BINFO_APP_UPSTREAM_REPO_VERSION_TAG=985947a521d7c00e6866f032b4db4c18e5bf9e6a

BINFO_APP_CONFIG_CMD_ARRAY=(
"cd ${BINFO_APP_SRC_DIR}"
"export HIPCC=${SDK_C_COMPILER_HIPCC}"
"./autogen.sh"
"cd ${BINFO_APP_BUILD_DIR}"
"${BINFO_APP_SRC_DIR}/configure --prefix=${INSTALL_DIR_PREFIX_SDK_ROOT} --libdir=${INSTALL_DIR_PREFIX_SDK_ROOT}/lib64 --with-ucx=${INSTALL_DIR_PREFIX_SDK_ROOT} --with-rocm=${INSTALL_DIR_PREFIX_SDK_ROOT} --with-rocm-arch=all"
"${BINFO_APP_SRC_DIR}/configure --prefix=${INSTALL_DIR_PREFIX_SDK_ROOT} --libdir=${INSTALL_DIR_PREFIX_SDK_ROOT}/lib64 --with-ucx=${INSTALL_DIR_PREFIX_SDK_ROOT} --with-rocm=${INSTALL_DIR_PREFIX_SDK_ROOT} --with-rocm-arch=all-arch-no-native"
)
4 changes: 4 additions & 0 deletions binfo/core/020_01_amd_fftw_single_precision.binfo
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ BINFO_APP_SRC_DIR="${SDK_SRC_ROOT_DIR}/${BINFO_APP_SRC_TOPDIR_BASENAME}"
BINFO_APP_UPSTREAM_REPO_URL=https://github.com/amd/amd-fftw.git
BINFO_APP_UPSTREAM_REPO_VERSION_TAG=4.2

BINFO_APP_PRE_CONFIG_CMD_ARRAY=(
"autoreconf ${BINFO_APP_SRC_DIR}"
)

BINFO_APP_CONFIG_CMD_ARRAY=(
"cd ${BINFO_APP_BUILD_DIR}"
"export CFLAGS=\"${CFLAGS} -O3\""
Expand Down
4 changes: 4 additions & 0 deletions binfo/core/020_02_amd_fftw_double_precision.binfo
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ BINFO_APP_SRC_DIR="${SDK_SRC_ROOT_DIR}/${BINFO_APP_SRC_TOPDIR_BASENAME}"
BINFO_APP_UPSTREAM_REPO_URL=https://github.com/amd/amd-fftw.git
BINFO_APP_UPSTREAM_REPO_VERSION_TAG=4.2

BINFO_APP_PRE_CONFIG_CMD_ARRAY=(
"autoreconf ${BINFO_APP_SRC_DIR}"
)

BINFO_APP_CONFIG_CMD_ARRAY=(
"cd ${BINFO_APP_BUILD_DIR}"
"export CFLAGS=\"${CFLAGS} -O3\""
Expand Down
4 changes: 4 additions & 0 deletions binfo/core/020_03_amd_fftw_long_double_precision.binfo
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ BINFO_APP_SRC_DIR="${SDK_SRC_ROOT_DIR}/${BINFO_APP_SRC_TOPDIR_BASENAME}"
BINFO_APP_UPSTREAM_REPO_URL=https://github.com/amd/amd-fftw.git
BINFO_APP_UPSTREAM_REPO_VERSION_TAG=4.2

BINFO_APP_PRE_CONFIG_CMD_ARRAY=(
"autoreconf ${BINFO_APP_SRC_DIR}"
)

BINFO_APP_CONFIG_CMD_ARRAY=(
"cd ${BINFO_APP_BUILD_DIR}"
"export CFLAGS=\"${CFLAGS} -O3\""
Expand Down
4 changes: 4 additions & 0 deletions binfo/core/020_04_amd_fftw_quad_precision.binfo
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ BINFO_APP_SRC_DIR="${SDK_SRC_ROOT_DIR}/${BINFO_APP_SRC_TOPDIR_BASENAME}"
BINFO_APP_UPSTREAM_REPO_URL=https://github.com/amd/amd-fftw.git
BINFO_APP_UPSTREAM_REPO_VERSION_TAG=4.2

BINFO_APP_PRE_CONFIG_CMD_ARRAY=(
"autoreconf ${BINFO_APP_SRC_DIR}"
)

BINFO_APP_CONFIG_CMD_ARRAY=(
"cd ${BINFO_APP_BUILD_DIR}"
"export CFLAGS=\"${CFLAGS} -O3\""
Expand Down
11 changes: 8 additions & 3 deletions install_deps.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,13 @@ func_is_supported_distro()
fi

case "${ID}" in
mageia|fedora|ubuntu|linuxmint|arch|manjaro)
mageia|fedora|ubuntu|linuxmint|arch|manjaro|void)
echo "Supported Linux distribution detected: ${ID}"
true
;;
*)
echo "Unsupported Linux distribution detected: ${ID} $VERSION_ID"
printf "This script is currently supported on Mageia, Fedora, Ubuntu, Linux Mint, Arch and Manjaro\n"
printf "This script is currently supported on Mageia, Fedora, Ubuntu, Linux Mint, Arch, Manjaro and Void\n"
exit 2
;;
esac
Expand Down Expand Up @@ -62,9 +62,14 @@ func_install_packages()
sudo pacman -S --needed gcc-libs make pkgconf numactl cmake doxygen libelf perl-rename perl-uri perl-file-basedir perl-file-copy-recursive perl-file-listing wget gcc gcc-fortran gcc-libs fakeroot openmp pciutils libdrm vim glew autoconf automake libtool bzip2 xz icu perl libmpack python-pip openssl python-pyopenssl libffi nlohmann-json texinfo extra-cmake-modules sqlite git git-lfs valgrind flex byacc gettext ninja texlive-basic ocl-icd protobuf pybind11 libaio gmp mpfr libpng libjpeg-turbo python-cppheaderparser msgpack-c msgpack-cxx sox ncurses expat babeltrace systemd
git-lfs install
;;
void)
sudo xbps-install -S git-lfs base-devel gcc-fortran cmake doxygen babeltrace-devel bzip2-devel elfutils-devel expat-devel ffmpeg ffmpeg-devel gdb gdbm-devel gmp-devel icu icu-devel json-c++ lcov libaio-devel libdrm-devel libffi-devel libglvnd-devel libgomp-devel libjpeg-turbo-devel liblzma liblzma-devel libnuma-devel libpng-devel libuuid-devel mpfr-devel msgpack-cxx ncurses-devel ninja openssl-devel protobuf protobuf-devel python3-pip python3-pybind11 readline readline-devel sox sqlite sqlite-devel xxd zlib-devel
python3 -m pip install --break-syste-packages CppHeaderParser
git-lfs install
;;
*)
echo "Unsupported Linux distribution detected: ${ID} $VERSION_ID"
echo "This script is currently supported on Mageia, Fedora, Ubuntu, Linux Mint, Arch and Manjaro"
echo "This script is currently supported on Mageia, Fedora, Ubuntu, Linux Mint, Arch, Manjaro and Void"
exit 2
;;
esac
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
From 7d168fcd8b3d015fb9d06876e2d43e8cc38f8efe Mon Sep 17 00:00:00 2001
From 7ecfa0d7b81db3a3fee571f1791c41977c8ee27c Mon Sep 17 00:00:00 2001
From: Mika Laitio <[email protected]>
Date: Wed, 29 May 2024 15:16:57 -0700
Subject: [PATCH] fix parameter type for openmpi 5.0.1
Subject: [PATCH 1/2] fix parameter type for openmpi 5.0.1
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

rocm_sdk_builder_611
detected on fedora 40/gcc build that
at least OpenMPI 5.0.1 request that last
Expand Down Expand Up @@ -67,5 +68,5 @@ index 41b588c7..298ab644 100644
#ifdef AMD_MPI_TRANSPOSE_LOGS
printf("TRANSPOSE-PAIRWISE: n_pes[%d], my_pe[%d], first_pe[%d]\n", n_pes, my_pe, pe);
--
2.45.1
2.46.0

Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
From bbd4a16e3e4d69f8f67ce1deca0dbcc4f163ae43 Mon Sep 17 00:00:00 2001
From: Jeroen Mostert <[email protected]>
Date: Sun, 4 Aug 2024 14:39:52 +0000
Subject: [PATCH 2/2] Change here-string bashism to POSIX echo

Fixes builds on systems where /bin/sh is not bash

Signed-off-by: Jeroen Mostert <[email protected]>
---
configure.ac | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/configure.ac b/configure.ac
index 24aaf4fc..af2390ac 100644
--- a/configure.ac
+++ b/configure.ac
@@ -653,7 +653,7 @@ if test "$have_amd_opt" = yes && test "${enable_debug+set}" != "set" && test "$I
AC_DEFINE(AMD_DYNAMIC_DISPATCHER,1,[Define to enable AMD dynamic dispatcher feature that would build a single portable optimized library which can execute on different x86 CPU architectures.])

SUBSTRGCC='gcc'
- if grep -q "$SUBSTRGCC" <<<"$CC"; then
+ if echo "$CC" | grep -q "$SUBSTRGCC"; then
CFLAGS="$CFLAGS -mno-avx256-split-unaligned-store -mno-avx256-split-unaligned-load -mno-prefer-avx128"
else
AC_MSG_CHECKING([whether we are using clang 14 or later])
@@ -683,13 +683,13 @@ if test "$have_amd_opt" = yes && test "${enable_debug+set}" != "set" && test "$I
fi
SUBSTRCLANG='clang'
SUBSTRGCC='gcc'
- if grep -q "$SUBSTRCLANG" <<<"$CC"; then
+ if echo "$CC" | grep -q "$SUBSTRCLANG"; then
if [[ -z "${AMD_ARCH}" ]]; then
CFLAGS="$CFLAGS -mavx2 -mfma"
else
CFLAGS="$CFLAGS -march=$AMD_ARCH -mavx2 -mfma"
fi
- elif grep -q "$SUBSTRGCC" <<<"$CC"; then
+ elif echo "$CC" | grep -q "$SUBSTRGCC"; then
GCCVERSION=$(expr `gcc -dumpversion | cut -f1 -d.`)
case "$AMDZENFAMILY" in
"23")
--
2.46.0

Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
From e5daa8fa4cf061e18c4b6bfb27c318f0d79bf594 Mon Sep 17 00:00:00 2001
From 9d38e990b83222db8db05430e321486c62d65706 Mon Sep 17 00:00:00 2001
From: Mika Laitio <[email protected]>
Date: Fri, 3 May 2024 13:16:31 -0700
Subject: [PATCH 1/7] tensilelite llvm path changes
Subject: [PATCH 1/8] tensilelite llvm path changes

Signed-off-by: Mika Laitio <[email protected]>
---
Expand Down Expand Up @@ -49,5 +49,5 @@ index 230c4469..81a1a015 100644
. ${venv}/bin/activate

--
2.45.2
2.46.0

Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
From 490d18000263e3e4849ed78ab4ac7975529a86a7 Mon Sep 17 00:00:00 2001
From 6d58158733869a2cff8cf685325492c61d468db0 Mon Sep 17 00:00:00 2001
From: Mika Laitio <[email protected]>
Date: Wed, 15 May 2024 19:20:44 -0700
Subject: [PATCH 2/7] add more gpus for default target list
Subject: [PATCH 2/8] add more gpus for default target list

Signed-off-by: Mika Laitio <[email protected]>
---
Expand All @@ -26,5 +26,5 @@ index fec03c1b..c6a16e01 100644

if (AMDGPU_TARGETS)
--
2.45.2
2.46.0

Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
From 61b76b1bbdaeac7f08ef13200ffcd4b3fce8f5a6 Mon Sep 17 00:00:00 2001
From ad469395b8c4423a153dd10d3ff283f7612f8f12 Mon Sep 17 00:00:00 2001
From: Mika Laitio <[email protected]>
Date: Wed, 15 May 2024 19:30:31 -0700
Subject: [PATCH 3/7] Tensilelite fix fallback arch build
Subject: [PATCH 3/8] Tensilelite fix fallback arch build

fixes build error which happens for example
if the only gpu selected is gfx1010 / AMD RX 5700 XT.
Expand Down Expand Up @@ -62,5 +62,5 @@ index 8a37403d..d2ac2166 100644
for arch in archs:
if arch in architectureMap:
--
2.45.2
2.46.0

Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
From a687a8343961e0a3c732101b44e0071150f38d51 Mon Sep 17 00:00:00 2001
From 2ede1afa4de3e563f921e808e6e13084df376716 Mon Sep 17 00:00:00 2001
From: Mika Laitio <[email protected]>
Date: Wed, 15 May 2024 20:56:51 -0700
Subject: [PATCH 4/7] Tensilelite add gfx1035, 1036 and 1103 to supported isa
Subject: [PATCH 4/8] Tensilelite add gfx1035, 1036 and 1103 to supported isa
list

Signed-off-by: Mika Laitio <[email protected]>
Expand All @@ -10,7 +10,7 @@ Signed-off-by: Mika Laitio <[email protected]>
1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/tensilelite/Tensile/Common.py b/tensilelite/Tensile/Common.py
index c47a8752..3630ee41 100644
index c47a8752..860a16c4 100644
--- a/tensilelite/Tensile/Common.py
+++ b/tensilelite/Tensile/Common.py
@@ -209,7 +209,7 @@ globalParameters["MergeFiles"] = True # F=store every solution and k
Expand All @@ -34,5 +34,5 @@ index c47a8752..3630ee41 100644

def getArchitectureName(gfxName):
--
2.45.2
2.46.0

Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
From 6b32bb226ef045db90c86f955fb3836d3f01ca98 Mon Sep 17 00:00:00 2001
From ff692eca2e973a0bf6c7e0b88ad3ff2913a98127 Mon Sep 17 00:00:00 2001
From: Mika Laitio <[email protected]>
Date: Sat, 18 May 2024 18:39:43 -0700
Subject: [PATCH 5/7] fallback support debug patch
Subject: [PATCH 5/8] fallback support debug patch

Signed-off-by: Mika Laitio <[email protected]>
---
Expand All @@ -23,5 +23,5 @@ index d2ac2166..ce6c0d5f 100644
if globalParameters["LazyLibraryLoading"] and not (globalParameters["MergeFiles"] and globalParameters["SeparateArchitectures"]):
printExit("--lazy-library-loading requires --merge-files and --separate-architectures enabled")
--
2.45.2
2.46.0

Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
From 992e946dddb9e1714da704bd1277b291496f5f69 Mon Sep 17 00:00:00 2001
From dc79cfb78dde7f846fd078cf01bfc5c077fab359 Mon Sep 17 00:00:00 2001
From: Mika Laitio <[email protected]>
Date: Sat, 18 May 2024 18:40:43 -0700
Subject: [PATCH 6/7] OpenBLAS and BLIS library search improvements
Subject: [PATCH 6/8] OpenBLAS and BLIS library search improvements

- works now with the rocm_sdks build
by rocm sdk builder
Expand Down Expand Up @@ -156,5 +156,5 @@ index bc9109d0..53b854e6 100644
message("BLIS lib found: ${BLIS_LIB}")

--
2.45.2
2.46.0

Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
From f320e89bad147c2b9e6cb6fd00261d5bfd0526be Mon Sep 17 00:00:00 2001
From e8866ad0e8a3000ceebb382aa427f704e2a8b89d Mon Sep 17 00:00:00 2001
From: Daniele <[email protected]>
Date: Tue, 18 Jun 2024 21:46:30 -0700
Subject: [PATCH 7/7] manjaro and arch linux msgpack search fix
Subject: [PATCH 7/8] manjaro and arch linux msgpack search fix

Fix provided by @daniandtheweb and
@jeroen-mostert
Expand All @@ -28,5 +28,5 @@ index 43206527..e9476b3d 100644

if(TARGET msgpackc-cxx)
--
2.45.2
2.46.0

44 changes: 44 additions & 0 deletions patches/rocm-6.1.2/hipBLASLt/0008-Set-standard-to-C-17.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
From 76361246f1330cc1fb1b7fd0af4e3834d7563618 Mon Sep 17 00:00:00 2001
From: Jeroen Mostert <[email protected]>
Date: Sun, 4 Aug 2024 17:07:19 +0000
Subject: [PATCH 8/8] Set standard to C++17

The combination of Clang 17 with the STL of GCC 13 doesn't work with
-std=c++20 (at the very least not on Void Linux). Nothing actually
uses C++20 features, so use the same flags as main Tensile.

Signed-off-by: Jeroen Mostert <[email protected]>
---
CMakeLists.txt | 2 +-
tensilelite/Tensile/Source/lib/CMakeLists.txt | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index c6a16e01..31547bf7 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -25,7 +25,7 @@
cmake_minimum_required(VERSION 3.5 FATAL_ERROR)

# This will add compile option: -std=c++17
-set(CMAKE_CXX_STANDARD 20 )
+set(CMAKE_CXX_STANDARD 17 )
# Without this line, it will add -std=gnu++17 instead, which may have issues.
set(CMAKE_CXX_EXTENSIONS OFF )
set(CMAKE_CXX_STANDARD_REQUIRED ON)
diff --git a/tensilelite/Tensile/Source/lib/CMakeLists.txt b/tensilelite/Tensile/Source/lib/CMakeLists.txt
index e9476b3d..72425d07 100644
--- a/tensilelite/Tensile/Source/lib/CMakeLists.txt
+++ b/tensilelite/Tensile/Source/lib/CMakeLists.txt
@@ -91,7 +91,7 @@ add_library (TensileHost STATIC ${tensile_sources})

set_target_properties(TensileHost
PROPERTIES
- CXX_STANDARD 20
+ CXX_STANDARD 17
CXX_STANDARD_REQUIRED ON
CXX_EXTENSIONS OFF)

--
2.46.0

Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
From c527de182821bb98f0dec3c983217a10b634aeac Mon Sep 17 00:00:00 2001
From cea15e4988d70d2e9b973951031f2fab9ef3145b Mon Sep 17 00:00:00 2001
From: Mika Laitio <[email protected]>
Date: Wed, 24 Jan 2024 14:53:02 -0800
Subject: [PATCH 1/2] disable prrte docs generation
Subject: [PATCH 1/3] disable prrte docs generation

Disable prrte doc building to avoid follwing error
if python sphinx is not installed available:
Expand Down Expand Up @@ -51,5 +51,5 @@ index a623100..f98c89e 100644
util \
$(MCA_prte_FRAMEWORKS_SUBDIRS) \
--
2.41.1
2.46.0

Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
From f20a12071640dae9bf7b301167ffc9112bd83667 Mon Sep 17 00:00:00 2001
From ffd5927a6b57c5910b00b6c532cad131ffe3c291 Mon Sep 17 00:00:00 2001
From: Mika Laitio <[email protected]>
Date: Wed, 29 May 2024 14:15:28 -0700
Subject: [PATCH 2/2] added construct_event_strings.py thats missing tar.gz
Subject: [PATCH 2/3] added construct_event_strings.py thats missing tar.gz

patching of git submodules does not work well
yet with the rcom sdk builder, therefore openmpi
Expand Down Expand Up @@ -269,5 +269,5 @@ index 0000000..52f242f
+if __name__ == '__main__':
+ exit(main())
--
2.41.1
2.46.0

Loading

0 comments on commit 9233b3b

Please sign in to comment.