Github messages for voidlinux
 help / color / mirror / Atom feed
* [PR PATCH] Rocm llvm19
@ 2025-01-02 23:56 Calandracas606
  2025-01-03  0:02 ` [PR PATCH] [Updated] Rocm Calandracas606
                   ` (8 more replies)
  0 siblings, 9 replies; 10+ messages in thread
From: Calandracas606 @ 2025-01-02 23:56 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 1453 bytes --]

There is a new pull request by Calandracas606 against master on the void-packages repository

https://github.com/Calandracas606/void-packages rocm-llvm19
https://github.com/void-linux/void-packages/pull/53819

Rocm llvm19
<!-- Uncomment relevant sections and delete options which are not applicable -->

#### Testing the changes
- I tested the changes in this PR: **briefly**


#### New package
- This new package conforms to the [package requirements](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#package-requirements): **YES**


<!-- Note: If the build is likely to take more than 2 hours, please add ci skip tag as described in
https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration
and test at least one native build and, if supported, at least one cross build.
Ignore this section if this PR is not skipping CI.
-->

#### Local build testing
- I built this PR locally for my native architecture, x86_64-glibc
- I built this PR locally for these architectures (if supported. mark crossbuilds):
  - x86_64-musl

It would be nice to be able to install to /usr instead of /usr/lib/rocm, but would probably require quite a bit more patching. The software really seems to expect that its installed in a self-contained directory, and has lots of "hardcoded" relative paths.


A patch file from https://github.com/void-linux/void-packages/pull/53819.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-rocm-llvm19-53819.patch --]
[-- Type: text/x-diff, Size: 37522 bytes --]

From 52b7600626b1e74404528361d83245b6df4e1006 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Sun, 15 Dec 2024 12:23:08 -0500
Subject: [PATCH 1/9] ROCm-SMI: update to 6.3.0.

---
 srcpkgs/ROCm-SMI/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/ROCm-SMI/template b/srcpkgs/ROCm-SMI/template
index dd6149863c36f1..1a75e628016da9 100644
--- a/srcpkgs/ROCm-SMI/template
+++ b/srcpkgs/ROCm-SMI/template
@@ -1,6 +1,6 @@
 # Template file for 'ROCm-SMI'
 pkgname=ROCm-SMI
-version=6.2.2
+version=6.3.0
 revision=1
 build_style=cmake
 short_desc="ROCm System Management Interface"
@@ -9,7 +9,7 @@ license="NCSA"
 homepage="https://github.com/ROCm/rocm_smi_lib"
 changelog="https://raw.githubusercontent.com/ROCm/rocm_smi_lib/rocm-${version}/CHANGELOG.md"
 distfiles="https://github.com/ROCm/rocm_smi_lib/archive/refs/tags/rocm-${version}.tar.gz"
-checksum=c0701ef131dcd591ef2d4d2f1719af59cbed35bc3eccd3ce9523f55293fa1a37
+checksum=573cfb759f8c7700fdcb0c28d045aed0f2d950692bb66a10bd589b89b8f48d0f
 
 ROCm-SMI-devel_package() {
 	short_desc+=" - development files"

From bccdb1dff98a6ca0da178cf0429f8f74b0f67ceb Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Tue, 30 Apr 2024 22:26:22 -0400
Subject: [PATCH 2/9] New package: ROCm-cmake-6.3.0

---
 srcpkgs/ROCm-cmake/template | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)
 create mode 100644 srcpkgs/ROCm-cmake/template

diff --git a/srcpkgs/ROCm-cmake/template b/srcpkgs/ROCm-cmake/template
new file mode 100644
index 00000000000000..4be6c9e6aa5c53
--- /dev/null
+++ b/srcpkgs/ROCm-cmake/template
@@ -0,0 +1,18 @@
+# Template file for 'ROCm-cmake'
+pkgname=ROCm-cmake
+version=6.3.0
+revision=1
+build_style=cmake
+_rocm_prefix=/usr/lib/rocm
+configure_args=" -DCMAKE_INSTALL_PREFIX=${_rocm_prefix} "
+short_desc="Cmake modules for ROCm"
+maintainer="Daniel Martinez <danielmartinez@cock.li>"
+license="MIT"
+homepage="https://github.com/ROCm/rocm-cmake"
+changelog="https://raw.githubusercontent.com/ROCm/rocm-cmake/refs/heads/develop/CHANGELOG.md"
+distfiles="https://github.com/ROCm/rocm-cmake/archive/refs/tags/rocm-${version}.tar.gz"
+checksum=45a1b96f85ae28a7f62895ddc4d6648500b883af250f52f6417bafb31b3cc75d
+
+post_install() {
+	vlicense LICENSE
+}

From db8c0002b69cf3c0f741b74f6ba590d840c63083 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Tue, 30 Apr 2024 22:37:17 -0400
Subject: [PATCH 3/9] New package: ROCt-Thunk-Interface-6.2.0

---
 common/shlibs                         |  1 +
 srcpkgs/ROCt-Thunk-Interface-devel    |  1 +
 srcpkgs/ROCt-Thunk-Interface/template | 28 +++++++++++++++++++++++++++
 3 files changed, 30 insertions(+)
 create mode 120000 srcpkgs/ROCt-Thunk-Interface-devel
 create mode 100644 srcpkgs/ROCt-Thunk-Interface/template

diff --git a/common/shlibs b/common/shlibs
index befb37d1b1e5ad..6d764af67c636b 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -4543,3 +4543,4 @@ libflashrom.so.1 flashrom-1.4.0_1
 libpyside6.so.6.7 libpyside6-6.7.2_1
 libpyside6qml.so.6.7 libpyside6-6.7.2_1
 libshiboken6.so.6.7 libshiboken6-6.7.2_1
+libhsakmt.so.1 ROCt-Thunk-Interface-6.2.0_1
diff --git a/srcpkgs/ROCt-Thunk-Interface-devel b/srcpkgs/ROCt-Thunk-Interface-devel
new file mode 120000
index 00000000000000..1773cfdde8226c
--- /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/template b/srcpkgs/ROCt-Thunk-Interface/template
new file mode 100644
index 00000000000000..5e5ca079045bcf
--- /dev/null
+++ b/srcpkgs/ROCt-Thunk-Interface/template
@@ -0,0 +1,28 @@
+# Template file for 'ROCt-Thunk-Interface'
+pkgname=ROCt-Thunk-Interface
+version=6.2.0
+revision=1
+build_style=cmake
+configure_args="-DBUILD_SHARED_LIBS=ON"
+hostmakedepends="pkg-config ROCm-cmake"
+makedepends="libnuma-devel libdrm-devel"
+short_desc="ROCm's Thunk Interfaces"
+maintainer="Daniel Martinez <danielmartinez@cock.li>"
+license="MIT"
+homepage="https://github.com/ROCm/ROCT-Thunk-Interface"
+distfiles="https://github.com/ROCm/ROCT-Thunk-Interface/archive/refs/tags/rocm-${version}.tar.gz"
+checksum=73df98ca2be8a887cb76554c23f148ef6556bdbccfac99f34111fa1f87fd7c5d
+
+post_install() {
+	vlicense LICENSE.md
+}
+
+ROCt-Thunk-Interface-devel_package() {
+	depends="${sourcepkg}>=${version}_${revision}"
+	short_desc+=" - development files"
+	pkg_install() {
+		vmove usr/lib/cmake
+		vmove usr/include
+		vmove usr/lib/pkgconfig
+	}
+}

From 4406e0032b8cf9053417c957347fe8597c6df2cb Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 May 2024 08:09:10 -0400
Subject: [PATCH 4/9] New package: ROCr-Runtime-6.3.0

---
 common/shlibs                           |   1 +
 srcpkgs/ROCr-Runtime-devel              |   1 +
 srcpkgs/ROCr-Runtime/patches/musl.patch | 290 ++++++++++++++++++++++++
 srcpkgs/ROCr-Runtime/template           |  44 ++++
 4 files changed, 336 insertions(+)
 create mode 120000 srcpkgs/ROCr-Runtime-devel
 create mode 100644 srcpkgs/ROCr-Runtime/patches/musl.patch
 create mode 100644 srcpkgs/ROCr-Runtime/template

diff --git a/common/shlibs b/common/shlibs
index 6d764af67c636b..1abcd35675f5a8 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -4544,3 +4544,4 @@ libpyside6.so.6.7 libpyside6-6.7.2_1
 libpyside6qml.so.6.7 libpyside6-6.7.2_1
 libshiboken6.so.6.7 libshiboken6-6.7.2_1
 libhsakmt.so.1 ROCt-Thunk-Interface-6.2.0_1
+libhsa-runtime64.so.1 ROCr-Runtime-6.3.0_1
diff --git a/srcpkgs/ROCr-Runtime-devel b/srcpkgs/ROCr-Runtime-devel
new file mode 120000
index 00000000000000..440584e3ef6555
--- /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/musl.patch b/srcpkgs/ROCr-Runtime/patches/musl.patch
new file mode 100644
index 00000000000000..31ecbc48e43183
--- /dev/null
+++ b/srcpkgs/ROCr-Runtime/patches/musl.patch
@@ -0,0 +1,290 @@
+From 8d4ea25572bf615ef05b17e2038a4b6cf3e7353e Mon Sep 17 00:00:00 2001
+From: "Sv. Lockal" <lockalsash@gmail.com>
+Date: Sun, 15 Dec 2024 17:50:23 +0000
+Subject: [PATCH 1/3] Fix build issues for musl libc
+
+This fixes few issues, which allow to build and pass kfdtest on musl-based systems:
+
+1) result of https://github.com/ROCm/ROCR-Runtime/commit/daad183bf8a3e1153a652b9e8fda06306b7c94ef#diff-681b7d40f71f20573413d5072e1c381fde6c02aed03a56307afcbe82cf3f5e5eR36-R37f - `extern int hsakmt_page_shift` is under `ifndef`, while it should not
+```
+/var/tmp/portage/dev-libs/roct-thunk-interface-6.3.0/work/ROCR-Runtime-rocm-6.3.0/libhsakmt/src/openclose.c: In function 'init_page_size':
+/var/tmp/portage/dev-libs/roct-thunk-interface-6.3.0/work/ROCR-Runtime-rocm-6.3.0/libhsakmt/src/openclose.c:117:9: error: 'hsakmt_page_size' undeclared (first use in this function); did you mean 'hsakmt_page_shift'?
+  117 |         hsakmt_page_size = sysconf(_SC_PAGESIZE);
+      |         ^~~~~~~~~~~~~~~~
+      |         hsakmt_page_shift
+```
+
+2) warning of `PAGE_SIZE` macro redefinition (defined previously in `limits.h`)
+
+3) no operator to compare 0 with std::nullptr_t (null is defined as nullptr_t, following https://eel.is/c++draft/support.types.nullptr)
+```
+In file included from /var/tmp/portage/dev-libs/roct-thunk-interface-6.3.0/work/ROCR-Runtime-rocm-6.3.0/libhsakmt/tests/kfdtest/src/KFDTestUtil.hpp:27,
+                 from /var/tmp/portage/dev-libs/roct-thunk-interface-6.3.0/work/ROCR-Runtime-rocm-6.3.0/libhsakmt/tests/kfdtest/src/BaseQueue.hpp:28,
+                 from /var/tmp/portage/dev-libs/roct-thunk-interface-6.3.0/work/ROCR-Runtime-rocm-6.3.0/libhsakmt/tests/kfdtest/src/SDMAQueue.hpp:27,
+                 from /var/tmp/portage/dev-libs/roct-thunk-interface-6.3.0/work/ROCR-Runtime-rocm-6.3.0/libhsakmt/tests/kfdtest/src/KFDTestUtilQueue.cpp:28:
+/var/tmp/portage/dev-libs/roct-thunk-interface-6.3.0/work/ROCR-Runtime-rocm-6.3.0/libhsakmt/tests/kfdtest/gtest-1.6.0/gtest/gtest.h: In instantiation of 'testing::AssertionResult testing::internal::CmpHelperNE(const char*, const char*, const T1&, const T2&) [with T1 = long unsigned int; T2 = std::nullptr_t]':
+/var/tmp/portage/dev-libs/roct-thunk-interface-6.3.0/work/ROCR-Runtime-rocm-6.3.0/libhsakmt/tests/kfdtest/src/KFDTestUtilQueue.cpp:60:29:   required from here
+19072 |   GTEST_ASSERT_(pred_format(#v1, #v2, v1, v2),\
+      |                            ^
+/var/tmp/portage/dev-libs/roct-thunk-interface-6.3.0/work/ROCR-Runtime-rocm-6.3.0/libhsakmt/tests/kfdtest/gtest-1.6.0/gtest/gtest.h:18573:28: error: invalid operands of types 'const long unsigned int' and 'std::nullptr_t' to binary 'operator!='
+18573 | GTEST_IMPL_CMP_HELPER_(NE, !=);
+      |                            ^
+/var/tmp/portage/dev-libs/roct-thunk-interface-6.3.0/work/ROCR-Runtime-rocm-6.3.0/libhsakmt/tests/kfdtest/gtest-1.6.0/gtest/gtest.h:18558:12: note: in definition of macro 'GTEST_IMPL_CMP_HELPER_'
+18558 |   if (val1 op val2) {\
+      |            ^~
+```
+
+Closes: https://github.com/ROCm/ROCR-Runtime/issues/267
+Signed-off-by: Sv. Lockal <lockalsash@gmail.com>
+---
+ libhsakmt/src/libhsakmt.h                        | 5 +++--
+ libhsakmt/tests/kfdtest/src/KFDTestUtilQueue.cpp | 6 +++---
+ libhsakmt/tests/kfdtest/src/OSWrapper.hpp        | 4 ++--
+ 3 files changed, 8 insertions(+), 7 deletions(-)
+
+diff --git a/libhsakmt/src/libhsakmt.h b/libhsakmt/src/libhsakmt.h
+index 63ef17d9..70a9eed4 100644
+--- a/libhsakmt/src/libhsakmt.h
++++ b/libhsakmt/src/libhsakmt.h
+@@ -64,14 +64,15 @@ extern HsaVersionInfo hsakmt_kfd_version_info;
+ 	do { if ((minor) > hsakmt_kfd_version_info.KernelInterfaceMinorVersion)\
+ 		return HSAKMT_STATUS_NOT_SUPPORTED; } while (0)
+ 
++extern int hsakmt_page_size;
++extern int hsakmt_page_shift;
++
+ /* Might be defined in limits.h on platforms where it is constant (used by musl) */
+ /* See also: https://pubs.opengroup.org/onlinepubs/7908799/xsh/limits.h.html */
+ #ifndef PAGE_SIZE
+-extern int hsakmt_page_size;
+ #define PAGE_SIZE hsakmt_page_size
+ #endif
+ #ifndef PAGE_SHIFT
+-extern int hsakmt_page_shift;
+ #define PAGE_SHIFT hsakmt_page_shift
+ #endif
+ 
+diff --git a/libhsakmt/tests/kfdtest/src/KFDTestUtilQueue.cpp b/libhsakmt/tests/kfdtest/src/KFDTestUtilQueue.cpp
+index 8f9b857a..47f66e8e 100644
+--- a/libhsakmt/tests/kfdtest/src/KFDTestUtilQueue.cpp
++++ b/libhsakmt/tests/kfdtest/src/KFDTestUtilQueue.cpp
+@@ -57,13 +57,13 @@ class AsyncMPSQ {
+         void PlacePacketOnNode(PacketList &packetList, int node, TSPattern tsp);
+ 
+         /* Run the packets placed on nodes and return immediately.*/
+-        void Submit(void) { ASSERT_NE((HSAuint64)m_queue, NULL); m_queue->SubmitPacket(); }
++        void Submit(void) { ASSERT_NE(m_queue, NULL); m_queue->SubmitPacket(); }
+ 
+         /* Return only when all packets are consumed.
+          * If there is any packet issues some IO operations, wait these IO to complete too.
+          */
+         void Wait(void) {
+-            ASSERT_NE((HSAuint64)m_queue, NULL);
++            ASSERT_NE(m_queue, NULL);
+             m_queue->Wait4PacketConsumption(m_event, std::max((unsigned int)6000, g_TestTimeOut));
+         }
+ 
+@@ -244,7 +244,7 @@ HSAuint64 AsyncMPSQ::Report(int indexOfPacket, HSAuint64 &begin, HSAuint64 &end)
+     if (m_ts_pattern == HEAD_TAIL)
+         indexOfPacket = 0;
+ 
+-    EXPECT_NE((HSAuint64)m_ts, NULL)
++    EXPECT_NE(m_ts, NULL)
+         << " Error " << ++error << ": No timestamp buf!" << std::endl;
+     /* m_ts_count is equal to packets count + 1, see PlacePacketOnNode().
+      * So the max index of a packet is m_ts_count - 2.
+diff --git a/libhsakmt/tests/kfdtest/src/OSWrapper.hpp b/libhsakmt/tests/kfdtest/src/OSWrapper.hpp
+index 6c3b24f1..ce4bfecb 100644
+--- a/libhsakmt/tests/kfdtest/src/OSWrapper.hpp
++++ b/libhsakmt/tests/kfdtest/src/OSWrapper.hpp
+@@ -23,6 +23,8 @@
+ 
+ #include <stdlib.h>
+ #include <stdint.h>
++#include <limits.h>
++#include <sys/user.h>
+ #include <string>
+ 
+ #include "KFDTestFlags.hpp"
+@@ -33,10 +35,8 @@
+ 
+ #ifndef PAGE_SIZE
+ #define PAGE_SIZE   (1<<12)
+-#define PAGE_SHIFT  (12)
+ #endif
+ #ifndef PAGE_SHIFT
+-#define PAGE_SIZE   (1<<12)
+ #define PAGE_SHIFT  (12)
+ #endif
+ 
+-- 
+2.47.1
+
+
+From 3e0dc82144316eb38f1bf68cb540d240121e2a53 Mon Sep 17 00:00:00 2001
+From: "Sv. Lockal" <lockalsash@gmail.com>
+Date: Sun, 15 Dec 2024 21:29:13 +0000
+Subject: [PATCH 2/3] Fix musl compilation for hsa-runtime
+
+This commit applies a similar change, that was reverted in 1cee8656df62e13f83dc2dfda4f13ad5be2e8747, with major issues fixed.
+
+1) reverted commit checked if `pthread_attr_setaffinity_np` symbol exists, but this check did not work (and effectively disabled better path), because this symbol requires `#define _GNU_SOURCE` (see https://man7.org/linux/man-pages/man3/pthread_attr_setaffinity_np.3.html)
+
+2) non-reverted part implied that `pthread_rwlockattr_setkind` function replaces `pthread_rwlockattr_setkind_np`, which is incorrect. This function is non-portable, serves as a hint and has no alternatives.
+
+Signed-off-by: Sv. Lockal <lockalsash@gmail.com>
+---
+ runtime/hsa-ext-finalize/CMakeLists.txt       | 12 +++++++++++
+ runtime/hsa-runtime/CMakeLists.txt            | 12 +++++++++++
+ .../hsa-runtime/core/util/lnx/os_linux.cpp    | 21 ++++++++++++-------
+ 3 files changed, 38 insertions(+), 7 deletions(-)
+
+diff --git a/runtime/hsa-ext-finalize/CMakeLists.txt b/runtime/hsa-ext-finalize/CMakeLists.txt
+index 6c6dbdcb..f18b0991 100755
+--- a/runtime/hsa-ext-finalize/CMakeLists.txt
++++ b/runtime/hsa-ext-finalize/CMakeLists.txt
+@@ -101,6 +101,18 @@ if( NOT DEFINED OPEN_SOURCE_DIR )
+   set ( OPEN_SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/.." )
+ endif()
+ 
++## Check for _GNU_SOURCE pthread extensions
++set(CMAKE_REQUIRED_DEFINITIONS -D_GNU_SOURCE)
++CHECK_SYMBOL_EXISTS ( "pthread_attr_setaffinity_np" "pthread.h" HAVE_PTHREAD_ATTR_SETAFFINITY_NP )
++CHECK_SYMBOL_EXISTS ( "pthread_rwlockattr_setkind_np" "pthread.h" HAVE_PTHREAD_RWLOCKATTR_SETKIND_NP )
++unset(CMAKE_REQUIRED_DEFINITIONS)
++if ( HAVE_PTHREAD_ATTR_SETAFFINITY_NP )
++  target_compile_definitions(${CORE_RUNTIME_TARGET} PRIVATE HAVE_PTHREAD_ATTR_SETAFFINITY_NP )
++endif()
++if ( HAVE_PTHREAD_RWLOCKATTR_SETKIND_NP )
++  target_compile_definitions(${CORE_RUNTIME_TARGET} PRIVATE HAVE_PTHREAD_RWLOCKATTR_SETKIND_NP )
++endif()
++
+ ## ------------------------- Linux Compiler and Linker options -------------------------
+ set ( CMAKE_CXX_FLAGS "-std=c++11 " )
+ 
+diff --git a/runtime/hsa-runtime/CMakeLists.txt b/runtime/hsa-runtime/CMakeLists.txt
+index fbbcaf03..03a36a50 100644
+--- a/runtime/hsa-runtime/CMakeLists.txt
++++ b/runtime/hsa-runtime/CMakeLists.txt
+@@ -109,6 +109,18 @@ if ( HAVE_MEMFD_CREATE )
+   target_compile_definitions(${CORE_RUNTIME_TARGET} PRIVATE HAVE_MEMFD_CREATE )
+ endif()
+ 
++## Check for _GNU_SOURCE pthread extensions
++set(CMAKE_REQUIRED_DEFINITIONS -D_GNU_SOURCE)
++CHECK_SYMBOL_EXISTS ( "pthread_attr_setaffinity_np" "pthread.h" HAVE_PTHREAD_ATTR_SETAFFINITY_NP )
++CHECK_SYMBOL_EXISTS ( "pthread_rwlockattr_setkind_np" "pthread.h" HAVE_PTHREAD_RWLOCKATTR_SETKIND_NP )
++unset(CMAKE_REQUIRED_DEFINITIONS)
++if ( HAVE_PTHREAD_ATTR_SETAFFINITY_NP )
++  target_compile_definitions(${CORE_RUNTIME_TARGET} PRIVATE HAVE_PTHREAD_ATTR_SETAFFINITY_NP )
++endif()
++if ( HAVE_PTHREAD_RWLOCKATTR_SETKIND_NP )
++  target_compile_definitions(${CORE_RUNTIME_TARGET} PRIVATE HAVE_PTHREAD_RWLOCKATTR_SETKIND_NP )
++endif()
++
+ ## Set include directories for ROCr runtime
+ target_include_directories( ${CORE_RUNTIME_TARGET}
+   PUBLIC
+diff --git a/runtime/hsa-runtime/core/util/lnx/os_linux.cpp b/runtime/hsa-runtime/core/util/lnx/os_linux.cpp
+index 84021f15..eba037ab 100644
+--- a/runtime/hsa-runtime/core/util/lnx/os_linux.cpp
++++ b/runtime/hsa-runtime/core/util/lnx/os_linux.cpp
+@@ -137,12 +137,14 @@ class os_thread {
+       for (int i = 0; i < cores; i++) {
+         CPU_SET_S(i, CPU_ALLOC_SIZE(cores), cpuset);
+       }
++#ifdef HAVE_PTHREAD_ATTR_SETAFFINITY_NP
+       err = pthread_attr_setaffinity_np(&attrib, CPU_ALLOC_SIZE(cores), cpuset);
+       CPU_FREE(cpuset);
+       if (err != 0) {
+         fprintf(stderr, "pthread_setaffinity_np failed: %s\n", strerror(err));
+         return;
+       }
++#endif
+     }
+ 
+     do {
+@@ -166,6 +168,17 @@ class os_thread {
+     } while (stackSize < 20 * 1024 * 1024);
+ 
+     args.release();
++#ifndef HAVE_PTHREAD_ATTR_SETAFFINITY_NP
++    if (cores && cpuset) {
++      err = pthread_setaffinity_np(thread, CPU_ALLOC_SIZE(cores), cpuset);
++      CPU_FREE(cpuset);
++      if (err != 0) {
++        fprintf(stderr, "pthread_setaffinity_np failed: %s\n", strerror(err));
++        thread = 0;
++        return;
++      }
++    }
++#endif
+   }
+ 
+   os_thread(os_thread&& rhs) {
+@@ -655,18 +668,12 @@ SharedMutex CreateSharedMutex() {
+     return nullptr;
+   }
+ 
+-#ifdef __GLIBC__
++#ifdef HAVE_PTHREAD_RWLOCKATTR_SETKIND_NP
+   err = pthread_rwlockattr_setkind_np(&attrib, PTHREAD_RWLOCK_PREFER_WRITER_NONRECURSIVE_NP);
+   if (err != 0) {
+     fprintf(stderr, "Set rw lock attribute failure: %s\n", strerror(err));
+     return nullptr;
+   }
+-#else
+-  err = pthread_rwlockattr_setkind(&attrib, PTHREAD_RWLOCK_PREFER_WRITER_NONRECURSIVE_NP);
+-  if (err != 0) {
+-    fprintf(stderr, "Set rw lock attribute failure: %s\n", strerror(err));
+-    return nullptr;
+-  }
+ #endif
+ 
+   pthread_rwlock_t* lock = new pthread_rwlock_t;
+-- 
+2.47.1
+
+
+From 0ac899eca61b2cb2c22eb722fdd941e6cec155a1 Mon Sep 17 00:00:00 2001
+From: "Sv. Lockal" <lockalsash@gmail.com>
+Date: Sun, 15 Dec 2024 22:05:43 +0000
+Subject: [PATCH 3/3] Fix comparisons of pointers with nulls
+
+The macro NULL sometimes is defined as 0, sometimes as nullptr_t-typed value (following [support.types.nullptr]), so to compare with pointers without warnings nullptr should be used
+---
+ libhsakmt/tests/kfdtest/src/KFDTestUtilQueue.cpp | 6 +++---
+ 1 file changed, 3 insertions(+), 3 deletions(-)
+
+diff --git a/libhsakmt/tests/kfdtest/src/KFDTestUtilQueue.cpp b/libhsakmt/tests/kfdtest/src/KFDTestUtilQueue.cpp
+index 47f66e8e..aa709f3a 100644
+--- a/libhsakmt/tests/kfdtest/src/KFDTestUtilQueue.cpp
++++ b/libhsakmt/tests/kfdtest/src/KFDTestUtilQueue.cpp
+@@ -57,13 +57,13 @@ class AsyncMPSQ {
+         void PlacePacketOnNode(PacketList &packetList, int node, TSPattern tsp);
+ 
+         /* Run the packets placed on nodes and return immediately.*/
+-        void Submit(void) { ASSERT_NE(m_queue, NULL); m_queue->SubmitPacket(); }
++        void Submit(void) { ASSERT_NE(m_queue, nullptr); m_queue->SubmitPacket(); }
+ 
+         /* Return only when all packets are consumed.
+          * If there is any packet issues some IO operations, wait these IO to complete too.
+          */
+         void Wait(void) {
+-            ASSERT_NE(m_queue, NULL);
++            ASSERT_NE(m_queue, nullptr);
+             m_queue->Wait4PacketConsumption(m_event, std::max((unsigned int)6000, g_TestTimeOut));
+         }
+ 
+@@ -244,7 +244,7 @@ HSAuint64 AsyncMPSQ::Report(int indexOfPacket, HSAuint64 &begin, HSAuint64 &end)
+     if (m_ts_pattern == HEAD_TAIL)
+         indexOfPacket = 0;
+ 
+-    EXPECT_NE(m_ts, NULL)
++    EXPECT_NE(m_ts, nullptr)
+         << " Error " << ++error << ": No timestamp buf!" << std::endl;
+     /* m_ts_count is equal to packets count + 1, see PlacePacketOnNode().
+      * So the max index of a packet is m_ts_count - 2.
+-- 
+2.47.1
+
diff --git a/srcpkgs/ROCr-Runtime/template b/srcpkgs/ROCr-Runtime/template
new file mode 100644
index 00000000000000..639addee1df3ca
--- /dev/null
+++ b/srcpkgs/ROCr-Runtime/template
@@ -0,0 +1,44 @@
+# Template file for 'ROCr-Runtime'
+pkgname=ROCr-Runtime
+version=6.3.0
+revision=1
+build_style=cmake
+_rocm_prefix="usr/lib/rocm"
+configure_args="
+ -DCMAKE_PREFIX_PATH=${XBPS_CROSS_BASE}/${_rocm_prefix};${XBPS_CROSS_BASE}/${_rocm_prefix}/lib/llvm
+ -DBUILD_SHARED_LIBS=ON "
+hostmakedepends="ROCm-cmake pkg-config llvm-amd-devel xxd"
+makedepends="llvm-amd-devel ROCm-Device-Libs ROCt-Thunk-Interface-devel
+libnuma-devel elfutils-devel libdrm-devel libffi-devel libxml2-devel ncurses-libtinfo-devel libedit-devel"
+short_desc="HSA Runtime API and runtime for ROCm"
+maintainer="Daniel Martinez <danielmartinez@cock.li>"
+license="NCSA"
+homepage="https://github.com/ROCm/ROCR-Runtime"
+distfiles="https://github.com/ROCm/ROCR-Runtime/archive/refs/tags/rocm-${version}.tar.gz"
+checksum=8fd6bcd6a5afd0ae5a59e33b786a525f575183d38c34049c2dab6b9270a1ca3b
+
+#if [ $XBPS_TARGET_LIBC == "musl" ]; then
+#	broken="TODO: requires pthread_np extensions not available on musl"
+#fi
+
+post_install() {
+	# files copied from ROCt-Thunk-Interface-devel
+	rm ${DESTDIR}/usr/include/hsakmt/hsakmt.h
+	rm ${DESTDIR}/usr/include/hsakmt/hsakmttypes.h
+	rm ${DESTDIR}/usr/lib/cmake/hsakmt/hsakmt-config-version.cmake
+	rm ${DESTDIR}/usr/lib/cmake/hsakmt/hsakmt-config.cmake
+	rm ${DESTDIR}/usr/lib/cmake/hsakmt/hsakmtTargets-none.cmake
+	rm ${DESTDIR}/usr/lib/cmake/hsakmt/hsakmtTargets.cmake
+	rm ${DESTDIR}/usr/lib/pkgconfig/libhsakmt.pc
+}
+
+ROCr-Runtime-devel_package() {
+	depends="${sourcepkg}>=${version}_${revision}"
+	short_desc+=" - development files"
+	pkg_install() {
+		vmove usr/lib/cmake
+		vmove usr/include
+		vmove usr/lib/pkgconfig
+		vmove "usr/lib/*.a"
+	}
+}

From e4157c7903630df672f92ccc63497cba94191f6e Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Sat, 14 Dec 2024 22:24:43 -0500
Subject: [PATCH 5/9] New package: rocminfo-6.3.0

---
 srcpkgs/rocminfo/template | 25 +++++++++++++++++++++++++
 1 file changed, 25 insertions(+)
 create mode 100644 srcpkgs/rocminfo/template

diff --git a/srcpkgs/rocminfo/template b/srcpkgs/rocminfo/template
new file mode 100644
index 00000000000000..cd9e7e6fb74a25
--- /dev/null
+++ b/srcpkgs/rocminfo/template
@@ -0,0 +1,25 @@
+# Template file for 'rocminfo'
+pkgname=rocminfo
+version=6.3.0
+revision=1
+_rocm_prefix=usr/lib/rocm
+build_style=cmake
+configure_args=" -DROCRTST_BLD_TYPE=Release
+ -DCMAKE_INSTALL_PREFIX=/${_rocm_prefix}
+ -DCMAKE_PREFIX_PATH=${XBPS_CROSS_BASE}/${_rocm_prefix}"
+makedepends="ROCm-cmake ROCr-Runtime-devel"
+short_desc="ROCm Application for Reporting System Info"
+maintainer="Daniel Martinez <danielmartinez@cock.li>"
+license="NCSA"
+homepage="https://github.com/ROCm/rocminfo"
+distfiles="https://github.com/ROCm/rocminfo/archive/refs/tags/rocm-${version}.tar.gz"
+checksum=40e2ef89e135770196022761cb929af93c80c41869082b3ef80e42b7772267d0
+
+post_install() {
+	vlicense License.txt
+	vmkdir "usr/bin"
+	for _f in ${DESTDIR}/${_rocm_prefix}/bin/*; do
+		local _base=$(basename "${_f}")
+		ln -s "../lib/rocm/bin/${_base}" "${DESTDIR}/usr/bin"
+	done
+}

From f70431a29c97432ac1497f77602e44f6a95198d2 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Sat, 14 Dec 2024 22:28:46 -0500
Subject: [PATCH 6/9] New package: llvm-amd-6.3.0

---
 common/shlibs             |   1 +
 srcpkgs/ROCm-Device-Libs  |   1 +
 srcpkgs/comgr             |   1 +
 srcpkgs/hipcc             |   1 +
 srcpkgs/llvm-amd-devel    |   1 +
 srcpkgs/llvm-amd/template | 153 ++++++++++++++++++++++++++++++++++++++
 6 files changed, 158 insertions(+)
 create mode 120000 srcpkgs/ROCm-Device-Libs
 create mode 120000 srcpkgs/comgr
 create mode 120000 srcpkgs/hipcc
 create mode 120000 srcpkgs/llvm-amd-devel
 create mode 100644 srcpkgs/llvm-amd/template

diff --git a/common/shlibs b/common/shlibs
index 1abcd35675f5a8..fe27f62d49c858 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -4545,3 +4545,4 @@ libpyside6qml.so.6.7 libpyside6-6.7.2_1
 libshiboken6.so.6.7 libshiboken6-6.7.2_1
 libhsakmt.so.1 ROCt-Thunk-Interface-6.2.0_1
 libhsa-runtime64.so.1 ROCr-Runtime-6.3.0_1
+libamd_comgr.so.2 comgr-6.3.0_1
diff --git a/srcpkgs/ROCm-Device-Libs b/srcpkgs/ROCm-Device-Libs
new file mode 120000
index 00000000000000..419bb5dddf5859
--- /dev/null
+++ b/srcpkgs/ROCm-Device-Libs
@@ -0,0 +1 @@
+llvm-amd
\ No newline at end of file
diff --git a/srcpkgs/comgr b/srcpkgs/comgr
new file mode 120000
index 00000000000000..419bb5dddf5859
--- /dev/null
+++ b/srcpkgs/comgr
@@ -0,0 +1 @@
+llvm-amd
\ No newline at end of file
diff --git a/srcpkgs/hipcc b/srcpkgs/hipcc
new file mode 120000
index 00000000000000..419bb5dddf5859
--- /dev/null
+++ b/srcpkgs/hipcc
@@ -0,0 +1 @@
+llvm-amd
\ No newline at end of file
diff --git a/srcpkgs/llvm-amd-devel b/srcpkgs/llvm-amd-devel
new file mode 120000
index 00000000000000..419bb5dddf5859
--- /dev/null
+++ b/srcpkgs/llvm-amd-devel
@@ -0,0 +1 @@
+llvm-amd
\ No newline at end of file
diff --git a/srcpkgs/llvm-amd/template b/srcpkgs/llvm-amd/template
new file mode 100644
index 00000000000000..5690d7f1206534
--- /dev/null
+++ b/srcpkgs/llvm-amd/template
@@ -0,0 +1,153 @@
+# Template file for 'llvm-amd'
+pkgname=llvm-amd
+version=6.3.0
+revision=1
+_rocm_prefix=usr/lib/rocm
+_llvm_root="${XBPS_BUILDDIR}/${pkgname}-${version}"
+_device_libs="${_llvm_root}/amd/device-libs"
+_comgr="${_llvm_root}/amd/comgr"
+_hipcc="${_llvm_root}/amd/hipcc"
+build_wrksrc=llvm
+build_style=cmake
+configure_args=" -DCMAKE_BUILD_TYPE=Release
+ -DCMAKE_PREFIX_PATH=${XBPS_CROSS_BASE}/${_rocm_prefix}
+ -DCMAKE_INSTALL_PREFIX=/${_rocm_prefix}/lib/llvm
+ -DLLVM_ENABLE_PROJECTS=llvm;clang;lld
+ -DLLVM_ENABLE_BINDINGS=OFF
+ -DLLVM_INCLUDE_BENCHMARKS=OFF
+ -DLLVM_BUILD_LLVM_DYLIB=OFF
+ -DLLVM_LINK_LLVM_DYLIB=OFF
+ -DCLANG_LINK_CLANG_DYLIB=OFF
+ -DLIBCLANG_BUILD_STATIC=ON
+ -DENABLE_SHARED=OFF
+ -DBUILD_TESTING=OFF
+"
+hostmakedepends="pkg-config git python3 ROCm-cmake"
+makedepends="libffi-devel ncurses-libtinfo-devel zlib-devel libxml2-devel libzstd-devel libedit-devel"
+short_desc="LLVM Project for ROCm"
+maintainer="Daniel Martinez <danielmartinez@cock.li>"
+license="Apache-2.0 AND NCSA AND MIT AND custom:Apache-2.0-with-llvm-exception"
+homepage="https://github.com/RadeonOpenCompute/llvm-project"
+distfiles="https://github.com/ROCm/llvm-project/archive/refs/tags/rocm-${version}.tar.gz"
+checksum=79580508b039ca6c50dfdfd7c4f6fbcf489fe1931037ca51324818851eea0c1c
+python_version=3
+nocross="Fixable, but a PITA. aarch64 devices with AMDGPU are not widely available"
+
+if [ ${XBPS_TARGET_WORDSIZE} != 64 ]; then
+	broken="error: token \"=\" is not valid in preprocessor expressions"
+fi
+
+
+pre_configure() {
+	case "$XBPS_TARGET_MACHINE" in
+		i686*) _arch="X86";;
+		x86_64*) _arch="X86";;
+		armv5*) _arch="Armv5te";;
+		armv6*) _arch="Armv6";;
+		armv7*) _arch="Armv7";;
+		aarch64*) _arch="AArch64";;
+		mips*) _arch="Mips";;
+		ppc*) _arch="PowerPC";;
+		riscv64*) _arch="RISCV64";;
+	esac
+
+	local _triplet=${XBPS_CROSS_TRIPLET:-$XBPS_TRIPLET}
+
+	configure_args+=" -DLLVM_TARGET_ARCH=${_arch}"
+	configure_args+=" -DLLVM_HOST_TRIPLE=${_triplet}"
+	configure_args+=" -DLLVM_DEFAULT_TARGET_TRIPLE=${_triplet}"
+	echo $configure_args
+}
+
+post_build() {
+
+	local _prefix_path="${XBPS_CROSS_BASE}/${_rocm_prefix};${_llvm_root}/llvm/build"
+
+	mkdir "${_device_libs}/build"
+	cd "${_device_libs}/build"
+
+	cmake -DCMAKE_BUILD_TYPE=Release \
+		-DCMAKE_INSTALL_PREFIX="/${_rocm_prefix}" \
+		-DCMAKE_PREFIX_PATH="${_prefix_path}" \
+		-G Ninja \
+		..
+
+	ninja ${makejobs}
+
+	_prefix_path+=";${_device_libs}/build"
+	mkdir "${_comgr}/build"
+	cd "${_comgr}/build"
+
+	cmake -DCMAKE_BUILD_TYPE=Release \
+		-DCMAKE_INSTALL_PREFIX="/${_rocm_prefix}" \
+		-DCMAKE_PREFIX_PATH="${_prefix_path}" \
+		-DBUILD_TESTING=OFF \
+		-G Ninja \
+		..
+
+	ninja ${makejobs}
+
+	_prefix_path+=";${_comgr}/build"
+	mkdir "${_hipcc}/build"
+	cd "${_hipcc}/build"
+
+	cmake -DCMAKE_BUILD_TYPE=Release \
+		-DCMAKE_INSTALL_PREFIX="/${_rocm_prefix}" \
+		-DCMAKE_PREFIX_PATH="${_prefix_path}" \
+		-G Ninja \
+		..
+
+	ninja ${makejobs}
+}
+
+post_install() {
+	ln -s lib/llvm $DESTDIR/${_rocm_prefix}/
+	vlicense LICENSE.TXT
+}
+
+llvm-amd-devel_package() {
+	depends="${sourcepkg}>=${version}_${revision}"
+	short_desc+=" - development files"
+	pkg_install() {
+		vmove ${_rocm_prefix}/lib/llvm/lib/cmake
+		vmove ${_rocm_prefix}/lib/llvm/include
+		vmove "${_rocm_prefix}/lib/llvm/lib/*.a"
+		vmove "${_rocm_prefix}/lib/llvm/lib/*.so"
+	}
+}
+
+comgr_package() {
+	short_desc="ROCm Code Object Manager"
+	pkg_install() {
+		cd "${_comgr}/build"
+		DESTDIR=${PKGDESTDIR} ninja install
+
+		for _f in ${PKGDESTDIR}/${_rocm_prefix}/lib64/lib*; do
+			local _base=$(basename "${_f}")
+			ln -s "rocm/lib64/${_base}" "${PKGDESTDIR}/usr/lib"
+		done
+	}
+}
+
+hipcc_package() {
+	depends="${sourcepkg}>=${version}_${revision}"
+	short_desc="ROCm HIP Compiler Driver"
+	pkg_install() {
+		cd "${_hipcc}/build"
+		DESTDIR=${PKGDESTDIR} ninja install
+		vmkdir "usr/bin"
+		for _f in ${PKGDESTDIR}/${_rocm_prefix}/bin/*; do
+			local _base=$(basename "${_f}")
+			ln -s "../lib/rocm/bin/${_base}" "${PKGDESTDIR}/usr/bin"
+		done
+	}
+}
+
+ROCm-Device-Libs_package() {
+	short_desc="ROCm Device Bitcode Libraries"
+	pkg_install() {
+		cd "${_device_libs}/build"
+		DESTDIR=${PKGDESTDIR} ninja install
+		ln -s lib/rocm/amdgcn ${PKGDESTDIR}/usr/
+	}
+}

From c59d276541c84631b7fc91bb10e6bb473ad517a9 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Sat, 14 Dec 2024 23:57:03 -0500
Subject: [PATCH 7/9] New package: python3-robotpy-cppheaderparser-5.1.1

---
 .../python3-robotpy-cppheaderparser/template    | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)
 create mode 100644 srcpkgs/python3-robotpy-cppheaderparser/template

diff --git a/srcpkgs/python3-robotpy-cppheaderparser/template b/srcpkgs/python3-robotpy-cppheaderparser/template
new file mode 100644
index 00000000000000..821f8a08277b4b
--- /dev/null
+++ b/srcpkgs/python3-robotpy-cppheaderparser/template
@@ -0,0 +1,17 @@
+# Template file for 'python3-robotpy-cppheaderparser'
+pkgname=python3-robotpy-cppheaderparser
+version=5.1.1
+revision=1
+build_style=python3-module
+hostmakedepends="python3-setuptools"
+depends="python3-setuptools python3-ply"
+short_desc="CPP Header Parser"
+maintainer="Daniel Martinez <danielmartinez@cock.li>"
+license="BSD-3-Clause"
+homepage="https://github.com/robotpy/robotpy-cppheaderparser"
+distfiles="$PYPI_SITE/r/robotpy-cppheaderparser/robotpy-cppheaderparser-${version}.tar.gz"
+checksum=bd39c58fad279f6742e0ac8a49e7ca6136b46530267aba5ac92701c5965ad0b0
+
+post_install() {
+	vlicense LICENSE.txt
+}

From a89b22e2069cff5b7190d9f3d8a9224e4f308ec0 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Sat, 14 Dec 2024 23:58:02 -0500
Subject: [PATCH 8/9] New package: ROCm-clr-6.3.0

---
 common/shlibs                                 |  2 +
 srcpkgs/ROCm-clr/patches/musl.patch           | 37 +++++++++++++
 .../ROCm-clr/patches/skip-install-hipcc.patch | 27 ++++++++++
 srcpkgs/ROCm-clr/template                     | 54 +++++++++++++++++++
 4 files changed, 120 insertions(+)
 create mode 100644 srcpkgs/ROCm-clr/patches/musl.patch
 create mode 100644 srcpkgs/ROCm-clr/patches/skip-install-hipcc.patch
 create mode 100644 srcpkgs/ROCm-clr/template

diff --git a/common/shlibs b/common/shlibs
index fe27f62d49c858..1bdb5f1a92e5e3 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -4546,3 +4546,5 @@ libshiboken6.so.6.7 libshiboken6-6.7.2_1
 libhsakmt.so.1 ROCt-Thunk-Interface-6.2.0_1
 libhsa-runtime64.so.1 ROCr-Runtime-6.3.0_1
 libamd_comgr.so.2 comgr-6.3.0_1
+libamdhip64.so.6 ROCm-clr-6.3.0_1
+libhiprtc.so.6 ROCm-clr-6.3.0_1
diff --git a/srcpkgs/ROCm-clr/patches/musl.patch b/srcpkgs/ROCm-clr/patches/musl.patch
new file mode 100644
index 00000000000000..1cd64d6509a814
--- /dev/null
+++ b/srcpkgs/ROCm-clr/patches/musl.patch
@@ -0,0 +1,37 @@
+From 3f640c1037b9ee899a61a4a9de941524e3bb738b Mon Sep 17 00:00:00 2001
+From: "Sv. Lockal" <lockalsash@gmail.com>
+Date: Wed, 22 May 2024 09:36:24 +0000
+Subject: [PATCH] Fix compilation errors with musl libc
+
+1. According to POSIX specification, basename(3) belongs to libgen.h
+2. __cpu_mask is an internal type of glibc's cpu_set implementation,
+not part of the POSIX definition, so musl does not support it too.
+
+Signed-off-by: Sv. Lockal <lockalsash@gmail.com>
+---
+ rocclr/os/os.hpp | 5 +++++
+ 1 file changed, 5 insertions(+)
+
+diff --git a/rocclr/os/os.hpp b/rocclr/os/os.hpp
+index 8509cc362..9b8689207 100644
+--- a/rocclr/os/os.hpp
++++ b/rocclr/os/os.hpp
+@@ -29,6 +29,7 @@
+ 
+ #if defined(__linux__)
+ #include <sched.h>
++#include <libgen.h>
+ #endif
+ 
+ #ifdef _WIN32
+@@ -374,6 +375,10 @@ ALWAYSINLINE address Os::currentStackPtr() {
+ 
+ #if defined(__linux__)
+ 
++#ifndef __GLIBC__
++typedef unsigned long int __cpu_mask;
++#endif
++
+ inline void Os::ThreadAffinityMask::init() { CPU_ZERO(&mask_); }
+ 
+ inline void Os::ThreadAffinityMask::set(uint cpu) { CPU_SET(cpu, &mask_); }
diff --git a/srcpkgs/ROCm-clr/patches/skip-install-hipcc.patch b/srcpkgs/ROCm-clr/patches/skip-install-hipcc.patch
new file mode 100644
index 00000000000000..5cf87de5250f99
--- /dev/null
+++ b/srcpkgs/ROCm-clr/patches/skip-install-hipcc.patch
@@ -0,0 +1,27 @@
+diff --git a/hipamd/CMakeLists.txt b/hipamd/CMakeLists.txt
+index f0c6d7f91..71d4318de 100755
+--- a/hipamd/CMakeLists.txt
++++ b/hipamd/CMakeLists.txt
+@@ -393,22 +393,6 @@ endif()
+ install(FILES ${PROJECT_BINARY_DIR}/include/hip/hip_version.h
+         DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/hip)
+ 
+-if (NOT ${HIPCC_BIN_DIR} STREQUAL "")
+-  file(TO_CMAKE_PATH "${HIPCC_BIN_DIR}" HIPCC_BIN_DIR)
+-  if(EXISTS ${HIPCC_BIN_DIR})
+-    install(PROGRAMS ${HIPCC_BIN_DIR}/${HIPCC_EXECUTABLE} DESTINATION bin)
+-    install(PROGRAMS ${HIPCC_BIN_DIR}/${HIPCONFIG_EXECUTABLE} DESTINATION bin)
+-    install(PROGRAMS ${HIPCC_BIN_DIR}/hipcc.pl DESTINATION bin)
+-    install(PROGRAMS ${HIPCC_BIN_DIR}/hipconfig.pl DESTINATION bin)
+-    install(PROGRAMS ${HIPCC_BIN_DIR}/hipvars.pm DESTINATION bin)
+-
+-    if(NOT UNIX)
+-      install(PROGRAMS ${HIPCC_BIN_DIR}/hipcc.bat DESTINATION bin)
+-      install(PROGRAMS ${HIPCC_BIN_DIR}/hipconfig.bat DESTINATION bin)
+-    endif()
+-  endif()
+-endif()
+-
+ #############################
+ # hip-config
+ #############################
diff --git a/srcpkgs/ROCm-clr/template b/srcpkgs/ROCm-clr/template
new file mode 100644
index 00000000000000..271618ee873097
--- /dev/null
+++ b/srcpkgs/ROCm-clr/template
@@ -0,0 +1,54 @@
+# Template file for 'ROCm-clr'
+pkgname=ROCm-clr
+version=6.3.0
+revision=1
+build_style=cmake
+_clr_dir="${XBPS_BUILDDIR}/${pkgname}-${version}"
+_hip_dir="${_clr_dir}/HIP"
+_rocm_prefix=usr/lib/rocm
+configure_args="
+ -DCMAKE_INSTALL_PREFIX=/${_rocm_prefix}
+ -DCMAKE_PREFIX_PATH=${XBPS_CROSS_BASE}/${_rocm_prefix}
+ -DCLR_BUILD_HIP=ON
+ -DHIP_ENABLE_ROCPROFILER_REGISTER=OFF
+ -DHIP_COMMON_DIR=${_hip_dir}
+ -DHIPCC_BIN_DIR=/${_rocm_prefix}/bin
+ -DROCM_PATH=/${_rocm_prefix}
+"
+hostmakedepends="pkg-config xxd git python3-robotpy-cppheaderparser"
+makedepends="llvm-amd-devel ROCm-cmake hipcc ROCr-Runtime-devel comgr libnuma-devel
+ libffi-devel libedit-devel MesaLib-devel ncurses-libtinfo-devel libxml2-devel libzstd-devel"
+depends="hipcc"
+short_desc="AMD CLR - Compute Language Runtimes"
+maintainer="Daniel Martinez <danielmartinez@cock.li>"
+license="MIT"
+homepage="https://github.com/ROCm-Developer-Tools/clr"
+distfiles="https://github.com/ROCm-Developer-Tools/clr/archive/refs/tags/rocm-${version}.tar.gz
+ https://github.com/ROCm-Developer-Tools/HIP/archive/refs/tags/rocm-${version}.tar.gz>HIP-${version}.tar.gz"
+checksum="829e61a5c54d0c8325d02b0191c0c8254b5740e63b8bfdb05eec9e03d48f7d2c
+ d8dba8cdf05463afb7879de2833983cafa6a006ba719815a35b96d9b92fc7fc4"
+skip_extraction="HIP-${version}.tar.gz"
+
+export CLR_DIR="${_clr_dir}"
+export HIP_DIR="${_hip_dir}"
+export ROCM_PATH="/${_rocm_prefix}"
+
+post_extract() {
+	vsrcextract -C ${_hip_dir} HIP-${version}.tar.gz
+}
+
+post_install() {
+	vlicense ${_clr_dir}/LICENCE
+	vlicense ${_clr_dir}/hipamd/LICENSE.txt
+
+	vmkdir "usr/bin"
+	for _f in ${DESTDIR}/${_rocm_prefix}/bin/*; do
+		local _base=$(basename "${_f}")
+		ln -s "../lib/rocm/bin/${_base}" "${DESTDIR}/usr/bin"
+	done
+
+	for _f in ${DESTDIR}/${_rocm_prefix}/lib64/lib*; do
+		local _base=$(basename "${_f}")
+		ln -s "rocm/lib64/${_base}" "${DESTDIR}/usr/lib"
+	done
+}

From 185679e8e80ebe7e6c1fcad93abd0ba90fb755e3 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Sun, 15 Dec 2024 11:25:11 -0500
Subject: [PATCH 9/9] New package: ROCm-0.1

---
 srcpkgs/ROCm-devel    |  1 +
 srcpkgs/ROCm/template | 19 +++++++++++++++++++
 2 files changed, 20 insertions(+)
 create mode 120000 srcpkgs/ROCm-devel
 create mode 100644 srcpkgs/ROCm/template

diff --git a/srcpkgs/ROCm-devel b/srcpkgs/ROCm-devel
new file mode 120000
index 00000000000000..040f0f682b5418
--- /dev/null
+++ b/srcpkgs/ROCm-devel
@@ -0,0 +1 @@
+ROCm
\ No newline at end of file
diff --git a/srcpkgs/ROCm/template b/srcpkgs/ROCm/template
new file mode 100644
index 00000000000000..a3d3212ce66afa
--- /dev/null
+++ b/srcpkgs/ROCm/template
@@ -0,0 +1,19 @@
+# Template file for 'ROCm'
+pkgname=ROCm
+version=0.1
+revision=1
+build_style=meta
+depends="ROCm-clr llvm-amd hipcc ROCm-Device-Libs comgr
+ rocminfo ROCt-Thunk-Interface ROCr-Runtime ROCm-SMI"
+short_desc="ROCm meta package"
+maintainer="Daniel Martinez <danielmartinez@cock.li>"
+license="Public Domain"
+homepage="https://rocm.docs.amd.com"
+
+ROCm-devel_package() {
+	build_style=meta
+	depends="${sourcepkg}>=${version}_${revision}
+	 llvm-amd-devel ROCr-Runtime-devel ROCt-Thunk-Interface-devel
+	 ROCm-SMI-devel ROCm-cmake"
+	short_desc+=" - development files"
+}

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PR PATCH] [Updated] Rocm
  2025-01-02 23:56 [PR PATCH] Rocm llvm19 Calandracas606
@ 2025-01-03  0:02 ` Calandracas606
  2025-01-03  0:26 ` Calandracas606
                   ` (7 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: Calandracas606 @ 2025-01-03  0:02 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 1521 bytes --]

There is an updated pull request by Calandracas606 against master on the void-packages repository

https://github.com/Calandracas606/void-packages rocm-llvm19
https://github.com/void-linux/void-packages/pull/53819

Rocm
<!-- Uncomment relevant sections and delete options which are not applicable -->

#### Testing the changes
- I tested the changes in this PR: **briefly**

Tested by building blender with ROCm, and rendering scenes using GPU

#### New package
- This new package conforms to the [package requirements](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#package-requirements): **YES**


<!-- Note: If the build is likely to take more than 2 hours, please add ci skip tag as described in
https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration
and test at least one native build and, if supported, at least one cross build.
Ignore this section if this PR is not skipping CI.
-->

#### Local build testing
- I built this PR locally for my native architecture, x86_64-glibc
- I built this PR locally for these architectures (if supported. mark crossbuilds):
  - x86_64-musl

It would be nice to be able to install to /usr instead of /usr/lib/rocm, but would probably require quite a bit more patching. The software really seems to expect that its installed in a self-contained directory, and has lots of "hardcoded" relative paths.


A patch file from https://github.com/void-linux/void-packages/pull/53819.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-rocm-llvm19-53819.patch --]
[-- Type: text/x-diff, Size: 37611 bytes --]

From 52b7600626b1e74404528361d83245b6df4e1006 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Sun, 15 Dec 2024 12:23:08 -0500
Subject: [PATCH 1/9] ROCm-SMI: update to 6.3.0.

---
 srcpkgs/ROCm-SMI/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/ROCm-SMI/template b/srcpkgs/ROCm-SMI/template
index dd6149863c36f1..1a75e628016da9 100644
--- a/srcpkgs/ROCm-SMI/template
+++ b/srcpkgs/ROCm-SMI/template
@@ -1,6 +1,6 @@
 # Template file for 'ROCm-SMI'
 pkgname=ROCm-SMI
-version=6.2.2
+version=6.3.0
 revision=1
 build_style=cmake
 short_desc="ROCm System Management Interface"
@@ -9,7 +9,7 @@ license="NCSA"
 homepage="https://github.com/ROCm/rocm_smi_lib"
 changelog="https://raw.githubusercontent.com/ROCm/rocm_smi_lib/rocm-${version}/CHANGELOG.md"
 distfiles="https://github.com/ROCm/rocm_smi_lib/archive/refs/tags/rocm-${version}.tar.gz"
-checksum=c0701ef131dcd591ef2d4d2f1719af59cbed35bc3eccd3ce9523f55293fa1a37
+checksum=573cfb759f8c7700fdcb0c28d045aed0f2d950692bb66a10bd589b89b8f48d0f
 
 ROCm-SMI-devel_package() {
 	short_desc+=" - development files"

From 39e63b2f54af584bbf6fb30cce7b4c6302e20354 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Tue, 30 Apr 2024 22:26:22 -0400
Subject: [PATCH 2/9] New package: ROCm-cmake-6.3.0

---
 srcpkgs/ROCm-cmake/template | 19 +++++++++++++++++++
 1 file changed, 19 insertions(+)
 create mode 100644 srcpkgs/ROCm-cmake/template

diff --git a/srcpkgs/ROCm-cmake/template b/srcpkgs/ROCm-cmake/template
new file mode 100644
index 00000000000000..9bbce0c1d44612
--- /dev/null
+++ b/srcpkgs/ROCm-cmake/template
@@ -0,0 +1,19 @@
+# Template file for 'ROCm-cmake'
+pkgname=ROCm-cmake
+version=6.3.0
+revision=1
+build_style=cmake
+_rocm_prefix=/usr/lib/rocm
+configure_args=" -DCMAKE_INSTALL_PREFIX=${_rocm_prefix} "
+short_desc="Cmake modules for ROCm"
+maintainer="Daniel Martinez <danielmartinez@cock.li>"
+license="MIT"
+homepage="https://github.com/ROCm/rocm-cmake"
+changelog="https://raw.githubusercontent.com/ROCm/rocm-cmake/refs/heads/develop/CHANGELOG.md"
+distfiles="https://github.com/ROCm/rocm-cmake/archive/refs/tags/rocm-${version}.tar.gz"
+checksum=45a1b96f85ae28a7f62895ddc4d6648500b883af250f52f6417bafb31b3cc75d
+make_check="no" # fatal: not a git repository (or any of the parent directories): .git
+
+post_install() {
+	vlicense LICENSE
+}

From 8369e1ac69310a5ea7334a5c7b7d3d26f2ae9298 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Tue, 30 Apr 2024 22:37:17 -0400
Subject: [PATCH 3/9] New package: ROCt-Thunk-Interface-6.2.0

---
 common/shlibs                         |  1 +
 srcpkgs/ROCt-Thunk-Interface-devel    |  1 +
 srcpkgs/ROCt-Thunk-Interface/template | 28 +++++++++++++++++++++++++++
 3 files changed, 30 insertions(+)
 create mode 120000 srcpkgs/ROCt-Thunk-Interface-devel
 create mode 100644 srcpkgs/ROCt-Thunk-Interface/template

diff --git a/common/shlibs b/common/shlibs
index befb37d1b1e5ad..6d764af67c636b 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -4543,3 +4543,4 @@ libflashrom.so.1 flashrom-1.4.0_1
 libpyside6.so.6.7 libpyside6-6.7.2_1
 libpyside6qml.so.6.7 libpyside6-6.7.2_1
 libshiboken6.so.6.7 libshiboken6-6.7.2_1
+libhsakmt.so.1 ROCt-Thunk-Interface-6.2.0_1
diff --git a/srcpkgs/ROCt-Thunk-Interface-devel b/srcpkgs/ROCt-Thunk-Interface-devel
new file mode 120000
index 00000000000000..1773cfdde8226c
--- /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/template b/srcpkgs/ROCt-Thunk-Interface/template
new file mode 100644
index 00000000000000..5e5ca079045bcf
--- /dev/null
+++ b/srcpkgs/ROCt-Thunk-Interface/template
@@ -0,0 +1,28 @@
+# Template file for 'ROCt-Thunk-Interface'
+pkgname=ROCt-Thunk-Interface
+version=6.2.0
+revision=1
+build_style=cmake
+configure_args="-DBUILD_SHARED_LIBS=ON"
+hostmakedepends="pkg-config ROCm-cmake"
+makedepends="libnuma-devel libdrm-devel"
+short_desc="ROCm's Thunk Interfaces"
+maintainer="Daniel Martinez <danielmartinez@cock.li>"
+license="MIT"
+homepage="https://github.com/ROCm/ROCT-Thunk-Interface"
+distfiles="https://github.com/ROCm/ROCT-Thunk-Interface/archive/refs/tags/rocm-${version}.tar.gz"
+checksum=73df98ca2be8a887cb76554c23f148ef6556bdbccfac99f34111fa1f87fd7c5d
+
+post_install() {
+	vlicense LICENSE.md
+}
+
+ROCt-Thunk-Interface-devel_package() {
+	depends="${sourcepkg}>=${version}_${revision}"
+	short_desc+=" - development files"
+	pkg_install() {
+		vmove usr/lib/cmake
+		vmove usr/include
+		vmove usr/lib/pkgconfig
+	}
+}

From 20d546aeda82be04acc1b2bea387997a7cf44dc8 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 May 2024 08:09:10 -0400
Subject: [PATCH 4/9] New package: ROCr-Runtime-6.3.0

---
 common/shlibs                           |   1 +
 srcpkgs/ROCr-Runtime-devel              |   1 +
 srcpkgs/ROCr-Runtime/patches/musl.patch | 290 ++++++++++++++++++++++++
 srcpkgs/ROCr-Runtime/template           |  44 ++++
 4 files changed, 336 insertions(+)
 create mode 120000 srcpkgs/ROCr-Runtime-devel
 create mode 100644 srcpkgs/ROCr-Runtime/patches/musl.patch
 create mode 100644 srcpkgs/ROCr-Runtime/template

diff --git a/common/shlibs b/common/shlibs
index 6d764af67c636b..1abcd35675f5a8 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -4544,3 +4544,4 @@ libpyside6.so.6.7 libpyside6-6.7.2_1
 libpyside6qml.so.6.7 libpyside6-6.7.2_1
 libshiboken6.so.6.7 libshiboken6-6.7.2_1
 libhsakmt.so.1 ROCt-Thunk-Interface-6.2.0_1
+libhsa-runtime64.so.1 ROCr-Runtime-6.3.0_1
diff --git a/srcpkgs/ROCr-Runtime-devel b/srcpkgs/ROCr-Runtime-devel
new file mode 120000
index 00000000000000..440584e3ef6555
--- /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/musl.patch b/srcpkgs/ROCr-Runtime/patches/musl.patch
new file mode 100644
index 00000000000000..31ecbc48e43183
--- /dev/null
+++ b/srcpkgs/ROCr-Runtime/patches/musl.patch
@@ -0,0 +1,290 @@
+From 8d4ea25572bf615ef05b17e2038a4b6cf3e7353e Mon Sep 17 00:00:00 2001
+From: "Sv. Lockal" <lockalsash@gmail.com>
+Date: Sun, 15 Dec 2024 17:50:23 +0000
+Subject: [PATCH 1/3] Fix build issues for musl libc
+
+This fixes few issues, which allow to build and pass kfdtest on musl-based systems:
+
+1) result of https://github.com/ROCm/ROCR-Runtime/commit/daad183bf8a3e1153a652b9e8fda06306b7c94ef#diff-681b7d40f71f20573413d5072e1c381fde6c02aed03a56307afcbe82cf3f5e5eR36-R37f - `extern int hsakmt_page_shift` is under `ifndef`, while it should not
+```
+/var/tmp/portage/dev-libs/roct-thunk-interface-6.3.0/work/ROCR-Runtime-rocm-6.3.0/libhsakmt/src/openclose.c: In function 'init_page_size':
+/var/tmp/portage/dev-libs/roct-thunk-interface-6.3.0/work/ROCR-Runtime-rocm-6.3.0/libhsakmt/src/openclose.c:117:9: error: 'hsakmt_page_size' undeclared (first use in this function); did you mean 'hsakmt_page_shift'?
+  117 |         hsakmt_page_size = sysconf(_SC_PAGESIZE);
+      |         ^~~~~~~~~~~~~~~~
+      |         hsakmt_page_shift
+```
+
+2) warning of `PAGE_SIZE` macro redefinition (defined previously in `limits.h`)
+
+3) no operator to compare 0 with std::nullptr_t (null is defined as nullptr_t, following https://eel.is/c++draft/support.types.nullptr)
+```
+In file included from /var/tmp/portage/dev-libs/roct-thunk-interface-6.3.0/work/ROCR-Runtime-rocm-6.3.0/libhsakmt/tests/kfdtest/src/KFDTestUtil.hpp:27,
+                 from /var/tmp/portage/dev-libs/roct-thunk-interface-6.3.0/work/ROCR-Runtime-rocm-6.3.0/libhsakmt/tests/kfdtest/src/BaseQueue.hpp:28,
+                 from /var/tmp/portage/dev-libs/roct-thunk-interface-6.3.0/work/ROCR-Runtime-rocm-6.3.0/libhsakmt/tests/kfdtest/src/SDMAQueue.hpp:27,
+                 from /var/tmp/portage/dev-libs/roct-thunk-interface-6.3.0/work/ROCR-Runtime-rocm-6.3.0/libhsakmt/tests/kfdtest/src/KFDTestUtilQueue.cpp:28:
+/var/tmp/portage/dev-libs/roct-thunk-interface-6.3.0/work/ROCR-Runtime-rocm-6.3.0/libhsakmt/tests/kfdtest/gtest-1.6.0/gtest/gtest.h: In instantiation of 'testing::AssertionResult testing::internal::CmpHelperNE(const char*, const char*, const T1&, const T2&) [with T1 = long unsigned int; T2 = std::nullptr_t]':
+/var/tmp/portage/dev-libs/roct-thunk-interface-6.3.0/work/ROCR-Runtime-rocm-6.3.0/libhsakmt/tests/kfdtest/src/KFDTestUtilQueue.cpp:60:29:   required from here
+19072 |   GTEST_ASSERT_(pred_format(#v1, #v2, v1, v2),\
+      |                            ^
+/var/tmp/portage/dev-libs/roct-thunk-interface-6.3.0/work/ROCR-Runtime-rocm-6.3.0/libhsakmt/tests/kfdtest/gtest-1.6.0/gtest/gtest.h:18573:28: error: invalid operands of types 'const long unsigned int' and 'std::nullptr_t' to binary 'operator!='
+18573 | GTEST_IMPL_CMP_HELPER_(NE, !=);
+      |                            ^
+/var/tmp/portage/dev-libs/roct-thunk-interface-6.3.0/work/ROCR-Runtime-rocm-6.3.0/libhsakmt/tests/kfdtest/gtest-1.6.0/gtest/gtest.h:18558:12: note: in definition of macro 'GTEST_IMPL_CMP_HELPER_'
+18558 |   if (val1 op val2) {\
+      |            ^~
+```
+
+Closes: https://github.com/ROCm/ROCR-Runtime/issues/267
+Signed-off-by: Sv. Lockal <lockalsash@gmail.com>
+---
+ libhsakmt/src/libhsakmt.h                        | 5 +++--
+ libhsakmt/tests/kfdtest/src/KFDTestUtilQueue.cpp | 6 +++---
+ libhsakmt/tests/kfdtest/src/OSWrapper.hpp        | 4 ++--
+ 3 files changed, 8 insertions(+), 7 deletions(-)
+
+diff --git a/libhsakmt/src/libhsakmt.h b/libhsakmt/src/libhsakmt.h
+index 63ef17d9..70a9eed4 100644
+--- a/libhsakmt/src/libhsakmt.h
++++ b/libhsakmt/src/libhsakmt.h
+@@ -64,14 +64,15 @@ extern HsaVersionInfo hsakmt_kfd_version_info;
+ 	do { if ((minor) > hsakmt_kfd_version_info.KernelInterfaceMinorVersion)\
+ 		return HSAKMT_STATUS_NOT_SUPPORTED; } while (0)
+ 
++extern int hsakmt_page_size;
++extern int hsakmt_page_shift;
++
+ /* Might be defined in limits.h on platforms where it is constant (used by musl) */
+ /* See also: https://pubs.opengroup.org/onlinepubs/7908799/xsh/limits.h.html */
+ #ifndef PAGE_SIZE
+-extern int hsakmt_page_size;
+ #define PAGE_SIZE hsakmt_page_size
+ #endif
+ #ifndef PAGE_SHIFT
+-extern int hsakmt_page_shift;
+ #define PAGE_SHIFT hsakmt_page_shift
+ #endif
+ 
+diff --git a/libhsakmt/tests/kfdtest/src/KFDTestUtilQueue.cpp b/libhsakmt/tests/kfdtest/src/KFDTestUtilQueue.cpp
+index 8f9b857a..47f66e8e 100644
+--- a/libhsakmt/tests/kfdtest/src/KFDTestUtilQueue.cpp
++++ b/libhsakmt/tests/kfdtest/src/KFDTestUtilQueue.cpp
+@@ -57,13 +57,13 @@ class AsyncMPSQ {
+         void PlacePacketOnNode(PacketList &packetList, int node, TSPattern tsp);
+ 
+         /* Run the packets placed on nodes and return immediately.*/
+-        void Submit(void) { ASSERT_NE((HSAuint64)m_queue, NULL); m_queue->SubmitPacket(); }
++        void Submit(void) { ASSERT_NE(m_queue, NULL); m_queue->SubmitPacket(); }
+ 
+         /* Return only when all packets are consumed.
+          * If there is any packet issues some IO operations, wait these IO to complete too.
+          */
+         void Wait(void) {
+-            ASSERT_NE((HSAuint64)m_queue, NULL);
++            ASSERT_NE(m_queue, NULL);
+             m_queue->Wait4PacketConsumption(m_event, std::max((unsigned int)6000, g_TestTimeOut));
+         }
+ 
+@@ -244,7 +244,7 @@ HSAuint64 AsyncMPSQ::Report(int indexOfPacket, HSAuint64 &begin, HSAuint64 &end)
+     if (m_ts_pattern == HEAD_TAIL)
+         indexOfPacket = 0;
+ 
+-    EXPECT_NE((HSAuint64)m_ts, NULL)
++    EXPECT_NE(m_ts, NULL)
+         << " Error " << ++error << ": No timestamp buf!" << std::endl;
+     /* m_ts_count is equal to packets count + 1, see PlacePacketOnNode().
+      * So the max index of a packet is m_ts_count - 2.
+diff --git a/libhsakmt/tests/kfdtest/src/OSWrapper.hpp b/libhsakmt/tests/kfdtest/src/OSWrapper.hpp
+index 6c3b24f1..ce4bfecb 100644
+--- a/libhsakmt/tests/kfdtest/src/OSWrapper.hpp
++++ b/libhsakmt/tests/kfdtest/src/OSWrapper.hpp
+@@ -23,6 +23,8 @@
+ 
+ #include <stdlib.h>
+ #include <stdint.h>
++#include <limits.h>
++#include <sys/user.h>
+ #include <string>
+ 
+ #include "KFDTestFlags.hpp"
+@@ -33,10 +35,8 @@
+ 
+ #ifndef PAGE_SIZE
+ #define PAGE_SIZE   (1<<12)
+-#define PAGE_SHIFT  (12)
+ #endif
+ #ifndef PAGE_SHIFT
+-#define PAGE_SIZE   (1<<12)
+ #define PAGE_SHIFT  (12)
+ #endif
+ 
+-- 
+2.47.1
+
+
+From 3e0dc82144316eb38f1bf68cb540d240121e2a53 Mon Sep 17 00:00:00 2001
+From: "Sv. Lockal" <lockalsash@gmail.com>
+Date: Sun, 15 Dec 2024 21:29:13 +0000
+Subject: [PATCH 2/3] Fix musl compilation for hsa-runtime
+
+This commit applies a similar change, that was reverted in 1cee8656df62e13f83dc2dfda4f13ad5be2e8747, with major issues fixed.
+
+1) reverted commit checked if `pthread_attr_setaffinity_np` symbol exists, but this check did not work (and effectively disabled better path), because this symbol requires `#define _GNU_SOURCE` (see https://man7.org/linux/man-pages/man3/pthread_attr_setaffinity_np.3.html)
+
+2) non-reverted part implied that `pthread_rwlockattr_setkind` function replaces `pthread_rwlockattr_setkind_np`, which is incorrect. This function is non-portable, serves as a hint and has no alternatives.
+
+Signed-off-by: Sv. Lockal <lockalsash@gmail.com>
+---
+ runtime/hsa-ext-finalize/CMakeLists.txt       | 12 +++++++++++
+ runtime/hsa-runtime/CMakeLists.txt            | 12 +++++++++++
+ .../hsa-runtime/core/util/lnx/os_linux.cpp    | 21 ++++++++++++-------
+ 3 files changed, 38 insertions(+), 7 deletions(-)
+
+diff --git a/runtime/hsa-ext-finalize/CMakeLists.txt b/runtime/hsa-ext-finalize/CMakeLists.txt
+index 6c6dbdcb..f18b0991 100755
+--- a/runtime/hsa-ext-finalize/CMakeLists.txt
++++ b/runtime/hsa-ext-finalize/CMakeLists.txt
+@@ -101,6 +101,18 @@ if( NOT DEFINED OPEN_SOURCE_DIR )
+   set ( OPEN_SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/.." )
+ endif()
+ 
++## Check for _GNU_SOURCE pthread extensions
++set(CMAKE_REQUIRED_DEFINITIONS -D_GNU_SOURCE)
++CHECK_SYMBOL_EXISTS ( "pthread_attr_setaffinity_np" "pthread.h" HAVE_PTHREAD_ATTR_SETAFFINITY_NP )
++CHECK_SYMBOL_EXISTS ( "pthread_rwlockattr_setkind_np" "pthread.h" HAVE_PTHREAD_RWLOCKATTR_SETKIND_NP )
++unset(CMAKE_REQUIRED_DEFINITIONS)
++if ( HAVE_PTHREAD_ATTR_SETAFFINITY_NP )
++  target_compile_definitions(${CORE_RUNTIME_TARGET} PRIVATE HAVE_PTHREAD_ATTR_SETAFFINITY_NP )
++endif()
++if ( HAVE_PTHREAD_RWLOCKATTR_SETKIND_NP )
++  target_compile_definitions(${CORE_RUNTIME_TARGET} PRIVATE HAVE_PTHREAD_RWLOCKATTR_SETKIND_NP )
++endif()
++
+ ## ------------------------- Linux Compiler and Linker options -------------------------
+ set ( CMAKE_CXX_FLAGS "-std=c++11 " )
+ 
+diff --git a/runtime/hsa-runtime/CMakeLists.txt b/runtime/hsa-runtime/CMakeLists.txt
+index fbbcaf03..03a36a50 100644
+--- a/runtime/hsa-runtime/CMakeLists.txt
++++ b/runtime/hsa-runtime/CMakeLists.txt
+@@ -109,6 +109,18 @@ if ( HAVE_MEMFD_CREATE )
+   target_compile_definitions(${CORE_RUNTIME_TARGET} PRIVATE HAVE_MEMFD_CREATE )
+ endif()
+ 
++## Check for _GNU_SOURCE pthread extensions
++set(CMAKE_REQUIRED_DEFINITIONS -D_GNU_SOURCE)
++CHECK_SYMBOL_EXISTS ( "pthread_attr_setaffinity_np" "pthread.h" HAVE_PTHREAD_ATTR_SETAFFINITY_NP )
++CHECK_SYMBOL_EXISTS ( "pthread_rwlockattr_setkind_np" "pthread.h" HAVE_PTHREAD_RWLOCKATTR_SETKIND_NP )
++unset(CMAKE_REQUIRED_DEFINITIONS)
++if ( HAVE_PTHREAD_ATTR_SETAFFINITY_NP )
++  target_compile_definitions(${CORE_RUNTIME_TARGET} PRIVATE HAVE_PTHREAD_ATTR_SETAFFINITY_NP )
++endif()
++if ( HAVE_PTHREAD_RWLOCKATTR_SETKIND_NP )
++  target_compile_definitions(${CORE_RUNTIME_TARGET} PRIVATE HAVE_PTHREAD_RWLOCKATTR_SETKIND_NP )
++endif()
++
+ ## Set include directories for ROCr runtime
+ target_include_directories( ${CORE_RUNTIME_TARGET}
+   PUBLIC
+diff --git a/runtime/hsa-runtime/core/util/lnx/os_linux.cpp b/runtime/hsa-runtime/core/util/lnx/os_linux.cpp
+index 84021f15..eba037ab 100644
+--- a/runtime/hsa-runtime/core/util/lnx/os_linux.cpp
++++ b/runtime/hsa-runtime/core/util/lnx/os_linux.cpp
+@@ -137,12 +137,14 @@ class os_thread {
+       for (int i = 0; i < cores; i++) {
+         CPU_SET_S(i, CPU_ALLOC_SIZE(cores), cpuset);
+       }
++#ifdef HAVE_PTHREAD_ATTR_SETAFFINITY_NP
+       err = pthread_attr_setaffinity_np(&attrib, CPU_ALLOC_SIZE(cores), cpuset);
+       CPU_FREE(cpuset);
+       if (err != 0) {
+         fprintf(stderr, "pthread_setaffinity_np failed: %s\n", strerror(err));
+         return;
+       }
++#endif
+     }
+ 
+     do {
+@@ -166,6 +168,17 @@ class os_thread {
+     } while (stackSize < 20 * 1024 * 1024);
+ 
+     args.release();
++#ifndef HAVE_PTHREAD_ATTR_SETAFFINITY_NP
++    if (cores && cpuset) {
++      err = pthread_setaffinity_np(thread, CPU_ALLOC_SIZE(cores), cpuset);
++      CPU_FREE(cpuset);
++      if (err != 0) {
++        fprintf(stderr, "pthread_setaffinity_np failed: %s\n", strerror(err));
++        thread = 0;
++        return;
++      }
++    }
++#endif
+   }
+ 
+   os_thread(os_thread&& rhs) {
+@@ -655,18 +668,12 @@ SharedMutex CreateSharedMutex() {
+     return nullptr;
+   }
+ 
+-#ifdef __GLIBC__
++#ifdef HAVE_PTHREAD_RWLOCKATTR_SETKIND_NP
+   err = pthread_rwlockattr_setkind_np(&attrib, PTHREAD_RWLOCK_PREFER_WRITER_NONRECURSIVE_NP);
+   if (err != 0) {
+     fprintf(stderr, "Set rw lock attribute failure: %s\n", strerror(err));
+     return nullptr;
+   }
+-#else
+-  err = pthread_rwlockattr_setkind(&attrib, PTHREAD_RWLOCK_PREFER_WRITER_NONRECURSIVE_NP);
+-  if (err != 0) {
+-    fprintf(stderr, "Set rw lock attribute failure: %s\n", strerror(err));
+-    return nullptr;
+-  }
+ #endif
+ 
+   pthread_rwlock_t* lock = new pthread_rwlock_t;
+-- 
+2.47.1
+
+
+From 0ac899eca61b2cb2c22eb722fdd941e6cec155a1 Mon Sep 17 00:00:00 2001
+From: "Sv. Lockal" <lockalsash@gmail.com>
+Date: Sun, 15 Dec 2024 22:05:43 +0000
+Subject: [PATCH 3/3] Fix comparisons of pointers with nulls
+
+The macro NULL sometimes is defined as 0, sometimes as nullptr_t-typed value (following [support.types.nullptr]), so to compare with pointers without warnings nullptr should be used
+---
+ libhsakmt/tests/kfdtest/src/KFDTestUtilQueue.cpp | 6 +++---
+ 1 file changed, 3 insertions(+), 3 deletions(-)
+
+diff --git a/libhsakmt/tests/kfdtest/src/KFDTestUtilQueue.cpp b/libhsakmt/tests/kfdtest/src/KFDTestUtilQueue.cpp
+index 47f66e8e..aa709f3a 100644
+--- a/libhsakmt/tests/kfdtest/src/KFDTestUtilQueue.cpp
++++ b/libhsakmt/tests/kfdtest/src/KFDTestUtilQueue.cpp
+@@ -57,13 +57,13 @@ class AsyncMPSQ {
+         void PlacePacketOnNode(PacketList &packetList, int node, TSPattern tsp);
+ 
+         /* Run the packets placed on nodes and return immediately.*/
+-        void Submit(void) { ASSERT_NE(m_queue, NULL); m_queue->SubmitPacket(); }
++        void Submit(void) { ASSERT_NE(m_queue, nullptr); m_queue->SubmitPacket(); }
+ 
+         /* Return only when all packets are consumed.
+          * If there is any packet issues some IO operations, wait these IO to complete too.
+          */
+         void Wait(void) {
+-            ASSERT_NE(m_queue, NULL);
++            ASSERT_NE(m_queue, nullptr);
+             m_queue->Wait4PacketConsumption(m_event, std::max((unsigned int)6000, g_TestTimeOut));
+         }
+ 
+@@ -244,7 +244,7 @@ HSAuint64 AsyncMPSQ::Report(int indexOfPacket, HSAuint64 &begin, HSAuint64 &end)
+     if (m_ts_pattern == HEAD_TAIL)
+         indexOfPacket = 0;
+ 
+-    EXPECT_NE(m_ts, NULL)
++    EXPECT_NE(m_ts, nullptr)
+         << " Error " << ++error << ": No timestamp buf!" << std::endl;
+     /* m_ts_count is equal to packets count + 1, see PlacePacketOnNode().
+      * So the max index of a packet is m_ts_count - 2.
+-- 
+2.47.1
+
diff --git a/srcpkgs/ROCr-Runtime/template b/srcpkgs/ROCr-Runtime/template
new file mode 100644
index 00000000000000..639addee1df3ca
--- /dev/null
+++ b/srcpkgs/ROCr-Runtime/template
@@ -0,0 +1,44 @@
+# Template file for 'ROCr-Runtime'
+pkgname=ROCr-Runtime
+version=6.3.0
+revision=1
+build_style=cmake
+_rocm_prefix="usr/lib/rocm"
+configure_args="
+ -DCMAKE_PREFIX_PATH=${XBPS_CROSS_BASE}/${_rocm_prefix};${XBPS_CROSS_BASE}/${_rocm_prefix}/lib/llvm
+ -DBUILD_SHARED_LIBS=ON "
+hostmakedepends="ROCm-cmake pkg-config llvm-amd-devel xxd"
+makedepends="llvm-amd-devel ROCm-Device-Libs ROCt-Thunk-Interface-devel
+libnuma-devel elfutils-devel libdrm-devel libffi-devel libxml2-devel ncurses-libtinfo-devel libedit-devel"
+short_desc="HSA Runtime API and runtime for ROCm"
+maintainer="Daniel Martinez <danielmartinez@cock.li>"
+license="NCSA"
+homepage="https://github.com/ROCm/ROCR-Runtime"
+distfiles="https://github.com/ROCm/ROCR-Runtime/archive/refs/tags/rocm-${version}.tar.gz"
+checksum=8fd6bcd6a5afd0ae5a59e33b786a525f575183d38c34049c2dab6b9270a1ca3b
+
+#if [ $XBPS_TARGET_LIBC == "musl" ]; then
+#	broken="TODO: requires pthread_np extensions not available on musl"
+#fi
+
+post_install() {
+	# files copied from ROCt-Thunk-Interface-devel
+	rm ${DESTDIR}/usr/include/hsakmt/hsakmt.h
+	rm ${DESTDIR}/usr/include/hsakmt/hsakmttypes.h
+	rm ${DESTDIR}/usr/lib/cmake/hsakmt/hsakmt-config-version.cmake
+	rm ${DESTDIR}/usr/lib/cmake/hsakmt/hsakmt-config.cmake
+	rm ${DESTDIR}/usr/lib/cmake/hsakmt/hsakmtTargets-none.cmake
+	rm ${DESTDIR}/usr/lib/cmake/hsakmt/hsakmtTargets.cmake
+	rm ${DESTDIR}/usr/lib/pkgconfig/libhsakmt.pc
+}
+
+ROCr-Runtime-devel_package() {
+	depends="${sourcepkg}>=${version}_${revision}"
+	short_desc+=" - development files"
+	pkg_install() {
+		vmove usr/lib/cmake
+		vmove usr/include
+		vmove usr/lib/pkgconfig
+		vmove "usr/lib/*.a"
+	}
+}

From d10e083a54e82b1a9a2406cb422bdcb162166796 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Sat, 14 Dec 2024 22:24:43 -0500
Subject: [PATCH 5/9] New package: rocminfo-6.3.0

---
 srcpkgs/rocminfo/template | 25 +++++++++++++++++++++++++
 1 file changed, 25 insertions(+)
 create mode 100644 srcpkgs/rocminfo/template

diff --git a/srcpkgs/rocminfo/template b/srcpkgs/rocminfo/template
new file mode 100644
index 00000000000000..cd9e7e6fb74a25
--- /dev/null
+++ b/srcpkgs/rocminfo/template
@@ -0,0 +1,25 @@
+# Template file for 'rocminfo'
+pkgname=rocminfo
+version=6.3.0
+revision=1
+_rocm_prefix=usr/lib/rocm
+build_style=cmake
+configure_args=" -DROCRTST_BLD_TYPE=Release
+ -DCMAKE_INSTALL_PREFIX=/${_rocm_prefix}
+ -DCMAKE_PREFIX_PATH=${XBPS_CROSS_BASE}/${_rocm_prefix}"
+makedepends="ROCm-cmake ROCr-Runtime-devel"
+short_desc="ROCm Application for Reporting System Info"
+maintainer="Daniel Martinez <danielmartinez@cock.li>"
+license="NCSA"
+homepage="https://github.com/ROCm/rocminfo"
+distfiles="https://github.com/ROCm/rocminfo/archive/refs/tags/rocm-${version}.tar.gz"
+checksum=40e2ef89e135770196022761cb929af93c80c41869082b3ef80e42b7772267d0
+
+post_install() {
+	vlicense License.txt
+	vmkdir "usr/bin"
+	for _f in ${DESTDIR}/${_rocm_prefix}/bin/*; do
+		local _base=$(basename "${_f}")
+		ln -s "../lib/rocm/bin/${_base}" "${DESTDIR}/usr/bin"
+	done
+}

From d8a40a5ccdc1608aa986f2a80fdd8a9ced9946f5 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Sat, 14 Dec 2024 22:28:46 -0500
Subject: [PATCH 6/9] New package: llvm-amd-6.3.0

---
 common/shlibs             |   1 +
 srcpkgs/ROCm-Device-Libs  |   1 +
 srcpkgs/comgr             |   1 +
 srcpkgs/hipcc             |   1 +
 srcpkgs/llvm-amd-devel    |   1 +
 srcpkgs/llvm-amd/template | 153 ++++++++++++++++++++++++++++++++++++++
 6 files changed, 158 insertions(+)
 create mode 120000 srcpkgs/ROCm-Device-Libs
 create mode 120000 srcpkgs/comgr
 create mode 120000 srcpkgs/hipcc
 create mode 120000 srcpkgs/llvm-amd-devel
 create mode 100644 srcpkgs/llvm-amd/template

diff --git a/common/shlibs b/common/shlibs
index 1abcd35675f5a8..fe27f62d49c858 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -4545,3 +4545,4 @@ libpyside6qml.so.6.7 libpyside6-6.7.2_1
 libshiboken6.so.6.7 libshiboken6-6.7.2_1
 libhsakmt.so.1 ROCt-Thunk-Interface-6.2.0_1
 libhsa-runtime64.so.1 ROCr-Runtime-6.3.0_1
+libamd_comgr.so.2 comgr-6.3.0_1
diff --git a/srcpkgs/ROCm-Device-Libs b/srcpkgs/ROCm-Device-Libs
new file mode 120000
index 00000000000000..419bb5dddf5859
--- /dev/null
+++ b/srcpkgs/ROCm-Device-Libs
@@ -0,0 +1 @@
+llvm-amd
\ No newline at end of file
diff --git a/srcpkgs/comgr b/srcpkgs/comgr
new file mode 120000
index 00000000000000..419bb5dddf5859
--- /dev/null
+++ b/srcpkgs/comgr
@@ -0,0 +1 @@
+llvm-amd
\ No newline at end of file
diff --git a/srcpkgs/hipcc b/srcpkgs/hipcc
new file mode 120000
index 00000000000000..419bb5dddf5859
--- /dev/null
+++ b/srcpkgs/hipcc
@@ -0,0 +1 @@
+llvm-amd
\ No newline at end of file
diff --git a/srcpkgs/llvm-amd-devel b/srcpkgs/llvm-amd-devel
new file mode 120000
index 00000000000000..419bb5dddf5859
--- /dev/null
+++ b/srcpkgs/llvm-amd-devel
@@ -0,0 +1 @@
+llvm-amd
\ No newline at end of file
diff --git a/srcpkgs/llvm-amd/template b/srcpkgs/llvm-amd/template
new file mode 100644
index 00000000000000..5690d7f1206534
--- /dev/null
+++ b/srcpkgs/llvm-amd/template
@@ -0,0 +1,153 @@
+# Template file for 'llvm-amd'
+pkgname=llvm-amd
+version=6.3.0
+revision=1
+_rocm_prefix=usr/lib/rocm
+_llvm_root="${XBPS_BUILDDIR}/${pkgname}-${version}"
+_device_libs="${_llvm_root}/amd/device-libs"
+_comgr="${_llvm_root}/amd/comgr"
+_hipcc="${_llvm_root}/amd/hipcc"
+build_wrksrc=llvm
+build_style=cmake
+configure_args=" -DCMAKE_BUILD_TYPE=Release
+ -DCMAKE_PREFIX_PATH=${XBPS_CROSS_BASE}/${_rocm_prefix}
+ -DCMAKE_INSTALL_PREFIX=/${_rocm_prefix}/lib/llvm
+ -DLLVM_ENABLE_PROJECTS=llvm;clang;lld
+ -DLLVM_ENABLE_BINDINGS=OFF
+ -DLLVM_INCLUDE_BENCHMARKS=OFF
+ -DLLVM_BUILD_LLVM_DYLIB=OFF
+ -DLLVM_LINK_LLVM_DYLIB=OFF
+ -DCLANG_LINK_CLANG_DYLIB=OFF
+ -DLIBCLANG_BUILD_STATIC=ON
+ -DENABLE_SHARED=OFF
+ -DBUILD_TESTING=OFF
+"
+hostmakedepends="pkg-config git python3 ROCm-cmake"
+makedepends="libffi-devel ncurses-libtinfo-devel zlib-devel libxml2-devel libzstd-devel libedit-devel"
+short_desc="LLVM Project for ROCm"
+maintainer="Daniel Martinez <danielmartinez@cock.li>"
+license="Apache-2.0 AND NCSA AND MIT AND custom:Apache-2.0-with-llvm-exception"
+homepage="https://github.com/RadeonOpenCompute/llvm-project"
+distfiles="https://github.com/ROCm/llvm-project/archive/refs/tags/rocm-${version}.tar.gz"
+checksum=79580508b039ca6c50dfdfd7c4f6fbcf489fe1931037ca51324818851eea0c1c
+python_version=3
+nocross="Fixable, but a PITA. aarch64 devices with AMDGPU are not widely available"
+
+if [ ${XBPS_TARGET_WORDSIZE} != 64 ]; then
+	broken="error: token \"=\" is not valid in preprocessor expressions"
+fi
+
+
+pre_configure() {
+	case "$XBPS_TARGET_MACHINE" in
+		i686*) _arch="X86";;
+		x86_64*) _arch="X86";;
+		armv5*) _arch="Armv5te";;
+		armv6*) _arch="Armv6";;
+		armv7*) _arch="Armv7";;
+		aarch64*) _arch="AArch64";;
+		mips*) _arch="Mips";;
+		ppc*) _arch="PowerPC";;
+		riscv64*) _arch="RISCV64";;
+	esac
+
+	local _triplet=${XBPS_CROSS_TRIPLET:-$XBPS_TRIPLET}
+
+	configure_args+=" -DLLVM_TARGET_ARCH=${_arch}"
+	configure_args+=" -DLLVM_HOST_TRIPLE=${_triplet}"
+	configure_args+=" -DLLVM_DEFAULT_TARGET_TRIPLE=${_triplet}"
+	echo $configure_args
+}
+
+post_build() {
+
+	local _prefix_path="${XBPS_CROSS_BASE}/${_rocm_prefix};${_llvm_root}/llvm/build"
+
+	mkdir "${_device_libs}/build"
+	cd "${_device_libs}/build"
+
+	cmake -DCMAKE_BUILD_TYPE=Release \
+		-DCMAKE_INSTALL_PREFIX="/${_rocm_prefix}" \
+		-DCMAKE_PREFIX_PATH="${_prefix_path}" \
+		-G Ninja \
+		..
+
+	ninja ${makejobs}
+
+	_prefix_path+=";${_device_libs}/build"
+	mkdir "${_comgr}/build"
+	cd "${_comgr}/build"
+
+	cmake -DCMAKE_BUILD_TYPE=Release \
+		-DCMAKE_INSTALL_PREFIX="/${_rocm_prefix}" \
+		-DCMAKE_PREFIX_PATH="${_prefix_path}" \
+		-DBUILD_TESTING=OFF \
+		-G Ninja \
+		..
+
+	ninja ${makejobs}
+
+	_prefix_path+=";${_comgr}/build"
+	mkdir "${_hipcc}/build"
+	cd "${_hipcc}/build"
+
+	cmake -DCMAKE_BUILD_TYPE=Release \
+		-DCMAKE_INSTALL_PREFIX="/${_rocm_prefix}" \
+		-DCMAKE_PREFIX_PATH="${_prefix_path}" \
+		-G Ninja \
+		..
+
+	ninja ${makejobs}
+}
+
+post_install() {
+	ln -s lib/llvm $DESTDIR/${_rocm_prefix}/
+	vlicense LICENSE.TXT
+}
+
+llvm-amd-devel_package() {
+	depends="${sourcepkg}>=${version}_${revision}"
+	short_desc+=" - development files"
+	pkg_install() {
+		vmove ${_rocm_prefix}/lib/llvm/lib/cmake
+		vmove ${_rocm_prefix}/lib/llvm/include
+		vmove "${_rocm_prefix}/lib/llvm/lib/*.a"
+		vmove "${_rocm_prefix}/lib/llvm/lib/*.so"
+	}
+}
+
+comgr_package() {
+	short_desc="ROCm Code Object Manager"
+	pkg_install() {
+		cd "${_comgr}/build"
+		DESTDIR=${PKGDESTDIR} ninja install
+
+		for _f in ${PKGDESTDIR}/${_rocm_prefix}/lib64/lib*; do
+			local _base=$(basename "${_f}")
+			ln -s "rocm/lib64/${_base}" "${PKGDESTDIR}/usr/lib"
+		done
+	}
+}
+
+hipcc_package() {
+	depends="${sourcepkg}>=${version}_${revision}"
+	short_desc="ROCm HIP Compiler Driver"
+	pkg_install() {
+		cd "${_hipcc}/build"
+		DESTDIR=${PKGDESTDIR} ninja install
+		vmkdir "usr/bin"
+		for _f in ${PKGDESTDIR}/${_rocm_prefix}/bin/*; do
+			local _base=$(basename "${_f}")
+			ln -s "../lib/rocm/bin/${_base}" "${PKGDESTDIR}/usr/bin"
+		done
+	}
+}
+
+ROCm-Device-Libs_package() {
+	short_desc="ROCm Device Bitcode Libraries"
+	pkg_install() {
+		cd "${_device_libs}/build"
+		DESTDIR=${PKGDESTDIR} ninja install
+		ln -s lib/rocm/amdgcn ${PKGDESTDIR}/usr/
+	}
+}

From 4b372c1956c0240a26f294a715c5da723ec1df5b Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Sat, 14 Dec 2024 23:57:03 -0500
Subject: [PATCH 7/9] New package: python3-robotpy-cppheaderparser-5.1.1

---
 .../python3-robotpy-cppheaderparser/template    | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)
 create mode 100644 srcpkgs/python3-robotpy-cppheaderparser/template

diff --git a/srcpkgs/python3-robotpy-cppheaderparser/template b/srcpkgs/python3-robotpy-cppheaderparser/template
new file mode 100644
index 00000000000000..821f8a08277b4b
--- /dev/null
+++ b/srcpkgs/python3-robotpy-cppheaderparser/template
@@ -0,0 +1,17 @@
+# Template file for 'python3-robotpy-cppheaderparser'
+pkgname=python3-robotpy-cppheaderparser
+version=5.1.1
+revision=1
+build_style=python3-module
+hostmakedepends="python3-setuptools"
+depends="python3-setuptools python3-ply"
+short_desc="CPP Header Parser"
+maintainer="Daniel Martinez <danielmartinez@cock.li>"
+license="BSD-3-Clause"
+homepage="https://github.com/robotpy/robotpy-cppheaderparser"
+distfiles="$PYPI_SITE/r/robotpy-cppheaderparser/robotpy-cppheaderparser-${version}.tar.gz"
+checksum=bd39c58fad279f6742e0ac8a49e7ca6136b46530267aba5ac92701c5965ad0b0
+
+post_install() {
+	vlicense LICENSE.txt
+}

From 9d60a24cb61cee6ae7b8ef1cfad8deafe25d6003 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Sat, 14 Dec 2024 23:58:02 -0500
Subject: [PATCH 8/9] New package: ROCm-clr-6.3.0

---
 common/shlibs                                 |  2 +
 srcpkgs/ROCm-clr/patches/musl.patch           | 37 +++++++++++++
 .../ROCm-clr/patches/skip-install-hipcc.patch | 27 ++++++++++
 srcpkgs/ROCm-clr/template                     | 54 +++++++++++++++++++
 4 files changed, 120 insertions(+)
 create mode 100644 srcpkgs/ROCm-clr/patches/musl.patch
 create mode 100644 srcpkgs/ROCm-clr/patches/skip-install-hipcc.patch
 create mode 100644 srcpkgs/ROCm-clr/template

diff --git a/common/shlibs b/common/shlibs
index fe27f62d49c858..1bdb5f1a92e5e3 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -4546,3 +4546,5 @@ libshiboken6.so.6.7 libshiboken6-6.7.2_1
 libhsakmt.so.1 ROCt-Thunk-Interface-6.2.0_1
 libhsa-runtime64.so.1 ROCr-Runtime-6.3.0_1
 libamd_comgr.so.2 comgr-6.3.0_1
+libamdhip64.so.6 ROCm-clr-6.3.0_1
+libhiprtc.so.6 ROCm-clr-6.3.0_1
diff --git a/srcpkgs/ROCm-clr/patches/musl.patch b/srcpkgs/ROCm-clr/patches/musl.patch
new file mode 100644
index 00000000000000..1cd64d6509a814
--- /dev/null
+++ b/srcpkgs/ROCm-clr/patches/musl.patch
@@ -0,0 +1,37 @@
+From 3f640c1037b9ee899a61a4a9de941524e3bb738b Mon Sep 17 00:00:00 2001
+From: "Sv. Lockal" <lockalsash@gmail.com>
+Date: Wed, 22 May 2024 09:36:24 +0000
+Subject: [PATCH] Fix compilation errors with musl libc
+
+1. According to POSIX specification, basename(3) belongs to libgen.h
+2. __cpu_mask is an internal type of glibc's cpu_set implementation,
+not part of the POSIX definition, so musl does not support it too.
+
+Signed-off-by: Sv. Lockal <lockalsash@gmail.com>
+---
+ rocclr/os/os.hpp | 5 +++++
+ 1 file changed, 5 insertions(+)
+
+diff --git a/rocclr/os/os.hpp b/rocclr/os/os.hpp
+index 8509cc362..9b8689207 100644
+--- a/rocclr/os/os.hpp
++++ b/rocclr/os/os.hpp
+@@ -29,6 +29,7 @@
+ 
+ #if defined(__linux__)
+ #include <sched.h>
++#include <libgen.h>
+ #endif
+ 
+ #ifdef _WIN32
+@@ -374,6 +375,10 @@ ALWAYSINLINE address Os::currentStackPtr() {
+ 
+ #if defined(__linux__)
+ 
++#ifndef __GLIBC__
++typedef unsigned long int __cpu_mask;
++#endif
++
+ inline void Os::ThreadAffinityMask::init() { CPU_ZERO(&mask_); }
+ 
+ inline void Os::ThreadAffinityMask::set(uint cpu) { CPU_SET(cpu, &mask_); }
diff --git a/srcpkgs/ROCm-clr/patches/skip-install-hipcc.patch b/srcpkgs/ROCm-clr/patches/skip-install-hipcc.patch
new file mode 100644
index 00000000000000..5cf87de5250f99
--- /dev/null
+++ b/srcpkgs/ROCm-clr/patches/skip-install-hipcc.patch
@@ -0,0 +1,27 @@
+diff --git a/hipamd/CMakeLists.txt b/hipamd/CMakeLists.txt
+index f0c6d7f91..71d4318de 100755
+--- a/hipamd/CMakeLists.txt
++++ b/hipamd/CMakeLists.txt
+@@ -393,22 +393,6 @@ endif()
+ install(FILES ${PROJECT_BINARY_DIR}/include/hip/hip_version.h
+         DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/hip)
+ 
+-if (NOT ${HIPCC_BIN_DIR} STREQUAL "")
+-  file(TO_CMAKE_PATH "${HIPCC_BIN_DIR}" HIPCC_BIN_DIR)
+-  if(EXISTS ${HIPCC_BIN_DIR})
+-    install(PROGRAMS ${HIPCC_BIN_DIR}/${HIPCC_EXECUTABLE} DESTINATION bin)
+-    install(PROGRAMS ${HIPCC_BIN_DIR}/${HIPCONFIG_EXECUTABLE} DESTINATION bin)
+-    install(PROGRAMS ${HIPCC_BIN_DIR}/hipcc.pl DESTINATION bin)
+-    install(PROGRAMS ${HIPCC_BIN_DIR}/hipconfig.pl DESTINATION bin)
+-    install(PROGRAMS ${HIPCC_BIN_DIR}/hipvars.pm DESTINATION bin)
+-
+-    if(NOT UNIX)
+-      install(PROGRAMS ${HIPCC_BIN_DIR}/hipcc.bat DESTINATION bin)
+-      install(PROGRAMS ${HIPCC_BIN_DIR}/hipconfig.bat DESTINATION bin)
+-    endif()
+-  endif()
+-endif()
+-
+ #############################
+ # hip-config
+ #############################
diff --git a/srcpkgs/ROCm-clr/template b/srcpkgs/ROCm-clr/template
new file mode 100644
index 00000000000000..271618ee873097
--- /dev/null
+++ b/srcpkgs/ROCm-clr/template
@@ -0,0 +1,54 @@
+# Template file for 'ROCm-clr'
+pkgname=ROCm-clr
+version=6.3.0
+revision=1
+build_style=cmake
+_clr_dir="${XBPS_BUILDDIR}/${pkgname}-${version}"
+_hip_dir="${_clr_dir}/HIP"
+_rocm_prefix=usr/lib/rocm
+configure_args="
+ -DCMAKE_INSTALL_PREFIX=/${_rocm_prefix}
+ -DCMAKE_PREFIX_PATH=${XBPS_CROSS_BASE}/${_rocm_prefix}
+ -DCLR_BUILD_HIP=ON
+ -DHIP_ENABLE_ROCPROFILER_REGISTER=OFF
+ -DHIP_COMMON_DIR=${_hip_dir}
+ -DHIPCC_BIN_DIR=/${_rocm_prefix}/bin
+ -DROCM_PATH=/${_rocm_prefix}
+"
+hostmakedepends="pkg-config xxd git python3-robotpy-cppheaderparser"
+makedepends="llvm-amd-devel ROCm-cmake hipcc ROCr-Runtime-devel comgr libnuma-devel
+ libffi-devel libedit-devel MesaLib-devel ncurses-libtinfo-devel libxml2-devel libzstd-devel"
+depends="hipcc"
+short_desc="AMD CLR - Compute Language Runtimes"
+maintainer="Daniel Martinez <danielmartinez@cock.li>"
+license="MIT"
+homepage="https://github.com/ROCm-Developer-Tools/clr"
+distfiles="https://github.com/ROCm-Developer-Tools/clr/archive/refs/tags/rocm-${version}.tar.gz
+ https://github.com/ROCm-Developer-Tools/HIP/archive/refs/tags/rocm-${version}.tar.gz>HIP-${version}.tar.gz"
+checksum="829e61a5c54d0c8325d02b0191c0c8254b5740e63b8bfdb05eec9e03d48f7d2c
+ d8dba8cdf05463afb7879de2833983cafa6a006ba719815a35b96d9b92fc7fc4"
+skip_extraction="HIP-${version}.tar.gz"
+
+export CLR_DIR="${_clr_dir}"
+export HIP_DIR="${_hip_dir}"
+export ROCM_PATH="/${_rocm_prefix}"
+
+post_extract() {
+	vsrcextract -C ${_hip_dir} HIP-${version}.tar.gz
+}
+
+post_install() {
+	vlicense ${_clr_dir}/LICENCE
+	vlicense ${_clr_dir}/hipamd/LICENSE.txt
+
+	vmkdir "usr/bin"
+	for _f in ${DESTDIR}/${_rocm_prefix}/bin/*; do
+		local _base=$(basename "${_f}")
+		ln -s "../lib/rocm/bin/${_base}" "${DESTDIR}/usr/bin"
+	done
+
+	for _f in ${DESTDIR}/${_rocm_prefix}/lib64/lib*; do
+		local _base=$(basename "${_f}")
+		ln -s "rocm/lib64/${_base}" "${DESTDIR}/usr/lib"
+	done
+}

From 05f8274f87d05f88643804a77124cfd32bd2bd00 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Sun, 15 Dec 2024 11:25:11 -0500
Subject: [PATCH 9/9] New package: ROCm-0.1

---
 srcpkgs/ROCm-devel    |  1 +
 srcpkgs/ROCm/template | 19 +++++++++++++++++++
 2 files changed, 20 insertions(+)
 create mode 120000 srcpkgs/ROCm-devel
 create mode 100644 srcpkgs/ROCm/template

diff --git a/srcpkgs/ROCm-devel b/srcpkgs/ROCm-devel
new file mode 120000
index 00000000000000..040f0f682b5418
--- /dev/null
+++ b/srcpkgs/ROCm-devel
@@ -0,0 +1 @@
+ROCm
\ No newline at end of file
diff --git a/srcpkgs/ROCm/template b/srcpkgs/ROCm/template
new file mode 100644
index 00000000000000..a3d3212ce66afa
--- /dev/null
+++ b/srcpkgs/ROCm/template
@@ -0,0 +1,19 @@
+# Template file for 'ROCm'
+pkgname=ROCm
+version=0.1
+revision=1
+build_style=meta
+depends="ROCm-clr llvm-amd hipcc ROCm-Device-Libs comgr
+ rocminfo ROCt-Thunk-Interface ROCr-Runtime ROCm-SMI"
+short_desc="ROCm meta package"
+maintainer="Daniel Martinez <danielmartinez@cock.li>"
+license="Public Domain"
+homepage="https://rocm.docs.amd.com"
+
+ROCm-devel_package() {
+	build_style=meta
+	depends="${sourcepkg}>=${version}_${revision}
+	 llvm-amd-devel ROCr-Runtime-devel ROCt-Thunk-Interface-devel
+	 ROCm-SMI-devel ROCm-cmake"
+	short_desc+=" - development files"
+}

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PR PATCH] [Updated] Rocm
  2025-01-02 23:56 [PR PATCH] Rocm llvm19 Calandracas606
  2025-01-03  0:02 ` [PR PATCH] [Updated] Rocm Calandracas606
@ 2025-01-03  0:26 ` Calandracas606
  2025-01-09  9:29 ` Rocm hervyqa
                   ` (6 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: Calandracas606 @ 2025-01-03  0:26 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 1521 bytes --]

There is an updated pull request by Calandracas606 against master on the void-packages repository

https://github.com/Calandracas606/void-packages rocm-llvm19
https://github.com/void-linux/void-packages/pull/53819

Rocm
<!-- Uncomment relevant sections and delete options which are not applicable -->

#### Testing the changes
- I tested the changes in this PR: **briefly**

Tested by building blender with ROCm, and rendering scenes using GPU

#### New package
- This new package conforms to the [package requirements](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#package-requirements): **YES**


<!-- Note: If the build is likely to take more than 2 hours, please add ci skip tag as described in
https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration
and test at least one native build and, if supported, at least one cross build.
Ignore this section if this PR is not skipping CI.
-->

#### Local build testing
- I built this PR locally for my native architecture, x86_64-glibc
- I built this PR locally for these architectures (if supported. mark crossbuilds):
  - x86_64-musl

It would be nice to be able to install to /usr instead of /usr/lib/rocm, but would probably require quite a bit more patching. The software really seems to expect that its installed in a self-contained directory, and has lots of "hardcoded" relative paths.


A patch file from https://github.com/void-linux/void-packages/pull/53819.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-rocm-llvm19-53819.patch --]
[-- Type: text/x-diff, Size: 37475 bytes --]

From 52b7600626b1e74404528361d83245b6df4e1006 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Sun, 15 Dec 2024 12:23:08 -0500
Subject: [PATCH 1/9] ROCm-SMI: update to 6.3.0.

---
 srcpkgs/ROCm-SMI/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/ROCm-SMI/template b/srcpkgs/ROCm-SMI/template
index dd6149863c36f1..1a75e628016da9 100644
--- a/srcpkgs/ROCm-SMI/template
+++ b/srcpkgs/ROCm-SMI/template
@@ -1,6 +1,6 @@
 # Template file for 'ROCm-SMI'
 pkgname=ROCm-SMI
-version=6.2.2
+version=6.3.0
 revision=1
 build_style=cmake
 short_desc="ROCm System Management Interface"
@@ -9,7 +9,7 @@ license="NCSA"
 homepage="https://github.com/ROCm/rocm_smi_lib"
 changelog="https://raw.githubusercontent.com/ROCm/rocm_smi_lib/rocm-${version}/CHANGELOG.md"
 distfiles="https://github.com/ROCm/rocm_smi_lib/archive/refs/tags/rocm-${version}.tar.gz"
-checksum=c0701ef131dcd591ef2d4d2f1719af59cbed35bc3eccd3ce9523f55293fa1a37
+checksum=573cfb759f8c7700fdcb0c28d045aed0f2d950692bb66a10bd589b89b8f48d0f
 
 ROCm-SMI-devel_package() {
 	short_desc+=" - development files"

From 39e63b2f54af584bbf6fb30cce7b4c6302e20354 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Tue, 30 Apr 2024 22:26:22 -0400
Subject: [PATCH 2/9] New package: ROCm-cmake-6.3.0

---
 srcpkgs/ROCm-cmake/template | 19 +++++++++++++++++++
 1 file changed, 19 insertions(+)
 create mode 100644 srcpkgs/ROCm-cmake/template

diff --git a/srcpkgs/ROCm-cmake/template b/srcpkgs/ROCm-cmake/template
new file mode 100644
index 00000000000000..9bbce0c1d44612
--- /dev/null
+++ b/srcpkgs/ROCm-cmake/template
@@ -0,0 +1,19 @@
+# Template file for 'ROCm-cmake'
+pkgname=ROCm-cmake
+version=6.3.0
+revision=1
+build_style=cmake
+_rocm_prefix=/usr/lib/rocm
+configure_args=" -DCMAKE_INSTALL_PREFIX=${_rocm_prefix} "
+short_desc="Cmake modules for ROCm"
+maintainer="Daniel Martinez <danielmartinez@cock.li>"
+license="MIT"
+homepage="https://github.com/ROCm/rocm-cmake"
+changelog="https://raw.githubusercontent.com/ROCm/rocm-cmake/refs/heads/develop/CHANGELOG.md"
+distfiles="https://github.com/ROCm/rocm-cmake/archive/refs/tags/rocm-${version}.tar.gz"
+checksum=45a1b96f85ae28a7f62895ddc4d6648500b883af250f52f6417bafb31b3cc75d
+make_check="no" # fatal: not a git repository (or any of the parent directories): .git
+
+post_install() {
+	vlicense LICENSE
+}

From 8369e1ac69310a5ea7334a5c7b7d3d26f2ae9298 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Tue, 30 Apr 2024 22:37:17 -0400
Subject: [PATCH 3/9] New package: ROCt-Thunk-Interface-6.2.0

---
 common/shlibs                         |  1 +
 srcpkgs/ROCt-Thunk-Interface-devel    |  1 +
 srcpkgs/ROCt-Thunk-Interface/template | 28 +++++++++++++++++++++++++++
 3 files changed, 30 insertions(+)
 create mode 120000 srcpkgs/ROCt-Thunk-Interface-devel
 create mode 100644 srcpkgs/ROCt-Thunk-Interface/template

diff --git a/common/shlibs b/common/shlibs
index befb37d1b1e5ad..6d764af67c636b 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -4543,3 +4543,4 @@ libflashrom.so.1 flashrom-1.4.0_1
 libpyside6.so.6.7 libpyside6-6.7.2_1
 libpyside6qml.so.6.7 libpyside6-6.7.2_1
 libshiboken6.so.6.7 libshiboken6-6.7.2_1
+libhsakmt.so.1 ROCt-Thunk-Interface-6.2.0_1
diff --git a/srcpkgs/ROCt-Thunk-Interface-devel b/srcpkgs/ROCt-Thunk-Interface-devel
new file mode 120000
index 00000000000000..1773cfdde8226c
--- /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/template b/srcpkgs/ROCt-Thunk-Interface/template
new file mode 100644
index 00000000000000..5e5ca079045bcf
--- /dev/null
+++ b/srcpkgs/ROCt-Thunk-Interface/template
@@ -0,0 +1,28 @@
+# Template file for 'ROCt-Thunk-Interface'
+pkgname=ROCt-Thunk-Interface
+version=6.2.0
+revision=1
+build_style=cmake
+configure_args="-DBUILD_SHARED_LIBS=ON"
+hostmakedepends="pkg-config ROCm-cmake"
+makedepends="libnuma-devel libdrm-devel"
+short_desc="ROCm's Thunk Interfaces"
+maintainer="Daniel Martinez <danielmartinez@cock.li>"
+license="MIT"
+homepage="https://github.com/ROCm/ROCT-Thunk-Interface"
+distfiles="https://github.com/ROCm/ROCT-Thunk-Interface/archive/refs/tags/rocm-${version}.tar.gz"
+checksum=73df98ca2be8a887cb76554c23f148ef6556bdbccfac99f34111fa1f87fd7c5d
+
+post_install() {
+	vlicense LICENSE.md
+}
+
+ROCt-Thunk-Interface-devel_package() {
+	depends="${sourcepkg}>=${version}_${revision}"
+	short_desc+=" - development files"
+	pkg_install() {
+		vmove usr/lib/cmake
+		vmove usr/include
+		vmove usr/lib/pkgconfig
+	}
+}

From e285ba6f6d3ab412342e55308fb859a604d4a45c Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Fri, 3 May 2024 08:09:10 -0400
Subject: [PATCH 4/9] New package: ROCr-Runtime-6.3.0

---
 common/shlibs                           |   1 +
 srcpkgs/ROCr-Runtime-devel              |   1 +
 srcpkgs/ROCr-Runtime/patches/musl.patch | 290 ++++++++++++++++++++++++
 srcpkgs/ROCr-Runtime/template           |  40 ++++
 4 files changed, 332 insertions(+)
 create mode 120000 srcpkgs/ROCr-Runtime-devel
 create mode 100644 srcpkgs/ROCr-Runtime/patches/musl.patch
 create mode 100644 srcpkgs/ROCr-Runtime/template

diff --git a/common/shlibs b/common/shlibs
index 6d764af67c636b..1abcd35675f5a8 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -4544,3 +4544,4 @@ libpyside6.so.6.7 libpyside6-6.7.2_1
 libpyside6qml.so.6.7 libpyside6-6.7.2_1
 libshiboken6.so.6.7 libshiboken6-6.7.2_1
 libhsakmt.so.1 ROCt-Thunk-Interface-6.2.0_1
+libhsa-runtime64.so.1 ROCr-Runtime-6.3.0_1
diff --git a/srcpkgs/ROCr-Runtime-devel b/srcpkgs/ROCr-Runtime-devel
new file mode 120000
index 00000000000000..440584e3ef6555
--- /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/musl.patch b/srcpkgs/ROCr-Runtime/patches/musl.patch
new file mode 100644
index 00000000000000..31ecbc48e43183
--- /dev/null
+++ b/srcpkgs/ROCr-Runtime/patches/musl.patch
@@ -0,0 +1,290 @@
+From 8d4ea25572bf615ef05b17e2038a4b6cf3e7353e Mon Sep 17 00:00:00 2001
+From: "Sv. Lockal" <lockalsash@gmail.com>
+Date: Sun, 15 Dec 2024 17:50:23 +0000
+Subject: [PATCH 1/3] Fix build issues for musl libc
+
+This fixes few issues, which allow to build and pass kfdtest on musl-based systems:
+
+1) result of https://github.com/ROCm/ROCR-Runtime/commit/daad183bf8a3e1153a652b9e8fda06306b7c94ef#diff-681b7d40f71f20573413d5072e1c381fde6c02aed03a56307afcbe82cf3f5e5eR36-R37f - `extern int hsakmt_page_shift` is under `ifndef`, while it should not
+```
+/var/tmp/portage/dev-libs/roct-thunk-interface-6.3.0/work/ROCR-Runtime-rocm-6.3.0/libhsakmt/src/openclose.c: In function 'init_page_size':
+/var/tmp/portage/dev-libs/roct-thunk-interface-6.3.0/work/ROCR-Runtime-rocm-6.3.0/libhsakmt/src/openclose.c:117:9: error: 'hsakmt_page_size' undeclared (first use in this function); did you mean 'hsakmt_page_shift'?
+  117 |         hsakmt_page_size = sysconf(_SC_PAGESIZE);
+      |         ^~~~~~~~~~~~~~~~
+      |         hsakmt_page_shift
+```
+
+2) warning of `PAGE_SIZE` macro redefinition (defined previously in `limits.h`)
+
+3) no operator to compare 0 with std::nullptr_t (null is defined as nullptr_t, following https://eel.is/c++draft/support.types.nullptr)
+```
+In file included from /var/tmp/portage/dev-libs/roct-thunk-interface-6.3.0/work/ROCR-Runtime-rocm-6.3.0/libhsakmt/tests/kfdtest/src/KFDTestUtil.hpp:27,
+                 from /var/tmp/portage/dev-libs/roct-thunk-interface-6.3.0/work/ROCR-Runtime-rocm-6.3.0/libhsakmt/tests/kfdtest/src/BaseQueue.hpp:28,
+                 from /var/tmp/portage/dev-libs/roct-thunk-interface-6.3.0/work/ROCR-Runtime-rocm-6.3.0/libhsakmt/tests/kfdtest/src/SDMAQueue.hpp:27,
+                 from /var/tmp/portage/dev-libs/roct-thunk-interface-6.3.0/work/ROCR-Runtime-rocm-6.3.0/libhsakmt/tests/kfdtest/src/KFDTestUtilQueue.cpp:28:
+/var/tmp/portage/dev-libs/roct-thunk-interface-6.3.0/work/ROCR-Runtime-rocm-6.3.0/libhsakmt/tests/kfdtest/gtest-1.6.0/gtest/gtest.h: In instantiation of 'testing::AssertionResult testing::internal::CmpHelperNE(const char*, const char*, const T1&, const T2&) [with T1 = long unsigned int; T2 = std::nullptr_t]':
+/var/tmp/portage/dev-libs/roct-thunk-interface-6.3.0/work/ROCR-Runtime-rocm-6.3.0/libhsakmt/tests/kfdtest/src/KFDTestUtilQueue.cpp:60:29:   required from here
+19072 |   GTEST_ASSERT_(pred_format(#v1, #v2, v1, v2),\
+      |                            ^
+/var/tmp/portage/dev-libs/roct-thunk-interface-6.3.0/work/ROCR-Runtime-rocm-6.3.0/libhsakmt/tests/kfdtest/gtest-1.6.0/gtest/gtest.h:18573:28: error: invalid operands of types 'const long unsigned int' and 'std::nullptr_t' to binary 'operator!='
+18573 | GTEST_IMPL_CMP_HELPER_(NE, !=);
+      |                            ^
+/var/tmp/portage/dev-libs/roct-thunk-interface-6.3.0/work/ROCR-Runtime-rocm-6.3.0/libhsakmt/tests/kfdtest/gtest-1.6.0/gtest/gtest.h:18558:12: note: in definition of macro 'GTEST_IMPL_CMP_HELPER_'
+18558 |   if (val1 op val2) {\
+      |            ^~
+```
+
+Closes: https://github.com/ROCm/ROCR-Runtime/issues/267
+Signed-off-by: Sv. Lockal <lockalsash@gmail.com>
+---
+ libhsakmt/src/libhsakmt.h                        | 5 +++--
+ libhsakmt/tests/kfdtest/src/KFDTestUtilQueue.cpp | 6 +++---
+ libhsakmt/tests/kfdtest/src/OSWrapper.hpp        | 4 ++--
+ 3 files changed, 8 insertions(+), 7 deletions(-)
+
+diff --git a/libhsakmt/src/libhsakmt.h b/libhsakmt/src/libhsakmt.h
+index 63ef17d9..70a9eed4 100644
+--- a/libhsakmt/src/libhsakmt.h
++++ b/libhsakmt/src/libhsakmt.h
+@@ -64,14 +64,15 @@ extern HsaVersionInfo hsakmt_kfd_version_info;
+ 	do { if ((minor) > hsakmt_kfd_version_info.KernelInterfaceMinorVersion)\
+ 		return HSAKMT_STATUS_NOT_SUPPORTED; } while (0)
+ 
++extern int hsakmt_page_size;
++extern int hsakmt_page_shift;
++
+ /* Might be defined in limits.h on platforms where it is constant (used by musl) */
+ /* See also: https://pubs.opengroup.org/onlinepubs/7908799/xsh/limits.h.html */
+ #ifndef PAGE_SIZE
+-extern int hsakmt_page_size;
+ #define PAGE_SIZE hsakmt_page_size
+ #endif
+ #ifndef PAGE_SHIFT
+-extern int hsakmt_page_shift;
+ #define PAGE_SHIFT hsakmt_page_shift
+ #endif
+ 
+diff --git a/libhsakmt/tests/kfdtest/src/KFDTestUtilQueue.cpp b/libhsakmt/tests/kfdtest/src/KFDTestUtilQueue.cpp
+index 8f9b857a..47f66e8e 100644
+--- a/libhsakmt/tests/kfdtest/src/KFDTestUtilQueue.cpp
++++ b/libhsakmt/tests/kfdtest/src/KFDTestUtilQueue.cpp
+@@ -57,13 +57,13 @@ class AsyncMPSQ {
+         void PlacePacketOnNode(PacketList &packetList, int node, TSPattern tsp);
+ 
+         /* Run the packets placed on nodes and return immediately.*/
+-        void Submit(void) { ASSERT_NE((HSAuint64)m_queue, NULL); m_queue->SubmitPacket(); }
++        void Submit(void) { ASSERT_NE(m_queue, NULL); m_queue->SubmitPacket(); }
+ 
+         /* Return only when all packets are consumed.
+          * If there is any packet issues some IO operations, wait these IO to complete too.
+          */
+         void Wait(void) {
+-            ASSERT_NE((HSAuint64)m_queue, NULL);
++            ASSERT_NE(m_queue, NULL);
+             m_queue->Wait4PacketConsumption(m_event, std::max((unsigned int)6000, g_TestTimeOut));
+         }
+ 
+@@ -244,7 +244,7 @@ HSAuint64 AsyncMPSQ::Report(int indexOfPacket, HSAuint64 &begin, HSAuint64 &end)
+     if (m_ts_pattern == HEAD_TAIL)
+         indexOfPacket = 0;
+ 
+-    EXPECT_NE((HSAuint64)m_ts, NULL)
++    EXPECT_NE(m_ts, NULL)
+         << " Error " << ++error << ": No timestamp buf!" << std::endl;
+     /* m_ts_count is equal to packets count + 1, see PlacePacketOnNode().
+      * So the max index of a packet is m_ts_count - 2.
+diff --git a/libhsakmt/tests/kfdtest/src/OSWrapper.hpp b/libhsakmt/tests/kfdtest/src/OSWrapper.hpp
+index 6c3b24f1..ce4bfecb 100644
+--- a/libhsakmt/tests/kfdtest/src/OSWrapper.hpp
++++ b/libhsakmt/tests/kfdtest/src/OSWrapper.hpp
+@@ -23,6 +23,8 @@
+ 
+ #include <stdlib.h>
+ #include <stdint.h>
++#include <limits.h>
++#include <sys/user.h>
+ #include <string>
+ 
+ #include "KFDTestFlags.hpp"
+@@ -33,10 +35,8 @@
+ 
+ #ifndef PAGE_SIZE
+ #define PAGE_SIZE   (1<<12)
+-#define PAGE_SHIFT  (12)
+ #endif
+ #ifndef PAGE_SHIFT
+-#define PAGE_SIZE   (1<<12)
+ #define PAGE_SHIFT  (12)
+ #endif
+ 
+-- 
+2.47.1
+
+
+From 3e0dc82144316eb38f1bf68cb540d240121e2a53 Mon Sep 17 00:00:00 2001
+From: "Sv. Lockal" <lockalsash@gmail.com>
+Date: Sun, 15 Dec 2024 21:29:13 +0000
+Subject: [PATCH 2/3] Fix musl compilation for hsa-runtime
+
+This commit applies a similar change, that was reverted in 1cee8656df62e13f83dc2dfda4f13ad5be2e8747, with major issues fixed.
+
+1) reverted commit checked if `pthread_attr_setaffinity_np` symbol exists, but this check did not work (and effectively disabled better path), because this symbol requires `#define _GNU_SOURCE` (see https://man7.org/linux/man-pages/man3/pthread_attr_setaffinity_np.3.html)
+
+2) non-reverted part implied that `pthread_rwlockattr_setkind` function replaces `pthread_rwlockattr_setkind_np`, which is incorrect. This function is non-portable, serves as a hint and has no alternatives.
+
+Signed-off-by: Sv. Lockal <lockalsash@gmail.com>
+---
+ runtime/hsa-ext-finalize/CMakeLists.txt       | 12 +++++++++++
+ runtime/hsa-runtime/CMakeLists.txt            | 12 +++++++++++
+ .../hsa-runtime/core/util/lnx/os_linux.cpp    | 21 ++++++++++++-------
+ 3 files changed, 38 insertions(+), 7 deletions(-)
+
+diff --git a/runtime/hsa-ext-finalize/CMakeLists.txt b/runtime/hsa-ext-finalize/CMakeLists.txt
+index 6c6dbdcb..f18b0991 100755
+--- a/runtime/hsa-ext-finalize/CMakeLists.txt
++++ b/runtime/hsa-ext-finalize/CMakeLists.txt
+@@ -101,6 +101,18 @@ if( NOT DEFINED OPEN_SOURCE_DIR )
+   set ( OPEN_SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/.." )
+ endif()
+ 
++## Check for _GNU_SOURCE pthread extensions
++set(CMAKE_REQUIRED_DEFINITIONS -D_GNU_SOURCE)
++CHECK_SYMBOL_EXISTS ( "pthread_attr_setaffinity_np" "pthread.h" HAVE_PTHREAD_ATTR_SETAFFINITY_NP )
++CHECK_SYMBOL_EXISTS ( "pthread_rwlockattr_setkind_np" "pthread.h" HAVE_PTHREAD_RWLOCKATTR_SETKIND_NP )
++unset(CMAKE_REQUIRED_DEFINITIONS)
++if ( HAVE_PTHREAD_ATTR_SETAFFINITY_NP )
++  target_compile_definitions(${CORE_RUNTIME_TARGET} PRIVATE HAVE_PTHREAD_ATTR_SETAFFINITY_NP )
++endif()
++if ( HAVE_PTHREAD_RWLOCKATTR_SETKIND_NP )
++  target_compile_definitions(${CORE_RUNTIME_TARGET} PRIVATE HAVE_PTHREAD_RWLOCKATTR_SETKIND_NP )
++endif()
++
+ ## ------------------------- Linux Compiler and Linker options -------------------------
+ set ( CMAKE_CXX_FLAGS "-std=c++11 " )
+ 
+diff --git a/runtime/hsa-runtime/CMakeLists.txt b/runtime/hsa-runtime/CMakeLists.txt
+index fbbcaf03..03a36a50 100644
+--- a/runtime/hsa-runtime/CMakeLists.txt
++++ b/runtime/hsa-runtime/CMakeLists.txt
+@@ -109,6 +109,18 @@ if ( HAVE_MEMFD_CREATE )
+   target_compile_definitions(${CORE_RUNTIME_TARGET} PRIVATE HAVE_MEMFD_CREATE )
+ endif()
+ 
++## Check for _GNU_SOURCE pthread extensions
++set(CMAKE_REQUIRED_DEFINITIONS -D_GNU_SOURCE)
++CHECK_SYMBOL_EXISTS ( "pthread_attr_setaffinity_np" "pthread.h" HAVE_PTHREAD_ATTR_SETAFFINITY_NP )
++CHECK_SYMBOL_EXISTS ( "pthread_rwlockattr_setkind_np" "pthread.h" HAVE_PTHREAD_RWLOCKATTR_SETKIND_NP )
++unset(CMAKE_REQUIRED_DEFINITIONS)
++if ( HAVE_PTHREAD_ATTR_SETAFFINITY_NP )
++  target_compile_definitions(${CORE_RUNTIME_TARGET} PRIVATE HAVE_PTHREAD_ATTR_SETAFFINITY_NP )
++endif()
++if ( HAVE_PTHREAD_RWLOCKATTR_SETKIND_NP )
++  target_compile_definitions(${CORE_RUNTIME_TARGET} PRIVATE HAVE_PTHREAD_RWLOCKATTR_SETKIND_NP )
++endif()
++
+ ## Set include directories for ROCr runtime
+ target_include_directories( ${CORE_RUNTIME_TARGET}
+   PUBLIC
+diff --git a/runtime/hsa-runtime/core/util/lnx/os_linux.cpp b/runtime/hsa-runtime/core/util/lnx/os_linux.cpp
+index 84021f15..eba037ab 100644
+--- a/runtime/hsa-runtime/core/util/lnx/os_linux.cpp
++++ b/runtime/hsa-runtime/core/util/lnx/os_linux.cpp
+@@ -137,12 +137,14 @@ class os_thread {
+       for (int i = 0; i < cores; i++) {
+         CPU_SET_S(i, CPU_ALLOC_SIZE(cores), cpuset);
+       }
++#ifdef HAVE_PTHREAD_ATTR_SETAFFINITY_NP
+       err = pthread_attr_setaffinity_np(&attrib, CPU_ALLOC_SIZE(cores), cpuset);
+       CPU_FREE(cpuset);
+       if (err != 0) {
+         fprintf(stderr, "pthread_setaffinity_np failed: %s\n", strerror(err));
+         return;
+       }
++#endif
+     }
+ 
+     do {
+@@ -166,6 +168,17 @@ class os_thread {
+     } while (stackSize < 20 * 1024 * 1024);
+ 
+     args.release();
++#ifndef HAVE_PTHREAD_ATTR_SETAFFINITY_NP
++    if (cores && cpuset) {
++      err = pthread_setaffinity_np(thread, CPU_ALLOC_SIZE(cores), cpuset);
++      CPU_FREE(cpuset);
++      if (err != 0) {
++        fprintf(stderr, "pthread_setaffinity_np failed: %s\n", strerror(err));
++        thread = 0;
++        return;
++      }
++    }
++#endif
+   }
+ 
+   os_thread(os_thread&& rhs) {
+@@ -655,18 +668,12 @@ SharedMutex CreateSharedMutex() {
+     return nullptr;
+   }
+ 
+-#ifdef __GLIBC__
++#ifdef HAVE_PTHREAD_RWLOCKATTR_SETKIND_NP
+   err = pthread_rwlockattr_setkind_np(&attrib, PTHREAD_RWLOCK_PREFER_WRITER_NONRECURSIVE_NP);
+   if (err != 0) {
+     fprintf(stderr, "Set rw lock attribute failure: %s\n", strerror(err));
+     return nullptr;
+   }
+-#else
+-  err = pthread_rwlockattr_setkind(&attrib, PTHREAD_RWLOCK_PREFER_WRITER_NONRECURSIVE_NP);
+-  if (err != 0) {
+-    fprintf(stderr, "Set rw lock attribute failure: %s\n", strerror(err));
+-    return nullptr;
+-  }
+ #endif
+ 
+   pthread_rwlock_t* lock = new pthread_rwlock_t;
+-- 
+2.47.1
+
+
+From 0ac899eca61b2cb2c22eb722fdd941e6cec155a1 Mon Sep 17 00:00:00 2001
+From: "Sv. Lockal" <lockalsash@gmail.com>
+Date: Sun, 15 Dec 2024 22:05:43 +0000
+Subject: [PATCH 3/3] Fix comparisons of pointers with nulls
+
+The macro NULL sometimes is defined as 0, sometimes as nullptr_t-typed value (following [support.types.nullptr]), so to compare with pointers without warnings nullptr should be used
+---
+ libhsakmt/tests/kfdtest/src/KFDTestUtilQueue.cpp | 6 +++---
+ 1 file changed, 3 insertions(+), 3 deletions(-)
+
+diff --git a/libhsakmt/tests/kfdtest/src/KFDTestUtilQueue.cpp b/libhsakmt/tests/kfdtest/src/KFDTestUtilQueue.cpp
+index 47f66e8e..aa709f3a 100644
+--- a/libhsakmt/tests/kfdtest/src/KFDTestUtilQueue.cpp
++++ b/libhsakmt/tests/kfdtest/src/KFDTestUtilQueue.cpp
+@@ -57,13 +57,13 @@ class AsyncMPSQ {
+         void PlacePacketOnNode(PacketList &packetList, int node, TSPattern tsp);
+ 
+         /* Run the packets placed on nodes and return immediately.*/
+-        void Submit(void) { ASSERT_NE(m_queue, NULL); m_queue->SubmitPacket(); }
++        void Submit(void) { ASSERT_NE(m_queue, nullptr); m_queue->SubmitPacket(); }
+ 
+         /* Return only when all packets are consumed.
+          * If there is any packet issues some IO operations, wait these IO to complete too.
+          */
+         void Wait(void) {
+-            ASSERT_NE(m_queue, NULL);
++            ASSERT_NE(m_queue, nullptr);
+             m_queue->Wait4PacketConsumption(m_event, std::max((unsigned int)6000, g_TestTimeOut));
+         }
+ 
+@@ -244,7 +244,7 @@ HSAuint64 AsyncMPSQ::Report(int indexOfPacket, HSAuint64 &begin, HSAuint64 &end)
+     if (m_ts_pattern == HEAD_TAIL)
+         indexOfPacket = 0;
+ 
+-    EXPECT_NE(m_ts, NULL)
++    EXPECT_NE(m_ts, nullptr)
+         << " Error " << ++error << ": No timestamp buf!" << std::endl;
+     /* m_ts_count is equal to packets count + 1, see PlacePacketOnNode().
+      * So the max index of a packet is m_ts_count - 2.
+-- 
+2.47.1
+
diff --git a/srcpkgs/ROCr-Runtime/template b/srcpkgs/ROCr-Runtime/template
new file mode 100644
index 00000000000000..a86ae228bef044
--- /dev/null
+++ b/srcpkgs/ROCr-Runtime/template
@@ -0,0 +1,40 @@
+# Template file for 'ROCr-Runtime'
+pkgname=ROCr-Runtime
+version=6.3.0
+revision=1
+build_style=cmake
+_rocm_prefix="usr/lib/rocm"
+configure_args="
+ -DCMAKE_PREFIX_PATH=${XBPS_CROSS_BASE}/${_rocm_prefix};${XBPS_CROSS_BASE}/${_rocm_prefix}/lib/llvm
+ -DBUILD_SHARED_LIBS=ON "
+hostmakedepends="ROCm-cmake pkg-config xxd"
+makedepends="llvm-amd-devel ROCm-Device-Libs ROCt-Thunk-Interface-devel
+libnuma-devel elfutils-devel libdrm-devel libffi-devel libxml2-devel ncurses-libtinfo-devel libedit-devel"
+short_desc="HSA Runtime API and runtime for ROCm"
+maintainer="Daniel Martinez <danielmartinez@cock.li>"
+license="NCSA"
+homepage="https://github.com/ROCm/ROCR-Runtime"
+distfiles="https://github.com/ROCm/ROCR-Runtime/archive/refs/tags/rocm-${version}.tar.gz"
+checksum=8fd6bcd6a5afd0ae5a59e33b786a525f575183d38c34049c2dab6b9270a1ca3b
+
+post_install() {
+	# files copied from ROCt-Thunk-Interface-devel
+	rm ${DESTDIR}/usr/include/hsakmt/hsakmt.h
+	rm ${DESTDIR}/usr/include/hsakmt/hsakmttypes.h
+	rm ${DESTDIR}/usr/lib/cmake/hsakmt/hsakmt-config-version.cmake
+	rm ${DESTDIR}/usr/lib/cmake/hsakmt/hsakmt-config.cmake
+	rm ${DESTDIR}/usr/lib/cmake/hsakmt/hsakmtTargets-none.cmake
+	rm ${DESTDIR}/usr/lib/cmake/hsakmt/hsakmtTargets.cmake
+	rm ${DESTDIR}/usr/lib/pkgconfig/libhsakmt.pc
+}
+
+ROCr-Runtime-devel_package() {
+	depends="${sourcepkg}>=${version}_${revision}"
+	short_desc+=" - development files"
+	pkg_install() {
+		vmove usr/lib/cmake
+		vmove usr/include
+		vmove usr/lib/pkgconfig
+		vmove "usr/lib/*.a"
+	}
+}

From d6a87d3e2e462ee48c3073014d20478feb7c5f9d Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Sat, 14 Dec 2024 22:24:43 -0500
Subject: [PATCH 5/9] New package: rocminfo-6.3.0

---
 srcpkgs/rocminfo/template | 25 +++++++++++++++++++++++++
 1 file changed, 25 insertions(+)
 create mode 100644 srcpkgs/rocminfo/template

diff --git a/srcpkgs/rocminfo/template b/srcpkgs/rocminfo/template
new file mode 100644
index 00000000000000..cd9e7e6fb74a25
--- /dev/null
+++ b/srcpkgs/rocminfo/template
@@ -0,0 +1,25 @@
+# Template file for 'rocminfo'
+pkgname=rocminfo
+version=6.3.0
+revision=1
+_rocm_prefix=usr/lib/rocm
+build_style=cmake
+configure_args=" -DROCRTST_BLD_TYPE=Release
+ -DCMAKE_INSTALL_PREFIX=/${_rocm_prefix}
+ -DCMAKE_PREFIX_PATH=${XBPS_CROSS_BASE}/${_rocm_prefix}"
+makedepends="ROCm-cmake ROCr-Runtime-devel"
+short_desc="ROCm Application for Reporting System Info"
+maintainer="Daniel Martinez <danielmartinez@cock.li>"
+license="NCSA"
+homepage="https://github.com/ROCm/rocminfo"
+distfiles="https://github.com/ROCm/rocminfo/archive/refs/tags/rocm-${version}.tar.gz"
+checksum=40e2ef89e135770196022761cb929af93c80c41869082b3ef80e42b7772267d0
+
+post_install() {
+	vlicense License.txt
+	vmkdir "usr/bin"
+	for _f in ${DESTDIR}/${_rocm_prefix}/bin/*; do
+		local _base=$(basename "${_f}")
+		ln -s "../lib/rocm/bin/${_base}" "${DESTDIR}/usr/bin"
+	done
+}

From 7099ee1a0ec3f6bbdafd54b700a44238ac8ce662 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Sat, 14 Dec 2024 22:28:46 -0500
Subject: [PATCH 6/9] New package: llvm-amd-6.3.0

---
 common/shlibs             |   1 +
 srcpkgs/ROCm-Device-Libs  |   1 +
 srcpkgs/comgr             |   1 +
 srcpkgs/hipcc             |   1 +
 srcpkgs/llvm-amd-devel    |   1 +
 srcpkgs/llvm-amd/template | 153 ++++++++++++++++++++++++++++++++++++++
 6 files changed, 158 insertions(+)
 create mode 120000 srcpkgs/ROCm-Device-Libs
 create mode 120000 srcpkgs/comgr
 create mode 120000 srcpkgs/hipcc
 create mode 120000 srcpkgs/llvm-amd-devel
 create mode 100644 srcpkgs/llvm-amd/template

diff --git a/common/shlibs b/common/shlibs
index 1abcd35675f5a8..fe27f62d49c858 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -4545,3 +4545,4 @@ libpyside6qml.so.6.7 libpyside6-6.7.2_1
 libshiboken6.so.6.7 libshiboken6-6.7.2_1
 libhsakmt.so.1 ROCt-Thunk-Interface-6.2.0_1
 libhsa-runtime64.so.1 ROCr-Runtime-6.3.0_1
+libamd_comgr.so.2 comgr-6.3.0_1
diff --git a/srcpkgs/ROCm-Device-Libs b/srcpkgs/ROCm-Device-Libs
new file mode 120000
index 00000000000000..419bb5dddf5859
--- /dev/null
+++ b/srcpkgs/ROCm-Device-Libs
@@ -0,0 +1 @@
+llvm-amd
\ No newline at end of file
diff --git a/srcpkgs/comgr b/srcpkgs/comgr
new file mode 120000
index 00000000000000..419bb5dddf5859
--- /dev/null
+++ b/srcpkgs/comgr
@@ -0,0 +1 @@
+llvm-amd
\ No newline at end of file
diff --git a/srcpkgs/hipcc b/srcpkgs/hipcc
new file mode 120000
index 00000000000000..419bb5dddf5859
--- /dev/null
+++ b/srcpkgs/hipcc
@@ -0,0 +1 @@
+llvm-amd
\ No newline at end of file
diff --git a/srcpkgs/llvm-amd-devel b/srcpkgs/llvm-amd-devel
new file mode 120000
index 00000000000000..419bb5dddf5859
--- /dev/null
+++ b/srcpkgs/llvm-amd-devel
@@ -0,0 +1 @@
+llvm-amd
\ No newline at end of file
diff --git a/srcpkgs/llvm-amd/template b/srcpkgs/llvm-amd/template
new file mode 100644
index 00000000000000..5690d7f1206534
--- /dev/null
+++ b/srcpkgs/llvm-amd/template
@@ -0,0 +1,153 @@
+# Template file for 'llvm-amd'
+pkgname=llvm-amd
+version=6.3.0
+revision=1
+_rocm_prefix=usr/lib/rocm
+_llvm_root="${XBPS_BUILDDIR}/${pkgname}-${version}"
+_device_libs="${_llvm_root}/amd/device-libs"
+_comgr="${_llvm_root}/amd/comgr"
+_hipcc="${_llvm_root}/amd/hipcc"
+build_wrksrc=llvm
+build_style=cmake
+configure_args=" -DCMAKE_BUILD_TYPE=Release
+ -DCMAKE_PREFIX_PATH=${XBPS_CROSS_BASE}/${_rocm_prefix}
+ -DCMAKE_INSTALL_PREFIX=/${_rocm_prefix}/lib/llvm
+ -DLLVM_ENABLE_PROJECTS=llvm;clang;lld
+ -DLLVM_ENABLE_BINDINGS=OFF
+ -DLLVM_INCLUDE_BENCHMARKS=OFF
+ -DLLVM_BUILD_LLVM_DYLIB=OFF
+ -DLLVM_LINK_LLVM_DYLIB=OFF
+ -DCLANG_LINK_CLANG_DYLIB=OFF
+ -DLIBCLANG_BUILD_STATIC=ON
+ -DENABLE_SHARED=OFF
+ -DBUILD_TESTING=OFF
+"
+hostmakedepends="pkg-config git python3 ROCm-cmake"
+makedepends="libffi-devel ncurses-libtinfo-devel zlib-devel libxml2-devel libzstd-devel libedit-devel"
+short_desc="LLVM Project for ROCm"
+maintainer="Daniel Martinez <danielmartinez@cock.li>"
+license="Apache-2.0 AND NCSA AND MIT AND custom:Apache-2.0-with-llvm-exception"
+homepage="https://github.com/RadeonOpenCompute/llvm-project"
+distfiles="https://github.com/ROCm/llvm-project/archive/refs/tags/rocm-${version}.tar.gz"
+checksum=79580508b039ca6c50dfdfd7c4f6fbcf489fe1931037ca51324818851eea0c1c
+python_version=3
+nocross="Fixable, but a PITA. aarch64 devices with AMDGPU are not widely available"
+
+if [ ${XBPS_TARGET_WORDSIZE} != 64 ]; then
+	broken="error: token \"=\" is not valid in preprocessor expressions"
+fi
+
+
+pre_configure() {
+	case "$XBPS_TARGET_MACHINE" in
+		i686*) _arch="X86";;
+		x86_64*) _arch="X86";;
+		armv5*) _arch="Armv5te";;
+		armv6*) _arch="Armv6";;
+		armv7*) _arch="Armv7";;
+		aarch64*) _arch="AArch64";;
+		mips*) _arch="Mips";;
+		ppc*) _arch="PowerPC";;
+		riscv64*) _arch="RISCV64";;
+	esac
+
+	local _triplet=${XBPS_CROSS_TRIPLET:-$XBPS_TRIPLET}
+
+	configure_args+=" -DLLVM_TARGET_ARCH=${_arch}"
+	configure_args+=" -DLLVM_HOST_TRIPLE=${_triplet}"
+	configure_args+=" -DLLVM_DEFAULT_TARGET_TRIPLE=${_triplet}"
+	echo $configure_args
+}
+
+post_build() {
+
+	local _prefix_path="${XBPS_CROSS_BASE}/${_rocm_prefix};${_llvm_root}/llvm/build"
+
+	mkdir "${_device_libs}/build"
+	cd "${_device_libs}/build"
+
+	cmake -DCMAKE_BUILD_TYPE=Release \
+		-DCMAKE_INSTALL_PREFIX="/${_rocm_prefix}" \
+		-DCMAKE_PREFIX_PATH="${_prefix_path}" \
+		-G Ninja \
+		..
+
+	ninja ${makejobs}
+
+	_prefix_path+=";${_device_libs}/build"
+	mkdir "${_comgr}/build"
+	cd "${_comgr}/build"
+
+	cmake -DCMAKE_BUILD_TYPE=Release \
+		-DCMAKE_INSTALL_PREFIX="/${_rocm_prefix}" \
+		-DCMAKE_PREFIX_PATH="${_prefix_path}" \
+		-DBUILD_TESTING=OFF \
+		-G Ninja \
+		..
+
+	ninja ${makejobs}
+
+	_prefix_path+=";${_comgr}/build"
+	mkdir "${_hipcc}/build"
+	cd "${_hipcc}/build"
+
+	cmake -DCMAKE_BUILD_TYPE=Release \
+		-DCMAKE_INSTALL_PREFIX="/${_rocm_prefix}" \
+		-DCMAKE_PREFIX_PATH="${_prefix_path}" \
+		-G Ninja \
+		..
+
+	ninja ${makejobs}
+}
+
+post_install() {
+	ln -s lib/llvm $DESTDIR/${_rocm_prefix}/
+	vlicense LICENSE.TXT
+}
+
+llvm-amd-devel_package() {
+	depends="${sourcepkg}>=${version}_${revision}"
+	short_desc+=" - development files"
+	pkg_install() {
+		vmove ${_rocm_prefix}/lib/llvm/lib/cmake
+		vmove ${_rocm_prefix}/lib/llvm/include
+		vmove "${_rocm_prefix}/lib/llvm/lib/*.a"
+		vmove "${_rocm_prefix}/lib/llvm/lib/*.so"
+	}
+}
+
+comgr_package() {
+	short_desc="ROCm Code Object Manager"
+	pkg_install() {
+		cd "${_comgr}/build"
+		DESTDIR=${PKGDESTDIR} ninja install
+
+		for _f in ${PKGDESTDIR}/${_rocm_prefix}/lib64/lib*; do
+			local _base=$(basename "${_f}")
+			ln -s "rocm/lib64/${_base}" "${PKGDESTDIR}/usr/lib"
+		done
+	}
+}
+
+hipcc_package() {
+	depends="${sourcepkg}>=${version}_${revision}"
+	short_desc="ROCm HIP Compiler Driver"
+	pkg_install() {
+		cd "${_hipcc}/build"
+		DESTDIR=${PKGDESTDIR} ninja install
+		vmkdir "usr/bin"
+		for _f in ${PKGDESTDIR}/${_rocm_prefix}/bin/*; do
+			local _base=$(basename "${_f}")
+			ln -s "../lib/rocm/bin/${_base}" "${PKGDESTDIR}/usr/bin"
+		done
+	}
+}
+
+ROCm-Device-Libs_package() {
+	short_desc="ROCm Device Bitcode Libraries"
+	pkg_install() {
+		cd "${_device_libs}/build"
+		DESTDIR=${PKGDESTDIR} ninja install
+		ln -s lib/rocm/amdgcn ${PKGDESTDIR}/usr/
+	}
+}

From 93426bf811eef35857459680a8102155a904aac2 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Sat, 14 Dec 2024 23:57:03 -0500
Subject: [PATCH 7/9] New package: python3-robotpy-cppheaderparser-5.1.1

---
 .../python3-robotpy-cppheaderparser/template    | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)
 create mode 100644 srcpkgs/python3-robotpy-cppheaderparser/template

diff --git a/srcpkgs/python3-robotpy-cppheaderparser/template b/srcpkgs/python3-robotpy-cppheaderparser/template
new file mode 100644
index 00000000000000..821f8a08277b4b
--- /dev/null
+++ b/srcpkgs/python3-robotpy-cppheaderparser/template
@@ -0,0 +1,17 @@
+# Template file for 'python3-robotpy-cppheaderparser'
+pkgname=python3-robotpy-cppheaderparser
+version=5.1.1
+revision=1
+build_style=python3-module
+hostmakedepends="python3-setuptools"
+depends="python3-setuptools python3-ply"
+short_desc="CPP Header Parser"
+maintainer="Daniel Martinez <danielmartinez@cock.li>"
+license="BSD-3-Clause"
+homepage="https://github.com/robotpy/robotpy-cppheaderparser"
+distfiles="$PYPI_SITE/r/robotpy-cppheaderparser/robotpy-cppheaderparser-${version}.tar.gz"
+checksum=bd39c58fad279f6742e0ac8a49e7ca6136b46530267aba5ac92701c5965ad0b0
+
+post_install() {
+	vlicense LICENSE.txt
+}

From d9a987fcd60ff185686319c2bb339f1a9b22d880 Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Sat, 14 Dec 2024 23:58:02 -0500
Subject: [PATCH 8/9] New package: ROCm-clr-6.3.0

---
 common/shlibs                                 |  2 +
 srcpkgs/ROCm-clr/patches/musl.patch           | 37 +++++++++++++
 .../ROCm-clr/patches/skip-install-hipcc.patch | 27 ++++++++++
 srcpkgs/ROCm-clr/template                     | 54 +++++++++++++++++++
 4 files changed, 120 insertions(+)
 create mode 100644 srcpkgs/ROCm-clr/patches/musl.patch
 create mode 100644 srcpkgs/ROCm-clr/patches/skip-install-hipcc.patch
 create mode 100644 srcpkgs/ROCm-clr/template

diff --git a/common/shlibs b/common/shlibs
index fe27f62d49c858..1bdb5f1a92e5e3 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -4546,3 +4546,5 @@ libshiboken6.so.6.7 libshiboken6-6.7.2_1
 libhsakmt.so.1 ROCt-Thunk-Interface-6.2.0_1
 libhsa-runtime64.so.1 ROCr-Runtime-6.3.0_1
 libamd_comgr.so.2 comgr-6.3.0_1
+libamdhip64.so.6 ROCm-clr-6.3.0_1
+libhiprtc.so.6 ROCm-clr-6.3.0_1
diff --git a/srcpkgs/ROCm-clr/patches/musl.patch b/srcpkgs/ROCm-clr/patches/musl.patch
new file mode 100644
index 00000000000000..1cd64d6509a814
--- /dev/null
+++ b/srcpkgs/ROCm-clr/patches/musl.patch
@@ -0,0 +1,37 @@
+From 3f640c1037b9ee899a61a4a9de941524e3bb738b Mon Sep 17 00:00:00 2001
+From: "Sv. Lockal" <lockalsash@gmail.com>
+Date: Wed, 22 May 2024 09:36:24 +0000
+Subject: [PATCH] Fix compilation errors with musl libc
+
+1. According to POSIX specification, basename(3) belongs to libgen.h
+2. __cpu_mask is an internal type of glibc's cpu_set implementation,
+not part of the POSIX definition, so musl does not support it too.
+
+Signed-off-by: Sv. Lockal <lockalsash@gmail.com>
+---
+ rocclr/os/os.hpp | 5 +++++
+ 1 file changed, 5 insertions(+)
+
+diff --git a/rocclr/os/os.hpp b/rocclr/os/os.hpp
+index 8509cc362..9b8689207 100644
+--- a/rocclr/os/os.hpp
++++ b/rocclr/os/os.hpp
+@@ -29,6 +29,7 @@
+ 
+ #if defined(__linux__)
+ #include <sched.h>
++#include <libgen.h>
+ #endif
+ 
+ #ifdef _WIN32
+@@ -374,6 +375,10 @@ ALWAYSINLINE address Os::currentStackPtr() {
+ 
+ #if defined(__linux__)
+ 
++#ifndef __GLIBC__
++typedef unsigned long int __cpu_mask;
++#endif
++
+ inline void Os::ThreadAffinityMask::init() { CPU_ZERO(&mask_); }
+ 
+ inline void Os::ThreadAffinityMask::set(uint cpu) { CPU_SET(cpu, &mask_); }
diff --git a/srcpkgs/ROCm-clr/patches/skip-install-hipcc.patch b/srcpkgs/ROCm-clr/patches/skip-install-hipcc.patch
new file mode 100644
index 00000000000000..5cf87de5250f99
--- /dev/null
+++ b/srcpkgs/ROCm-clr/patches/skip-install-hipcc.patch
@@ -0,0 +1,27 @@
+diff --git a/hipamd/CMakeLists.txt b/hipamd/CMakeLists.txt
+index f0c6d7f91..71d4318de 100755
+--- a/hipamd/CMakeLists.txt
++++ b/hipamd/CMakeLists.txt
+@@ -393,22 +393,6 @@ endif()
+ install(FILES ${PROJECT_BINARY_DIR}/include/hip/hip_version.h
+         DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/hip)
+ 
+-if (NOT ${HIPCC_BIN_DIR} STREQUAL "")
+-  file(TO_CMAKE_PATH "${HIPCC_BIN_DIR}" HIPCC_BIN_DIR)
+-  if(EXISTS ${HIPCC_BIN_DIR})
+-    install(PROGRAMS ${HIPCC_BIN_DIR}/${HIPCC_EXECUTABLE} DESTINATION bin)
+-    install(PROGRAMS ${HIPCC_BIN_DIR}/${HIPCONFIG_EXECUTABLE} DESTINATION bin)
+-    install(PROGRAMS ${HIPCC_BIN_DIR}/hipcc.pl DESTINATION bin)
+-    install(PROGRAMS ${HIPCC_BIN_DIR}/hipconfig.pl DESTINATION bin)
+-    install(PROGRAMS ${HIPCC_BIN_DIR}/hipvars.pm DESTINATION bin)
+-
+-    if(NOT UNIX)
+-      install(PROGRAMS ${HIPCC_BIN_DIR}/hipcc.bat DESTINATION bin)
+-      install(PROGRAMS ${HIPCC_BIN_DIR}/hipconfig.bat DESTINATION bin)
+-    endif()
+-  endif()
+-endif()
+-
+ #############################
+ # hip-config
+ #############################
diff --git a/srcpkgs/ROCm-clr/template b/srcpkgs/ROCm-clr/template
new file mode 100644
index 00000000000000..271618ee873097
--- /dev/null
+++ b/srcpkgs/ROCm-clr/template
@@ -0,0 +1,54 @@
+# Template file for 'ROCm-clr'
+pkgname=ROCm-clr
+version=6.3.0
+revision=1
+build_style=cmake
+_clr_dir="${XBPS_BUILDDIR}/${pkgname}-${version}"
+_hip_dir="${_clr_dir}/HIP"
+_rocm_prefix=usr/lib/rocm
+configure_args="
+ -DCMAKE_INSTALL_PREFIX=/${_rocm_prefix}
+ -DCMAKE_PREFIX_PATH=${XBPS_CROSS_BASE}/${_rocm_prefix}
+ -DCLR_BUILD_HIP=ON
+ -DHIP_ENABLE_ROCPROFILER_REGISTER=OFF
+ -DHIP_COMMON_DIR=${_hip_dir}
+ -DHIPCC_BIN_DIR=/${_rocm_prefix}/bin
+ -DROCM_PATH=/${_rocm_prefix}
+"
+hostmakedepends="pkg-config xxd git python3-robotpy-cppheaderparser"
+makedepends="llvm-amd-devel ROCm-cmake hipcc ROCr-Runtime-devel comgr libnuma-devel
+ libffi-devel libedit-devel MesaLib-devel ncurses-libtinfo-devel libxml2-devel libzstd-devel"
+depends="hipcc"
+short_desc="AMD CLR - Compute Language Runtimes"
+maintainer="Daniel Martinez <danielmartinez@cock.li>"
+license="MIT"
+homepage="https://github.com/ROCm-Developer-Tools/clr"
+distfiles="https://github.com/ROCm-Developer-Tools/clr/archive/refs/tags/rocm-${version}.tar.gz
+ https://github.com/ROCm-Developer-Tools/HIP/archive/refs/tags/rocm-${version}.tar.gz>HIP-${version}.tar.gz"
+checksum="829e61a5c54d0c8325d02b0191c0c8254b5740e63b8bfdb05eec9e03d48f7d2c
+ d8dba8cdf05463afb7879de2833983cafa6a006ba719815a35b96d9b92fc7fc4"
+skip_extraction="HIP-${version}.tar.gz"
+
+export CLR_DIR="${_clr_dir}"
+export HIP_DIR="${_hip_dir}"
+export ROCM_PATH="/${_rocm_prefix}"
+
+post_extract() {
+	vsrcextract -C ${_hip_dir} HIP-${version}.tar.gz
+}
+
+post_install() {
+	vlicense ${_clr_dir}/LICENCE
+	vlicense ${_clr_dir}/hipamd/LICENSE.txt
+
+	vmkdir "usr/bin"
+	for _f in ${DESTDIR}/${_rocm_prefix}/bin/*; do
+		local _base=$(basename "${_f}")
+		ln -s "../lib/rocm/bin/${_base}" "${DESTDIR}/usr/bin"
+	done
+
+	for _f in ${DESTDIR}/${_rocm_prefix}/lib64/lib*; do
+		local _base=$(basename "${_f}")
+		ln -s "rocm/lib64/${_base}" "${DESTDIR}/usr/lib"
+	done
+}

From 7184af2b9b25733273c6eb1f62f0dd5d848b9a2c Mon Sep 17 00:00:00 2001
From: Daniel Martinez <danielmartinez@cock.li>
Date: Sun, 15 Dec 2024 11:25:11 -0500
Subject: [PATCH 9/9] New package: ROCm-0.1

---
 srcpkgs/ROCm-devel    |  1 +
 srcpkgs/ROCm/template | 19 +++++++++++++++++++
 2 files changed, 20 insertions(+)
 create mode 120000 srcpkgs/ROCm-devel
 create mode 100644 srcpkgs/ROCm/template

diff --git a/srcpkgs/ROCm-devel b/srcpkgs/ROCm-devel
new file mode 120000
index 00000000000000..040f0f682b5418
--- /dev/null
+++ b/srcpkgs/ROCm-devel
@@ -0,0 +1 @@
+ROCm
\ No newline at end of file
diff --git a/srcpkgs/ROCm/template b/srcpkgs/ROCm/template
new file mode 100644
index 00000000000000..a3d3212ce66afa
--- /dev/null
+++ b/srcpkgs/ROCm/template
@@ -0,0 +1,19 @@
+# Template file for 'ROCm'
+pkgname=ROCm
+version=0.1
+revision=1
+build_style=meta
+depends="ROCm-clr llvm-amd hipcc ROCm-Device-Libs comgr
+ rocminfo ROCt-Thunk-Interface ROCr-Runtime ROCm-SMI"
+short_desc="ROCm meta package"
+maintainer="Daniel Martinez <danielmartinez@cock.li>"
+license="Public Domain"
+homepage="https://rocm.docs.amd.com"
+
+ROCm-devel_package() {
+	build_style=meta
+	depends="${sourcepkg}>=${version}_${revision}
+	 llvm-amd-devel ROCr-Runtime-devel ROCt-Thunk-Interface-devel
+	 ROCm-SMI-devel ROCm-cmake"
+	short_desc+=" - development files"
+}

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Rocm
  2025-01-02 23:56 [PR PATCH] Rocm llvm19 Calandracas606
  2025-01-03  0:02 ` [PR PATCH] [Updated] Rocm Calandracas606
  2025-01-03  0:26 ` Calandracas606
@ 2025-01-09  9:29 ` hervyqa
  2025-01-12  2:27 ` Rocm TeddyDD
                   ` (5 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: hervyqa @ 2025-01-09  9:29 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 178 bytes --]

New comment by hervyqa on void-packages repository

https://github.com/void-linux/void-packages/pull/53819#issuecomment-2579572777

Comment:
nice template @Calandracas606 ✨✨

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Rocm
  2025-01-02 23:56 [PR PATCH] Rocm llvm19 Calandracas606
                   ` (2 preceding siblings ...)
  2025-01-09  9:29 ` Rocm hervyqa
@ 2025-01-12  2:27 ` TeddyDD
  2025-01-12  2:44 ` Rocm TeddyDD
                   ` (4 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: TeddyDD @ 2025-01-12  2:27 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 2338 bytes --]

New comment by TeddyDD on void-packages repository

https://github.com/void-linux/void-packages/pull/53819#issuecomment-2585549288

Comment:
Okay so I've been testing this, since so far the only way I managed to get ROCm on Void is to copy /opt/rocm from distro.

- ollama compiled with ROCm support works
- darktable is not working, opencl runtime is missing
- You won't be able to compile ollama since [hipblas](https://github.com/ROCm/hipBLAS) is not packaged.
- Blender works

<details><summary>clinfo output</summary>
<p>

<pre>
darktable 5.0.0
Copyright (C) 2012-2024 Johannes Hanika and other contributors.

Compile options:
  Bit depth              -> 64 bit
  Debug                  -> DISABLED
  SSE2 optimizations     -> ENABLED
  OpenMP                 -> ENABLED
  OpenCL                 -> ENABLED
  Lua                    -> ENABLED  - API version 9.4.0
  Colord                 -> ENABLED
  gPhoto2                -> ENABLED
  GMIC                   -> ENABLED  - Compressed LUTs are supported
  GraphicsMagick         -> ENABLED
  ImageMagick            -> DISABLED
  libavif                -> ENABLED
  libheif                -> ENABLED
  libjxl                 -> ENABLED
  LibRaw                 -> ENABLED  - Version 0.22.0-Devel202403
  OpenJPEG               -> ENABLED
  OpenEXR                -> ENABLED
  WebP                   -> ENABLED

See https://www.darktable.org/resources/ for detailed documentation.
See https://github.com/darktable-org/darktable/issues/new/choose to report bugs.

     0.2977 [dt_get_sysresource_level] switched to 2 as `large'
     0.2978   total mem:       64203MB
     0.2978   mipmap cache:    8025MB
     0.2978   available mem:   43889MB
     0.2978   singlebuff:      1003MB
     0.2982 [opencl_init] opencl disabled via darktable preferences
     0.2983 [opencl_init] opencl library 'libOpenCL' found on your system and loaded, preference 'default path'
     0.3456 [opencl_init] found 2 platforms
     0.3456 [check platform] platform 'Clover' with key 'clplatform_clover' is NOT active
     0.3456 [check platform] platform 'rusticl' with key 'clplatform_rusticl' is NOT active
[opencl_init] found 0 device
     0.3456 [opencl_init] FINALLY: opencl PREFERENCE=OFF is NOT AVAILABLE and NOT ENABLED.
</pre>

</p>
</details> 

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Rocm
  2025-01-02 23:56 [PR PATCH] Rocm llvm19 Calandracas606
                   ` (3 preceding siblings ...)
  2025-01-12  2:27 ` Rocm TeddyDD
@ 2025-01-12  2:44 ` TeddyDD
  2025-01-12  2:54 ` Rocm TeddyDD
                   ` (3 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: TeddyDD @ 2025-01-12  2:44 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 2391 bytes --]

New comment by TeddyDD on void-packages repository

https://github.com/void-linux/void-packages/pull/53819#issuecomment-2585549288

Comment:
Okay so I've been testing this, since so far the only way I managed to get ROCm on Void is to copy /opt/rocm from distro.

- ollama compiled with ROCm support works
- darktable is not working, **[opencl](https://github.com/ROCm/clr/tree/develop/opencl) runtime is missing
- You won't be able to compile ollama since [hipblas](https://github.com/ROCm/hipBLAS) is not packaged.
- Blender works

<details><summary>clinfo output</summary>
<p>

<pre>
darktable 5.0.0
Copyright (C) 2012-2024 Johannes Hanika and other contributors.

Compile options:
  Bit depth              -> 64 bit
  Debug                  -> DISABLED
  SSE2 optimizations     -> ENABLED
  OpenMP                 -> ENABLED
  OpenCL                 -> ENABLED
  Lua                    -> ENABLED  - API version 9.4.0
  Colord                 -> ENABLED
  gPhoto2                -> ENABLED
  GMIC                   -> ENABLED  - Compressed LUTs are supported
  GraphicsMagick         -> ENABLED
  ImageMagick            -> DISABLED
  libavif                -> ENABLED
  libheif                -> ENABLED
  libjxl                 -> ENABLED
  LibRaw                 -> ENABLED  - Version 0.22.0-Devel202403
  OpenJPEG               -> ENABLED
  OpenEXR                -> ENABLED
  WebP                   -> ENABLED

See https://www.darktable.org/resources/ for detailed documentation.
See https://github.com/darktable-org/darktable/issues/new/choose to report bugs.

     0.2977 [dt_get_sysresource_level] switched to 2 as `large'
     0.2978   total mem:       64203MB
     0.2978   mipmap cache:    8025MB
     0.2978   available mem:   43889MB
     0.2978   singlebuff:      1003MB
     0.2982 [opencl_init] opencl disabled via darktable preferences
     0.2983 [opencl_init] opencl library 'libOpenCL' found on your system and loaded, preference 'default path'
     0.3456 [opencl_init] found 2 platforms
     0.3456 [check platform] platform 'Clover' with key 'clplatform_clover' is NOT active
     0.3456 [check platform] platform 'rusticl' with key 'clplatform_rusticl' is NOT active
[opencl_init] found 0 device
     0.3456 [opencl_init] FINALLY: opencl PREFERENCE=OFF is NOT AVAILABLE and NOT ENABLED.
</pre>

</p>
</details> 

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Rocm
  2025-01-02 23:56 [PR PATCH] Rocm llvm19 Calandracas606
                   ` (4 preceding siblings ...)
  2025-01-12  2:44 ` Rocm TeddyDD
@ 2025-01-12  2:54 ` TeddyDD
  2025-01-14 13:13 ` Rocm Calandracas606
                   ` (2 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: TeddyDD @ 2025-01-12  2:54 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 2389 bytes --]

New comment by TeddyDD on void-packages repository

https://github.com/void-linux/void-packages/pull/53819#issuecomment-2585549288

Comment:
Okay so I've been testing this, since so far the only way I managed to get ROCm on Void is to copy /opt/rocm from distro.

- ollama compiled with ROCm support works
- darktable is not working, [opencl](https://github.com/ROCm/clr/tree/develop/opencl) runtime is missing
- You won't be able to compile ollama since [hipblas](https://github.com/ROCm/hipBLAS) is not packaged.
- Blender works

<details><summary>clinfo output</summary>
<p>

<pre>
darktable 5.0.0
Copyright (C) 2012-2024 Johannes Hanika and other contributors.

Compile options:
  Bit depth              -> 64 bit
  Debug                  -> DISABLED
  SSE2 optimizations     -> ENABLED
  OpenMP                 -> ENABLED
  OpenCL                 -> ENABLED
  Lua                    -> ENABLED  - API version 9.4.0
  Colord                 -> ENABLED
  gPhoto2                -> ENABLED
  GMIC                   -> ENABLED  - Compressed LUTs are supported
  GraphicsMagick         -> ENABLED
  ImageMagick            -> DISABLED
  libavif                -> ENABLED
  libheif                -> ENABLED
  libjxl                 -> ENABLED
  LibRaw                 -> ENABLED  - Version 0.22.0-Devel202403
  OpenJPEG               -> ENABLED
  OpenEXR                -> ENABLED
  WebP                   -> ENABLED

See https://www.darktable.org/resources/ for detailed documentation.
See https://github.com/darktable-org/darktable/issues/new/choose to report bugs.

     0.2977 [dt_get_sysresource_level] switched to 2 as `large'
     0.2978   total mem:       64203MB
     0.2978   mipmap cache:    8025MB
     0.2978   available mem:   43889MB
     0.2978   singlebuff:      1003MB
     0.2982 [opencl_init] opencl disabled via darktable preferences
     0.2983 [opencl_init] opencl library 'libOpenCL' found on your system and loaded, preference 'default path'
     0.3456 [opencl_init] found 2 platforms
     0.3456 [check platform] platform 'Clover' with key 'clplatform_clover' is NOT active
     0.3456 [check platform] platform 'rusticl' with key 'clplatform_rusticl' is NOT active
[opencl_init] found 0 device
     0.3456 [opencl_init] FINALLY: opencl PREFERENCE=OFF is NOT AVAILABLE and NOT ENABLED.
</pre>

</p>
</details> 

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Rocm
  2025-01-02 23:56 [PR PATCH] Rocm llvm19 Calandracas606
                   ` (5 preceding siblings ...)
  2025-01-12  2:54 ` Rocm TeddyDD
@ 2025-01-14 13:13 ` Calandracas606
  2025-01-14 13:14 ` Rocm Calandracas606
  2025-01-14 21:48 ` Rocm TeddyDD
  8 siblings, 0 replies; 10+ messages in thread
From: Calandracas606 @ 2025-01-14 13:13 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 699 bytes --]

New comment by Calandracas606 on void-packages repository

https://github.com/void-linux/void-packages/pull/53819#issuecomment-2589880782

Comment:
> * darktable is not working, [opencl](https://github.com/ROCm/clr/tree/develop/opencl) runtime is missing

Didn't build with opencl, since it complicates the template quite a bit, and the ICD loader conflicts with `ocl-icd`. From my experience, rocm's opencl implementation is very poor. I dont think its worth the effort for now, since Rusticl is generally more performant and stable.


> * You won't be able to compile ollama since [hipblas](https://github.com/ROCm/hipBLAS) is not packaged.

I will try to add hipblas when I have time.



^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Rocm
  2025-01-02 23:56 [PR PATCH] Rocm llvm19 Calandracas606
                   ` (6 preceding siblings ...)
  2025-01-14 13:13 ` Rocm Calandracas606
@ 2025-01-14 13:14 ` Calandracas606
  2025-01-14 21:48 ` Rocm TeddyDD
  8 siblings, 0 replies; 10+ messages in thread
From: Calandracas606 @ 2025-01-14 13:14 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 736 bytes --]

New comment by Calandracas606 on void-packages repository

https://github.com/void-linux/void-packages/pull/53819#issuecomment-2589880782

Comment:
> * darktable is not working, [opencl](https://github.com/ROCm/clr/tree/develop/opencl) runtime is missing

Didn't build with opencl, since it complicates the template quite a bit, and the ICD loader conflicts with `ocl-icd`. From my experience, rocm's opencl implementation is very poor. I dont think its worth the effort for now, since Rusticl is generally more performant and stable.


> * You won't be able to compile ollama since [hipblas](https://github.com/ROCm/hipBLAS) is not packaged.

I will try to add hipblas when I have time.

Merge requests to my fork are welcome

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Rocm
  2025-01-02 23:56 [PR PATCH] Rocm llvm19 Calandracas606
                   ` (7 preceding siblings ...)
  2025-01-14 13:14 ` Rocm Calandracas606
@ 2025-01-14 21:48 ` TeddyDD
  8 siblings, 0 replies; 10+ messages in thread
From: TeddyDD @ 2025-01-14 21:48 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 291 bytes --]

New comment by TeddyDD on void-packages repository

https://github.com/void-linux/void-packages/pull/53819#issuecomment-2591174101

Comment:
For some reason, I only now figured out that you can run Darktable with Rusticl. I had to set RUSTICL_ENABLE=radeonsi but works like a charm. Thanks!

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2025-01-14 21:48 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-01-02 23:56 [PR PATCH] Rocm llvm19 Calandracas606
2025-01-03  0:02 ` [PR PATCH] [Updated] Rocm Calandracas606
2025-01-03  0:26 ` Calandracas606
2025-01-09  9:29 ` Rocm hervyqa
2025-01-12  2:27 ` Rocm TeddyDD
2025-01-12  2:44 ` Rocm TeddyDD
2025-01-12  2:54 ` Rocm TeddyDD
2025-01-14 13:13 ` Rocm Calandracas606
2025-01-14 13:14 ` Rocm Calandracas606
2025-01-14 21:48 ` Rocm TeddyDD

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).