From d3030b36fb5104ce01d21e63338e9d63694d3677 Mon Sep 17 00:00:00 2001 From: randomizedcoder Date: Thu, 22 Oct 2026 07:18:53 -0700 Subject: [PATCH 01/12] rocmPackages_10: copy profiling and debugging tools, RCCL Verbatim copies of the rocmPackages (ROCm 7.2.4) expressions for aqlprofile, rocprof-trace-decoder, rocdbgapi, rocgdb, rocr-debug-agent, rocprofiler, rdc, rccl, rocprofiler-sdk, rocshmem, not yet part of the rocmPackages_10 scope. The following commits update each one to ROCm 10.1, so their diffs read against 7.2.4. Assisted-by: Claude Code (claude-opus-5-5) --- .../rocm-modules/10/aqlprofile/default.nix | 42 +++ .../rocm-modules/10/rccl/default.nix | 158 +++++++++++ .../10/rccl/fix_hw_reg_hw_id_gt_gfx10.patch | 33 +++ .../10/rccl/rccl-test-missing-iomanip.diff | 10 + .../rocm-modules/10/rdc/default.nix | 150 ++++++++++ .../10/rdc/fix-cmake-cxxflags.patch | 217 +++++++++++++++ .../10/rdc/fix-libcap-pkgconfig.patch | 57 ++++ .../rocm-modules/10/rocdbgapi/default.nix | 109 ++++++++ .../rocm-modules/10/rocgdb/default.nix | 113 ++++++++ .../10/rocprof-trace-decoder/default.nix | 85 ++++++ .../fix-test-dependency.patch | 15 + .../use-system-dependencies.patch | 81 ++++++ ...missing-CPackComponent-cmake-include.patch | 25 ++ ...2-allow-using-system-yaml-dependency.patch | 68 +++++ ...-allow-using-system-elfio-dependency.patch | 70 +++++ ...4-allow-using-system-otf2-dependency.patch | 54 ++++ ...5-allow-using-system-json-dependency.patch | 54 ++++ .../0006-fix-amd-comgr-resolution.patch | 154 +++++++++++ ...udes-and-api-changes-with-fmt-v12.2..patch | 260 ++++++++++++++++++ ...ilation-errors-from-missing-includes.patch | 93 +++++++ ...ocprofiler-sdk-guard-ompt-auto-start.patch | 50 ++++ .../10/rocprofiler-sdk/default.nix | 226 +++++++++++++++ .../rocm-modules/10/rocprofiler/default.nix | 141 ++++++++++ .../10/rocr-debug-agent/default.nix | 55 ++++ .../rocm-modules/10/rocshmem/default.nix | 69 +++++ 25 files changed, 2389 insertions(+) create mode 100644 pkgs/development/rocm-modules/10/aqlprofile/default.nix create mode 100644 pkgs/development/rocm-modules/10/rccl/default.nix create mode 100644 pkgs/development/rocm-modules/10/rccl/fix_hw_reg_hw_id_gt_gfx10.patch create mode 100644 pkgs/development/rocm-modules/10/rccl/rccl-test-missing-iomanip.diff create mode 100644 pkgs/development/rocm-modules/10/rdc/default.nix create mode 100644 pkgs/development/rocm-modules/10/rdc/fix-cmake-cxxflags.patch create mode 100644 pkgs/development/rocm-modules/10/rdc/fix-libcap-pkgconfig.patch create mode 100644 pkgs/development/rocm-modules/10/rocdbgapi/default.nix create mode 100644 pkgs/development/rocm-modules/10/rocgdb/default.nix create mode 100644 pkgs/development/rocm-modules/10/rocprof-trace-decoder/default.nix create mode 100644 pkgs/development/rocm-modules/10/rocprof-trace-decoder/fix-test-dependency.patch create mode 100644 pkgs/development/rocm-modules/10/rocprof-trace-decoder/use-system-dependencies.patch create mode 100644 pkgs/development/rocm-modules/10/rocprofiler-sdk/0001-fix-missing-CPackComponent-cmake-include.patch create mode 100644 pkgs/development/rocm-modules/10/rocprofiler-sdk/0002-allow-using-system-yaml-dependency.patch create mode 100644 pkgs/development/rocm-modules/10/rocprofiler-sdk/0003-allow-using-system-elfio-dependency.patch create mode 100644 pkgs/development/rocm-modules/10/rocprofiler-sdk/0004-allow-using-system-otf2-dependency.patch create mode 100644 pkgs/development/rocm-modules/10/rocprofiler-sdk/0005-allow-using-system-json-dependency.patch create mode 100644 pkgs/development/rocm-modules/10/rocprofiler-sdk/0006-fix-amd-comgr-resolution.patch create mode 100644 pkgs/development/rocm-modules/10/rocprofiler-sdk/0007-fix-missing-includes-and-api-changes-with-fmt-v12.2..patch create mode 100644 pkgs/development/rocm-modules/10/rocprofiler-sdk/0008-fix-compilation-errors-from-missing-includes.patch create mode 100644 pkgs/development/rocm-modules/10/rocprofiler-sdk/0009-rocprofiler-sdk-guard-ompt-auto-start.patch create mode 100644 pkgs/development/rocm-modules/10/rocprofiler-sdk/default.nix create mode 100644 pkgs/development/rocm-modules/10/rocprofiler/default.nix create mode 100644 pkgs/development/rocm-modules/10/rocr-debug-agent/default.nix create mode 100644 pkgs/development/rocm-modules/10/rocshmem/default.nix diff --git a/pkgs/development/rocm-modules/10/aqlprofile/default.nix b/pkgs/development/rocm-modules/10/aqlprofile/default.nix new file mode 100644 index 0000000000000..34b1d92f3d57f --- /dev/null +++ b/pkgs/development/rocm-modules/10/aqlprofile/default.nix @@ -0,0 +1,42 @@ +{ + lib, + stdenv, + clr, + cmake, + fetchFromGitHub, + rocmUpdateScript, +}: + +stdenv.mkDerivation (finalAttrs: { + pname = "aqlprofile"; + version = "7.2.4"; + + src = fetchFromGitHub { + owner = "ROCm"; + repo = "rocm-systems"; + tag = "rocm-${finalAttrs.version}"; + sparseCheckout = [ + "projects/aqlprofile" + "shared" + ]; + hash = "sha256-74HjB5Ughu17rSRx9mfCCsPJI4TVyXnT4aU7vIbm7ak="; + }; + sourceRoot = "${finalAttrs.src.name}/projects/aqlprofile"; + + env.CXXFLAGS = "-DROCP_LD_AQLPROFILE=1"; + + nativeBuildInputs = [ + cmake + clr + ]; + + passthru.updateScript = rocmUpdateScript { inherit finalAttrs; }; + + meta = { + description = "AQLPROFILE library for AMD HSA runtime API extension support"; + homepage = "https://github.com/ROCm/rocm-systems/tree/develop/projects/aqlprofile"; + license = lib.licenses.mit; + teams = [ lib.teams.rocm ]; + platforms = lib.platforms.linux; + }; +}) diff --git a/pkgs/development/rocm-modules/10/rccl/default.nix b/pkgs/development/rocm-modules/10/rccl/default.nix new file mode 100644 index 0000000000000..1dbcd0c84945c --- /dev/null +++ b/pkgs/development/rocm-modules/10/rccl/default.nix @@ -0,0 +1,158 @@ +{ + lib, + stdenv, + fetchFromGitHub, + rocmUpdateScript, + cmake, + rocm-cmake, + rocm-smi, + rocm-core, + pkg-config, + clr, + mscclpp, + perl, + hipify, + python3, + fmt, + gtest, + chrpath, + roctracer, + rocprofiler, + rocprofiler-register, + autoPatchelfHook, + buildTests ? false, + gpuTargets ? (clr.localGpuTargets or [ ]), + # for passthru.tests + rccl, +}: + +let + useAsan = buildTests; + useUbsan = buildTests; + san = lib.optionalString (useAsan || useUbsan) ( + "-fno-gpu-sanitize -fsanitize=undefined " + + (lib.optionalString useAsan "-fsanitize=address -shared-libsan ") + ); +in +# Note: we can't properly test or make use of multi-node collective ops +# https://github.com/NixOS/nixpkgs/issues/366242 tracks kernel support +# kfd_peerdirect support which is on out-of-tree amdkfd in ROCm/ROCK-Kernel-Driver +# infiniband ib_peer_mem support isn't in the mainline kernel but is carried by some distros +stdenv.mkDerivation (finalAttrs: { + pname = "rccl${clr.gpuArchSuffix}"; + version = "7.2.4"; + + outputs = [ + "out" + ] + ++ lib.optionals buildTests [ + "test" + ]; + + patches = [ + ./rccl-test-missing-iomanip.diff + ./fix_hw_reg_hw_id_gt_gfx10.patch + ]; + + src = fetchFromGitHub { + owner = "ROCm"; + repo = "rccl"; + tag = "rocm-${finalAttrs.version}"; + hash = "sha256-A1IQYIDWqu3JLiPQ70G52s1/0ZweQxFlgMUH81qJWmU="; + }; + + requiredSystemFeatures = [ "big-parallel" ]; # Very resource intensive LTO + + nativeBuildInputs = [ + cmake + rocm-cmake + clr + perl + hipify + python3 + pkg-config + autoPatchelfHook # ASAN doesn't add rpath without this + ]; + + buildInputs = [ + rocm-smi + fmt + gtest + roctracer + rocprofiler + rocprofiler-register + mscclpp + ] + ++ lib.optionals buildTests [ + chrpath + ]; + + cmakeFlags = [ + "-DHIP_CLANG_NUM_PARALLEL_JOBS=4" + "-DROCM_PATH=${clr}" + "-DHIP_COMPILER=${clr}/bin/amdclang++" + "-DCMAKE_CXX_COMPILER=${clr}/bin/amdclang++" + "-DROCM_PATCH_VERSION=${rocm-core.ROCM_LIBPATCH_VERSION}" + "-DROCM_VERSION=${rocm-core.ROCM_LIBPATCH_VERSION}" + "-DBUILD_BFD=OFF" # Can't get it to detect bfd.h + "-DENABLE_MSCCL_KERNEL=ON" + # FIXME: this is still running a download because if(NOT mscclpp_nccl_FOUND) is commented out T_T + "-DENABLE_MSCCLPP=OFF" + #"-DMSCCLPP_ROOT=${mscclpp}" + # Manually define CMAKE_INSTALL_ + # See: https://github.com/NixOS/nixpkgs/pull/197838 + "-DCMAKE_INSTALL_BINDIR=bin" + "-DCMAKE_INSTALL_LIBDIR=lib" + "-DCMAKE_INSTALL_INCLUDEDIR=include" + ] + ++ lib.optionals (gpuTargets != [ ]) [ + # AMD can't make up their minds and keep changing which one is used in different projects. + "-DAMDGPU_TARGETS=${lib.concatStringsSep ";" gpuTargets}" + "-DGPU_TARGETS=${lib.concatStringsSep ";" gpuTargets}" + ] + ++ lib.optionals buildTests [ + "-DBUILD_TESTS=ON" + ]; + + # -O2 and -fno-strict-aliasing due to UB issues in RCCL :c + # Reported upstream + env.CFLAGS = "-I${clr}/include -I${roctracer}/include -O2 -fno-strict-aliasing ${san}-fno-omit-frame-pointer -momit-leaf-frame-pointer"; + env.CXXFLAGS = "-I${clr}/include -I${roctracer}/include -O2 -fno-strict-aliasing ${san}-fno-omit-frame-pointer -momit-leaf-frame-pointer"; + env.LDFLAGS = "${san}"; + postPatch = '' + patchShebangs src tools + substituteInPlace CMakeLists.txt \ + --replace-fail '${"\${HOST_OS_ID}"}' '"ubuntu"' \ + --replace-fail 'target_include_directories(rccl PRIVATE ''${ROCM_SMI_INCLUDE_DIR})' \ + 'target_include_directories(rccl PRIVATE ''${ROCM_SMI_INCLUDE_DIRS})' + ''; + + postInstall = + lib.optionalString useAsan '' + patchelf --add-needed ${clr}/llvm/lib/linux/libclang_rt.asan-${stdenv.hostPlatform.parsed.cpu.name}.so $out/lib/librccl.so + '' + + lib.optionalString buildTests '' + mkdir -p $test/bin + mv $out/bin/* $test/bin + rmdir $out/bin + ''; + + passthru.updateScript = rocmUpdateScript { inherit finalAttrs; }; + + # This package with sanitizers + manual integration test binaries built + # must be ran manually + passthru.tests.rccl = rccl.override { + buildTests = true; + }; + + meta = { + description = "ROCm communication collectives library"; + homepage = "https://github.com/ROCm/rccl"; + license = with lib.licenses; [ + bsd2 + bsd3 + ]; + teams = [ lib.teams.rocm ]; + platforms = lib.platforms.linux; + }; +}) diff --git a/pkgs/development/rocm-modules/10/rccl/fix_hw_reg_hw_id_gt_gfx10.patch b/pkgs/development/rocm-modules/10/rccl/fix_hw_reg_hw_id_gt_gfx10.patch new file mode 100644 index 0000000000000..c69000814a8a6 --- /dev/null +++ b/pkgs/development/rocm-modules/10/rccl/fix_hw_reg_hw_id_gt_gfx10.patch @@ -0,0 +1,33 @@ +fix: __trace_hwreg should use HW_REG_HW_ID1 for all gfx10/11/12 +diff --git a/src/device/common.h b/src/device/common.h +index c6c61021..742885f4 100644 +--- a/src/device/common.h ++++ b/src/device/common.h +@@ -26,8 +26,9 @@ + { __atomic_store_n((DST), (SRC), __ATOMIC_SEQ_CST); } + #endif + +-#if defined(__gfx1100__) || defined(__gfx1101__) || defined(__gfx1102__) || defined(__gfx1200__) || defined(__gfx1201__) +-#define __trace_hwreg() ++#if defined(__GFX10__) || defined(__GFX11__) || defined(__GFX12__) ++#define __trace_hwreg() \ ++ asm volatile ("s_getreg_b32 %0, hwreg(HW_REG_HW_ID1)" : "=s" (collTrace->data_0)); + #else + #define __trace_hwreg() \ + asm volatile ("s_getreg_b32 %0, hwreg(HW_REG_HW_ID)" : "=s" (collTrace->data_0)); +diff --git a/tools/JitterBench/Common.hpp b/tools/JitterBench/Common.hpp +index bad12a1b..b59856a8 100644 +--- a/tools/JitterBench/Common.hpp ++++ b/tools/JitterBench/Common.hpp +@@ -43,9 +43,9 @@ THE SOFTWARE. + #endif + + // Macro for collecting HW_REG_HW_ID +-#if defined(__gfx1100__) || defined(__gfx1101__) || defined(__gfx1102__) || defined(__NVCC__) ++#if defined(__GFX10__) || defined(__GFX11__) || defined(__GFX12__) + #define GetHwId(val) \ +- val = 0 ++ asm volatile ("s_getreg_b32 %0, hwreg(HW_REG_HW_ID1)" : "=s" (val)); + #else + #define GetHwId(val) \ + asm volatile ("s_getreg_b32 %0, hwreg(HW_REG_HW_ID)" : "=s" (val)); diff --git a/pkgs/development/rocm-modules/10/rccl/rccl-test-missing-iomanip.diff b/pkgs/development/rocm-modules/10/rccl/rccl-test-missing-iomanip.diff new file mode 100644 index 0000000000000..3cc54a83c1429 --- /dev/null +++ b/pkgs/development/rocm-modules/10/rccl/rccl-test-missing-iomanip.diff @@ -0,0 +1,10 @@ +--- a/test/common/TestBed.cpp ++++ b/test/common/TestBed.cpp +@@ -4,6 +4,7 @@ + * See LICENSE.txt for license information + ************************************************************************/ + #include ++#include + #include "TestBed.hpp" + #include + diff --git a/pkgs/development/rocm-modules/10/rdc/default.nix b/pkgs/development/rocm-modules/10/rdc/default.nix new file mode 100644 index 0000000000000..8c5debc4dec47 --- /dev/null +++ b/pkgs/development/rocm-modules/10/rdc/default.nix @@ -0,0 +1,150 @@ +{ + lib, + stdenv, + fetchFromGitHub, + rocmUpdateScript, + cmake, + pkg-config, + amdsmi, + rocm-smi, + rocm-runtime, + libcap, + libdrm, + grpc, + protobuf, + openssl, + doxygen, + graphviz, + texliveSmall, + gtest, + buildDocs ? true, + buildTests ? false, +}: + +let + latex = lib.optionalAttrs buildDocs ( + texliveSmall.withPackages ( + ps: with ps; [ + changepage + latexmk + varwidth + multirow + hanging + adjustbox + collectbox + stackengine + enumitem + alphalph + wasysym + sectsty + tocloft + newunicodechar + etoc + helvetic + wasy + courier + ] + ) + ); +in +stdenv.mkDerivation (finalAttrs: { + pname = "rdc"; + version = "7.2.4"; + + outputs = [ + "out" + ] + ++ lib.optionals buildDocs [ + "doc" + ] + ++ lib.optionals buildTests [ + "test" + ]; + + src = fetchFromGitHub { + owner = "ROCm"; + repo = "rocm-systems"; + tag = "rocm-${finalAttrs.version}"; + sparseCheckout = [ + "projects/rdc" + "shared" + ]; + hash = "sha256-SmySauRxFnEQJVTjGYf4TpmQclTwZG2RZrk3u6ko5Qo="; + }; + sourceRoot = "${finalAttrs.src.name}/projects/rdc"; + + patches = [ + # https://github.com/ROCm/rocm-systems/pull/2423 + ./fix-cmake-cxxflags.patch + # https://github.com/ROCm/rocm-systems/pull/2424 + ./fix-libcap-pkgconfig.patch + ]; + + nativeBuildInputs = [ + cmake + pkg-config + protobuf + ] + ++ lib.optionals buildDocs [ + doxygen + graphviz + latex + ]; + + buildInputs = [ + amdsmi + rocm-smi + rocm-runtime + libcap + libdrm + grpc + openssl + ] + ++ lib.optionals buildTests [ + gtest + ]; + + cmakeFlags = [ + "-DCMAKE_VERBOSE_MAKEFILE=ON" + "-DRDC_INSTALL_PREFIX=${placeholder "out"}" + "-DBUILD_RVS=OFF" # TODO: Needs RVS package + "-DBUILD_ROCRTEST=ON" + "-DRSMI_INC_DIR=${rocm-smi}/include" + "-DRSMI_LIB_DIR=${rocm-smi}/lib" + "-DGRPC_ROOT=${grpc}" + # Manually define CMAKE_INSTALL_ + # See: https://github.com/NixOS/nixpkgs/pull/197838 + "-DCMAKE_INSTALL_BINDIR=bin" + "-DCMAKE_INSTALL_LIBDIR=lib" + "-DCMAKE_INSTALL_INCLUDEDIR=include" + "-DCMAKE_INSTALL_LIBEXECDIR=libexec" + "-DCMAKE_INSTALL_DOCDIR=doc" + ] + ++ lib.optionals buildTests [ + "-DBUILD_TESTS=ON" + ]; + + postPatch = '' + substituteInPlace CMakeLists.txt \ + --replace-fail "file(STRINGS /etc/os-release LINUX_DISTRO LIMIT_COUNT 1 REGEX \"NAME=\")" "set(LINUX_DISTRO \"NixOS\")" + ''; + + postInstall = '' + find $out/bin -executable -type f -exec \ + patchelf {} --shrink-rpath --allowed-rpath-prefixes "$NIX_STORE" \; + '' + + lib.optionalString buildTests '' + mkdir -p $test + mv $out/bin/rdctst_tests $test/bin + ''; + + passthru.updateScript = rocmUpdateScript { inherit finalAttrs; }; + + meta = { + description = "Simplifies administration and addresses infrastructure challenges in cluster and datacenter environments"; + homepage = "https://github.com/ROCm/rocm-systems/tree/develop/projects/rdc"; + license = lib.licenses.mit; + teams = [ lib.teams.rocm ]; + platforms = lib.platforms.linux; + }; +}) diff --git a/pkgs/development/rocm-modules/10/rdc/fix-cmake-cxxflags.patch b/pkgs/development/rocm-modules/10/rdc/fix-cmake-cxxflags.patch new file mode 100644 index 0000000000000..bf7f3dbb0eef4 --- /dev/null +++ b/pkgs/development/rocm-modules/10/rdc/fix-cmake-cxxflags.patch @@ -0,0 +1,217 @@ +From 92f25181dbf722cb749e445851580df4ea779299 Mon Sep 17 00:00:00 2001 +From: Luna Nova +Date: Sun, 21 Dec 2025 08:01:08 -0800 +Subject: [PATCH 1/2] fix(rdc): set CMAKE_CXX_FLAGS after project() to avoid + clobbering env + +CMAKE_CXX_FLAGS' initial value is set from $CXXFLAGS on project() call +so the previous location ignored CXXFLAGS from env or CMake toolchain +config. + +Ref: https://cmake.org/cmake/help/v4.2/variable/CMAKE_LANG_FLAGS_INIT.html +Fixes: 874a7b438f ("CMAKE - Fix build types") +--- + CMakeLists.txt | 48 +++++++++++++++++++------------------ + 1 file changed, 25 insertions(+), 23 deletions(-) + +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 907c9fbff42..8b386c7be3d 100755 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -55,29 +55,6 @@ set_property( + PROPERTY STRINGS "Debug" "Release" "RelWithDebInfo" "MinSizeRel" + ) + +-# Set compile flags +-set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -m64 -msse -msse2") +-set(CMAKE_CXX_FLAGS_DEBUG +- "${CMAKE_CXX_FLAGS_DEBUG} -O0 -ggdb -DDEBUG" +- CACHE STRING +- "Flags for Debug builds" +-) +-set(CMAKE_CXX_FLAGS_RELEASE +- "${CMAKE_CXX_FLAGS_RELEASE} -O2 -s -DNDEBUG" +- CACHE STRING +- "Flags for Release builds" +-) +-set(CMAKE_CXX_FLAGS_RELWITHDEBINFO +- "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} -O2 -g -DNDEBUG" +- CACHE STRING +- "Flags for RelWithDebInfo builds" +-) +-set(CMAKE_CXX_FLAGS_MINSIZEREL +- "${CMAKE_CXX_FLAGS_MINSIZEREL} -Os -DNDEBUG" +- CACHE STRING +- "Flags for MinSizeRel builds" +-) +- + set(CMAKE_MODULE_PATH + "${CMAKE_CURRENT_SOURCE_DIR}/cmake_modules/" + CACHE INTERNAL +@@ -155,6 +132,31 @@ project(${RDC} VERSION "${VERSION_STRING}" HOMEPAGE_URL "https://github.com/Rade + # this must go after project() + include(GNUInstallDirs) + ++# NB: CMAKE__FLAGS are initialized from environment (CXXFLAGS et al.) ++# during project(). Setting them before project() discards env and toolchain ++# defaults. Cf. CMAKE__FLAGS_INIT for toolchain overrides. ++set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -m64 -msse -msse2") ++set(CMAKE_CXX_FLAGS_DEBUG ++ "${CMAKE_CXX_FLAGS_DEBUG} -O0 -ggdb -DDEBUG" ++ CACHE STRING ++ "Flags for Debug builds" ++) ++set(CMAKE_CXX_FLAGS_RELEASE ++ "${CMAKE_CXX_FLAGS_RELEASE} -O2 -s -DNDEBUG" ++ CACHE STRING ++ "Flags for Release builds" ++) ++set(CMAKE_CXX_FLAGS_RELWITHDEBINFO ++ "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} -O2 -g -DNDEBUG" ++ CACHE STRING ++ "Flags for RelWithDebInfo builds" ++) ++set(CMAKE_CXX_FLAGS_MINSIZEREL ++ "${CMAKE_CXX_FLAGS_MINSIZEREL} -Os -DNDEBUG" ++ CACHE STRING ++ "Flags for MinSizeRel builds" ++) ++ + set(COMMON_DIR "${CMAKE_CURRENT_SOURCE_DIR}/common") + + set(GRPC_ROOT_DEFAULT "/usr") + +From 0c8710c3570963b29c709b1cd1f78b15fd73a950 Mon Sep 17 00:00:00 2001 +From: Luna Nova +Date: Sun, 21 Dec 2025 08:13:04 -0800 +Subject: [PATCH 2/2] fix(rdc): don't reimplement CMake default build type flag + logic + +The previous approach was overly complicated and added nothing. CMake already defaults +similar flags for each of the default supported build types. +Additionally, the previous flags broke AArch64 as -m64 -msse are incompatible. +It's not necessary to explicitly set this with modern toolchains. + +Fixes: 874a7b438f ("CMAKE - Fix build types") +Fixes: bc7f01e992 ("Initial RDC commit") +--- + CMakeLists.txt | 25 +--------------------- + example/CMakeLists.txt | 26 ++--------------------- + tests/example/CMakeLists.txt | 24 +-------------------- + 3 files changed, 4 insertions(+), 71 deletions(-) + +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 8b386c7be3d..251fcddd653 100755 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -132,30 +132,7 @@ project(${RDC} VERSION "${VERSION_STRING}" HOMEPAGE_URL "https://github.com/Rade + # this must go after project() + include(GNUInstallDirs) + +-# NB: CMAKE__FLAGS are initialized from environment (CXXFLAGS et al.) +-# during project(). Setting them before project() discards env and toolchain +-# defaults. Cf. CMAKE__FLAGS_INIT for toolchain overrides. +-set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -m64 -msse -msse2") +-set(CMAKE_CXX_FLAGS_DEBUG +- "${CMAKE_CXX_FLAGS_DEBUG} -O0 -ggdb -DDEBUG" +- CACHE STRING +- "Flags for Debug builds" +-) +-set(CMAKE_CXX_FLAGS_RELEASE +- "${CMAKE_CXX_FLAGS_RELEASE} -O2 -s -DNDEBUG" +- CACHE STRING +- "Flags for Release builds" +-) +-set(CMAKE_CXX_FLAGS_RELWITHDEBINFO +- "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} -O2 -g -DNDEBUG" +- CACHE STRING +- "Flags for RelWithDebInfo builds" +-) +-set(CMAKE_CXX_FLAGS_MINSIZEREL +- "${CMAKE_CXX_FLAGS_MINSIZEREL} -Os -DNDEBUG" +- CACHE STRING +- "Flags for MinSizeRel builds" +-) ++add_compile_options(-Wall -Wextra) + + set(COMMON_DIR "${CMAKE_CURRENT_SOURCE_DIR}/common") + +diff --git a/example/CMakeLists.txt b/example/CMakeLists.txt +index 378a2005818..7c51307ec38 100755 +--- a/example/CMakeLists.txt ++++ b/example/CMakeLists.txt +@@ -31,30 +31,6 @@ cmake_minimum_required(VERSION 3.15) + option(CMAKE_VERBOSE_MAKEFILE "Enable verbose output" ON) + option(CMAKE_EXPORT_COMPILE_COMMANDS "Export compile commands for linters and autocompleters" ON) + +-# Set compile flags +-set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -m64 -msse -msse2") +-set(CMAKE_CXX_FLAGS_DEBUG +- "${CMAKE_CXX_FLAGS_DEBUG} -O0 -ggdb -DDEBUG" +- CACHE STRING +- "Flags for Debug builds" +-) +-# note: no '-s' here unlike other CMakeLists.txt +-set(CMAKE_CXX_FLAGS_RELEASE +- "${CMAKE_CXX_FLAGS_RELEASE} -O2 -DNDEBUG" +- CACHE STRING +- "Flags for Release builds" +-) +-set(CMAKE_CXX_FLAGS_RELWITHDEBINFO +- "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} -O2 -g -DNDEBUG" +- CACHE STRING +- "Flags for RelWithDebInfo builds" +-) +-set(CMAKE_CXX_FLAGS_MINSIZEREL +- "${CMAKE_CXX_FLAGS_MINSIZEREL} -Os -DNDEBUG" +- CACHE STRING +- "Flags for MinSizeRel builds" +-) +- + set(CMAKE_CXX_STANDARD 17 CACHE STRING "The C++ standard to use") + set(CMAKE_CXX_STANDARD_REQUIRED ON) + set(CMAKE_CXX_EXTENSIONS OFF) +@@ -66,6 +42,8 @@ endif() + + project(RDC_example) + ++add_compile_options(-Wall -Wextra) ++ + # provides cmake_print_variables(VAR) + include(CMakePrintHelpers) + +diff --git a/tests/example/CMakeLists.txt b/tests/example/CMakeLists.txt +index d5614f387bd..13c2f3857a1 100755 +--- a/tests/example/CMakeLists.txt ++++ b/tests/example/CMakeLists.txt +@@ -22,29 +22,7 @@ message("&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&") + message(" Cmake Example Lib ") + message("&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&") + +-# Set compile flags +-set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -m64 -msse -msse2") +-set(CMAKE_CXX_FLAGS_DEBUG +- "${CMAKE_CXX_FLAGS_DEBUG} -O0 -ggdb -DDEBUG" +- CACHE STRING +- "Flags for Debug builds" +-) +-# note: no '-s' here unlike other CMakeLists.txt +-set(CMAKE_CXX_FLAGS_RELEASE +- "${CMAKE_CXX_FLAGS_RELEASE} -O2 -DNDEBUG" +- CACHE STRING +- "Flags for Release builds" +-) +-set(CMAKE_CXX_FLAGS_RELWITHDEBINFO +- "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} -O2 -g -DNDEBUG" +- CACHE STRING +- "Flags for RelWithDebInfo builds" +-) +-set(CMAKE_CXX_FLAGS_MINSIZEREL +- "${CMAKE_CXX_FLAGS_MINSIZEREL} -Os -DNDEBUG" +- CACHE STRING +- "Flags for MinSizeRel builds" +-) ++add_compile_options(-Wall -Wextra) + + # Required Defines first: + diff --git a/pkgs/development/rocm-modules/10/rdc/fix-libcap-pkgconfig.patch b/pkgs/development/rocm-modules/10/rdc/fix-libcap-pkgconfig.patch new file mode 100644 index 0000000000000..54e7303ce88f3 --- /dev/null +++ b/pkgs/development/rocm-modules/10/rdc/fix-libcap-pkgconfig.patch @@ -0,0 +1,57 @@ +From 299f2c770ff0abf07b8f394f154168d2aa78aa60 Mon Sep 17 00:00:00 2001 +From: Luna Nova +Date: Sun, 21 Dec 2025 08:23:01 -0800 +Subject: [PATCH] fix(rdc): use pkg-config to find libcap + +If libcap isn't available in system wide FHS include paths building would fail. +Fix this by using pkg-config to find libcap which provides both the library +to link and include dirs. +--- + CMakeLists.txt | 6 +++--- + rdc_libs/rdc/CMakeLists.txt | 2 +- + server/CMakeLists.txt | 2 +- + 3 files changed, 5 insertions(+), 5 deletions(-) + +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 907c9fbff42..00e0a9dd87d 100755 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -192,9 +192,9 @@ mark_as_advanced( + CPACK_GENERATOR + ) + +-# check if libcap exists +-# needed for sys/capabilities.h +-find_library(LIB_CAP NAMES cap REQUIRED) ++# needed for sys/capability.h ++find_package(PkgConfig REQUIRED) ++pkg_check_modules(LIBCAP REQUIRED IMPORTED_TARGET libcap) + + if(BUILD_STANDALONE AND GRPC_ROOT STREQUAL GRPC_ROOT_DEFAULT) + message( +diff --git a/rdc_libs/rdc/CMakeLists.txt b/rdc_libs/rdc/CMakeLists.txt +index d4e368edca5..f9a3ac4c487 100644 +--- a/rdc_libs/rdc/CMakeLists.txt ++++ b/rdc_libs/rdc/CMakeLists.txt +@@ -71,7 +71,7 @@ set(RDC_LIB_INC_LIST + message("RDC_LIB_INC_LIST=${RDC_LIB_INC_LIST}") + + add_library(${RDC_LIB} SHARED ${RDC_LIB_SRC_LIST} ${RDC_LIB_INC_LIST}) +-target_link_libraries(${RDC_LIB} ${BOOTSTRAP_LIB} pthread amd_smi cap) ++target_link_libraries(${RDC_LIB} ${BOOTSTRAP_LIB} pthread amd_smi PkgConfig::LIBCAP) + target_include_directories( + ${RDC_LIB} + PRIVATE "${PROJECT_SOURCE_DIR}" "${PROJECT_SOURCE_DIR}/include" "${AMD_SMI_INCLUDE_DIR}" +diff --git a/server/CMakeLists.txt b/server/CMakeLists.txt +index baf0d851c86..0a6e71dda1c 100755 +--- a/server/CMakeLists.txt ++++ b/server/CMakeLists.txt +@@ -97,7 +97,7 @@ target_link_libraries( + pthread + rt + gRPC::grpc++ +- cap ++ PkgConfig::LIBCAP + dl + amd_smi + rdc_bootstrap diff --git a/pkgs/development/rocm-modules/10/rocdbgapi/default.nix b/pkgs/development/rocm-modules/10/rocdbgapi/default.nix new file mode 100644 index 0000000000000..8cceaa35137b3 --- /dev/null +++ b/pkgs/development/rocm-modules/10/rocdbgapi/default.nix @@ -0,0 +1,109 @@ +{ + lib, + stdenv, + fetchFromGitHub, + rocmUpdateScript, + cmake, + rocm-cmake, + rocm-comgr, + rocm-runtime, + hwdata, + texliveSmall, + doxygen, + graphviz, + writableTmpDirAsHomeHook, + buildDocs ? true, +}: + +let + latex = lib.optionalAttrs buildDocs ( + texliveSmall.withPackages ( + ps: with ps; [ + changepage + latexmk + varwidth + multirow + hanging + adjustbox + collectbox + stackengine + enumitem + alphalph + wasysym + sectsty + tocloft + newunicodechar + etoc + helvetic + wasy + courier + tabularray + ltablex + ninecolors + xltabular + ] + ) + ); +in +stdenv.mkDerivation (finalAttrs: { + pname = "rocdbgapi"; + version = "7.2.4"; + + outputs = [ + "out" + ] + ++ lib.optionals buildDocs [ + "doc" + ]; + + buildFlags = lib.optionals buildDocs [ "doc" ]; + + src = fetchFromGitHub { + owner = "ROCm"; + repo = "ROCdbgapi"; + tag = "rocm-${finalAttrs.version}"; + hash = "sha256-KqvhwfIv8pbr8WbnfAKl71fg5yxbwYcpzZcGU9Htdkc="; + }; + + nativeBuildInputs = [ + cmake + rocm-cmake + ] + ++ lib.optionals buildDocs [ + writableTmpDirAsHomeHook + latex + doxygen + graphviz + ]; + + buildInputs = [ + rocm-comgr + rocm-runtime + hwdata + ]; + + cmakeFlags = [ + "-DPCI_IDS_PATH=${hwdata}/share/hwdata" + # Manually define CMAKE_INSTALL_ + # See: https://github.com/NixOS/nixpkgs/pull/197838 + "-DCMAKE_INSTALL_BINDIR=bin" + "-DCMAKE_INSTALL_LIBDIR=lib" + "-DCMAKE_INSTALL_INCLUDEDIR=include" + ]; + + postInstall = lib.optionalString buildDocs '' + mkdir -p $doc/share/doc/amd-dbgapi/ + mv $out/share/html/amd-dbgapi $doc/share/doc/amd-dbgapi/html + rmdir $out/share/html + ''; + + passthru.updateScript = rocmUpdateScript { inherit finalAttrs; }; + + meta = { + description = "Debugger support for control of execution and inspection state of AMD's GPU architectures"; + homepage = "https://github.com/ROCm/ROCdbgapi"; + license = lib.licenses.mit; + teams = [ lib.teams.rocm ]; + platforms = lib.platforms.linux; + }; +}) diff --git a/pkgs/development/rocm-modules/10/rocgdb/default.nix b/pkgs/development/rocm-modules/10/rocgdb/default.nix new file mode 100644 index 0000000000000..918f624b673d2 --- /dev/null +++ b/pkgs/development/rocm-modules/10/rocgdb/default.nix @@ -0,0 +1,113 @@ +{ + lib, + stdenv, + fetchFromGitHub, + rocmUpdateScript, + pkg-config, + texinfo, + bison, + flex, + glibc, + zlib, + zstd, + gmp, + mpfr, + ncurses, + expat, + rocdbgapi, + perl, + python3, + babeltrace, + sourceHighlight, +}: + +stdenv.mkDerivation (finalAttrs: { + pname = "rocgdb"; + version = "7.2.4"; + + src = fetchFromGitHub { + owner = "ROCm"; + repo = "ROCgdb"; + tag = "rocm-${finalAttrs.version}"; + hash = "sha256-oml/HLExnnjh7+axeWPZRWecpwK2BnzVOaGvXYhrxKs="; + }; + + nativeBuildInputs = [ + pkg-config + texinfo # For makeinfo + bison + flex + perl # used in mkinstalldirs script during installPhase + python3 + ]; + + buildInputs = [ + zlib + zstd + gmp + mpfr + ncurses + expat + rocdbgapi + python3 + babeltrace + sourceHighlight + ]; + + configureFlags = [ + # Ensure we build the amdgpu target + "--enable-targets=${stdenv.targetPlatform.config},amdgcn-amd-amdhsa" + "--with-amd-dbgapi=yes" + + "--with-iconv-path=${glibc.bin}" + "--enable-tui" + "--with-babeltrace=${babeltrace}" + "--with-python=python3" + "--with-system-zlib" + "--with-system-zstd" + "--enable-64-bit-bfd" + "--with-gmp=${gmp.dev}" + "--with-mpfr=${mpfr.dev}" + "--with-expat=${expat}" + + # So the installed binary is called "rocgdb" instead on plain "gdb" + "--program-prefix=roc" + + # Disable building many components not used or incompatible with the amdgcn target + "--disable-sim" + "--disable-gdbserver" + "--disable-ld" + "--disable-gas" + "--disable-gdbserver" + "--disable-gdbtk" + "--disable-gprofng" + "--disable-shared" + ]; + + postPatch = '' + for file in *; do + if [ -f "$file" ]; then + patchShebangs "$file" + fi + done + ''; + + # The source directory for ROCgdb (based on upstream GDB) contains multiple project + # of GNU’s toolchain (binutils and onther), we only need to install the GDB part. + installPhase = '' + make install-gdb + ''; + + env.CFLAGS = "-Wno-switch -Wno-format-nonliteral -I${zstd.dev}/include -I${zlib.dev}/include -I${expat.dev}/include -I${ncurses.dev}/include"; + env.CXXFLAGS = finalAttrs.env.CFLAGS; + + passthru.updateScript = rocmUpdateScript { inherit finalAttrs; }; + + meta = { + description = "ROCm source-level debugger for Linux, based on GDB"; + homepage = "https://github.com/ROCm/ROCgdb"; + license = lib.licenses.gpl3Plus; + teams = [ lib.teams.rocm ]; + platforms = lib.platforms.linux; + }; +}) diff --git a/pkgs/development/rocm-modules/10/rocprof-trace-decoder/default.nix b/pkgs/development/rocm-modules/10/rocprof-trace-decoder/default.nix new file mode 100644 index 0000000000000..3ab1bb6446886 --- /dev/null +++ b/pkgs/development/rocm-modules/10/rocprof-trace-decoder/default.nix @@ -0,0 +1,85 @@ +{ + lib, + stdenv, + fetchFromGitHub, + rocmPackages, + cmake, + python3, + nlohmann_json, + gtest, +}: + +stdenv.mkDerivation (finalAttrs: { + pname = "rocprof-trace-decoder"; + version = "0.1.7"; + + src = fetchFromGitHub { + owner = "ROCm"; + repo = "rocm-systems"; + # No tags (yet?) + rev = "feeca99950c590e0b8228733405c4a1a10fa4773"; + sparseCheckout = [ + "projects/rocprof-trace-decoder" + "shared" + ]; + hash = "sha256-aJhPiZf5380jj2IeCipgcTEQYogr5R19UnVwKRGnkxo="; + }; + + sourceRoot = "${finalAttrs.src.name}/projects/rocprof-trace-decoder"; + + patches = [ + ./use-system-dependencies.patch + # https://github.com/ROCm/rocm-systems/pull/3800 + ./fix-test-dependency.patch + ]; + + strictDeps = true; + + nativeBuildInputs = [ cmake ]; + + buildInputs = [ + rocmPackages.rocm-comgr + rocmPackages.rocm-runtime + ]; + + cmakeFlags = [ + (lib.cmakeBool "BUILD_TESTS" finalAttrs.finalPackage.doCheck) + ]; + + nativeCheckInputs = [ + python3 + ]; + + checkInputs = [ + nlohmann_json + gtest + ]; + + preCheck = '' + patchShebangs test + ''; + + checkPhase = + let + # Sanitize tests fail because the UBSan runtime (__ubsan_vptr_type_cache) is not available for + # LD_PRELOAD in the sandbox. + skipPattern = "_sanitize$"; + in + '' + runHook preCheck + + ctest --test-dir . --output-on-failure -E '${skipPattern}' + + runHook postCheck + ''; + + doCheck = true; + + meta = { + description = "Library for decoding ROCm thread trace data"; + homepage = "https://github.com/ROCm/rocm-systems/tree/develop/projects/rocprof-trace-decoder"; + license = lib.licenses.mit; + teams = [ lib.teams.rocm ]; + platforms = lib.platforms.linux; + }; +}) diff --git a/pkgs/development/rocm-modules/10/rocprof-trace-decoder/fix-test-dependency.patch b/pkgs/development/rocm-modules/10/rocprof-trace-decoder/fix-test-dependency.patch new file mode 100644 index 0000000000000..7278ec688094a --- /dev/null +++ b/pkgs/development/rocm-modules/10/rocprof-trace-decoder/fix-test-dependency.patch @@ -0,0 +1,15 @@ +diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt +index a923cadce53..95a4d3a807f 100644 +--- a/test/CMakeLists.txt ++++ b/test/CMakeLists.txt +@@ -186,7 +186,9 @@ if(BUILD_INTEGRATION_TESTS) + WORKING_DIRECTORY + ${TEST_BIN_DIR} + FIXTURES_REQUIRED +- unpack_data) ++ unpack_data ++ DEPENDS ++ ${DATA}_execute) + endif() + endforeach(DATA) + endif() diff --git a/pkgs/development/rocm-modules/10/rocprof-trace-decoder/use-system-dependencies.patch b/pkgs/development/rocm-modules/10/rocprof-trace-decoder/use-system-dependencies.patch new file mode 100644 index 0000000000000..1f821a1110882 --- /dev/null +++ b/pkgs/development/rocm-modules/10/rocprof-trace-decoder/use-system-dependencies.patch @@ -0,0 +1,81 @@ +diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt +index a923cad..53b0f49 100644 +--- a/test/CMakeLists.txt ++++ b/test/CMakeLists.txt +@@ -34,13 +34,7 @@ if(DISABLE_COMGR) + endif() + + if(NOT APPLE AND BUILD_INTEGRATION_TESTS) +- # Add nlohmann JSON as an external dependency +- include(FetchContent) +- FetchContent_Declare( +- json +- GIT_REPOSITORY https://github.com/nlohmann/json.git +- GIT_TAG v3.11.3) +- FetchContent_MakeAvailable(json) ++ find_package(nlohmann_json REQUIRED) + + add_subdirectory(att-tool) + endif() +diff --git a/test/att-tool/CMakeLists.txt b/test/att-tool/CMakeLists.txt +index 208af16..acd161f 100644 +--- a/test/att-tool/CMakeLists.txt ++++ b/test/att-tool/CMakeLists.txt +@@ -1,7 +1,7 @@ + # + # ATT decoder wrapper library for use by the rocprofv3 tool + # +-find_library(COMGR REQUIRED NAMES amd_comgr HINTS /opt/rocm/lib) ++find_library(COMGR REQUIRED NAMES amd_comgr) + + set(ATT_TOOL_SOURCE_FILES + waitcnt/analysis.cpp +@@ -19,8 +19,11 @@ set(ATT_TOOL_SOURCE_FILES + + set(DECODER_SRC ${CMAKE_CURRENT_SOURCE_DIR}/../../source/) + +-set(INCLUDE_DIRS ${CMAKE_CURRENT_SOURCE_DIR}/../../include/ ${DECODER_SRC} ${CMAKE_CURRENT_SOURCE_DIR} ${json_SOURCE_DIR}/include /opt/rocm/include) +-set(LINK_LIBS ${COMGR} pthread) ++set(INCLUDE_DIRS ${CMAKE_CURRENT_SOURCE_DIR}/../../include/ ${DECODER_SRC} ${CMAKE_CURRENT_SOURCE_DIR}) ++find_path(COMGR_INCLUDE_DIR REQUIRED NAMES amd_comgr.h PATH_SUFFIXES amd_comgr) ++find_path(HSA_INCLUDE_DIR REQUIRED NAMES hsa/amd_hsa_elf.h) ++set(LINK_LIBS ${COMGR} pthread nlohmann_json::nlohmann_json) ++list(APPEND INCLUDE_DIRS ${COMGR_INCLUDE_DIR} ${HSA_INCLUDE_DIR}) + + # Sources re-globbed only for sanitizer builds + file(GLOB ATT_DECODER_V3_FILES +diff --git a/test/att-tool/sdk/disassembly.hpp b/test/att-tool/sdk/disassembly.hpp +index c054143..ec3d6d2 100644 +--- a/test/att-tool/sdk/disassembly.hpp ++++ b/test/att-tool/sdk/disassembly.hpp +@@ -22,7 +22,7 @@ + + #pragma once + +-#include ++#include + #include + + #include +diff --git a/test/unit/CMakeLists.txt b/test/unit/CMakeLists.txt +index 8adafc0..9501efe 100644 +--- a/test/unit/CMakeLists.txt ++++ b/test/unit/CMakeLists.txt +@@ -9,16 +9,7 @@ project(att-decoder-unit-tests LANGUAGES CXX) + set(CMAKE_CXX_STANDARD 17) + set(CMAKE_CXX_STANDARD_REQUIRED ON) + +-# Fetch GoogleTest +-include(FetchContent) +-FetchContent_Declare( +- googletest +- GIT_REPOSITORY https://github.com/google/googletest.git +- GIT_TAG v1.14.0) +-set(INSTALL_GTEST +- OFF +- CACHE BOOL "" FORCE) +-FetchContent_MakeAvailable(googletest) ++find_package(GTest REQUIRED) + + enable_testing() + diff --git a/pkgs/development/rocm-modules/10/rocprofiler-sdk/0001-fix-missing-CPackComponent-cmake-include.patch b/pkgs/development/rocm-modules/10/rocprofiler-sdk/0001-fix-missing-CPackComponent-cmake-include.patch new file mode 100644 index 0000000000000..1e65ac7a76ee5 --- /dev/null +++ b/pkgs/development/rocm-modules/10/rocprofiler-sdk/0001-fix-missing-CPackComponent-cmake-include.patch @@ -0,0 +1,25 @@ +From 5ae420cc204d0afb1ad388ddbceec237a4164569 Mon Sep 17 00:00:00 2001 +From: Anund +Date: Sun, 11 Oct 2026 17:28:05 +1100 +Subject: [PATCH 1/8] fix missing CPackComponent cmake include + +--- + cmake/rocprofiler_config_packaging.cmake | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/cmake/rocprofiler_config_packaging.cmake b/cmake/rocprofiler_config_packaging.cmake +index 84c2ecf230..55d9f58f38 100644 +--- a/cmake/rocprofiler_config_packaging.cmake ++++ b/cmake/rocprofiler_config_packaging.cmake +@@ -126,6 +126,8 @@ endif() + list(APPEND _DEB_PACKAGE_DEPENDS ${ROCPROFILER_CPACK_DEBIAN_PACKAGE_DEPENDS}) + list(APPEND _RPM_PACKAGE_REQUIRES ${ROCPROFILER_CPACK_RPM_PACKAGE_REQUIRES}) + ++include(CPackComponent) ++ + foreach(COMPONENT_GROUP ${ROCPROFILER_COMPONENT_GROUPS}) + set(_DEP "${COMPONENT_DEP_${COMPONENT_GROUP}}") + set(_NAME "${COMPONENT_NAME_${COMPONENT_GROUP}}") +-- +2.55.0 + diff --git a/pkgs/development/rocm-modules/10/rocprofiler-sdk/0002-allow-using-system-yaml-dependency.patch b/pkgs/development/rocm-modules/10/rocprofiler-sdk/0002-allow-using-system-yaml-dependency.patch new file mode 100644 index 0000000000000..3fa335a25eb9a --- /dev/null +++ b/pkgs/development/rocm-modules/10/rocprofiler-sdk/0002-allow-using-system-yaml-dependency.patch @@ -0,0 +1,68 @@ +From 0477671140ffc3d1b50e1cca69f107b51112faa8 Mon Sep 17 00:00:00 2001 +From: Anund +Date: Sun, 11 Oct 2026 17:29:27 +1100 +Subject: [PATCH 2/8] allow using system yaml dependency + +--- + cmake/rocprofiler_options.cmake | 2 ++ + external/CMakeLists.txt | 29 +++++++++++++++++------------ + 2 files changed, 19 insertions(+), 12 deletions(-) + +diff --git a/cmake/rocprofiler_options.cmake b/cmake/rocprofiler_options.cmake +index 08d1032635..faee11049f 100644 +--- a/cmake/rocprofiler_options.cmake ++++ b/cmake/rocprofiler_options.cmake +@@ -65,6 +65,8 @@ rocprofiler_add_option(ROCPROFILER_BUILD_PYBIND11 + "Enable building pybind11 library internally" ON) + rocprofiler_add_option(ROCPROFILER_BUILD_GOTCHA + "Enable building gotcha library internally" ON) ++rocprofiler_add_option(ROCPROFILER_BUILD_YAML_CPP ++ "Enable building yaml-cpp library internally" ON) + if(ROCPROFILER_BUILD_TESTS) + rocprofiler_add_option( + ROCPROFILER_BUILD_GTEST +diff --git a/external/CMakeLists.txt b/external/CMakeLists.txt +index 5bee3dc032..cab59c07bd 100644 +--- a/external/CMakeLists.txt ++++ b/external/CMakeLists.txt +@@ -131,20 +131,25 @@ if(NOT TARGET PTL::ptl-static) + add_subdirectory(ptl EXCLUDE_FROM_ALL) + endif() + +-rocprofiler_checkout_git_submodule( +- RECURSIVE +- RELATIVE_PATH external/yaml-cpp +- WORKING_DIRECTORY ${PROJECT_SOURCE_DIR} +- REPO_URL https://github.com/jbeder/yaml-cpp.git +- REPO_BRANCH "master") ++if(ROCPROFILER_BUILD_YAML_CPP) ++ rocprofiler_checkout_git_submodule( ++ RECURSIVE ++ RELATIVE_PATH external/yaml-cpp ++ WORKING_DIRECTORY ${PROJECT_SOURCE_DIR} ++ REPO_URL https://github.com/jbeder/yaml-cpp.git ++ REPO_BRANCH "master") + +-add_subdirectory(yaml-cpp EXCLUDE_FROM_ALL) ++ add_subdirectory(yaml-cpp EXCLUDE_FROM_ALL) + +-target_link_libraries(rocprofiler-sdk-yaml-cpp +- INTERFACE $) +-target_include_directories( +- rocprofiler-sdk-yaml-cpp +- INTERFACE $) ++ target_link_libraries(rocprofiler-sdk-yaml-cpp ++ INTERFACE $) ++ target_include_directories( ++ rocprofiler-sdk-yaml-cpp ++ INTERFACE $) ++else() ++ find_package(yaml-cpp 0.8.0 REQUIRED) ++ target_link_libraries(rocprofiler-sdk-yaml-cpp INTERFACE yaml-cpp::yaml-cpp) ++endif() + + # checkout submodule if not already checked out or clone repo if no .gitmodules file + rocprofiler_checkout_git_submodule( +-- +2.55.0 + diff --git a/pkgs/development/rocm-modules/10/rocprofiler-sdk/0003-allow-using-system-elfio-dependency.patch b/pkgs/development/rocm-modules/10/rocprofiler-sdk/0003-allow-using-system-elfio-dependency.patch new file mode 100644 index 0000000000000..702f380edb420 --- /dev/null +++ b/pkgs/development/rocm-modules/10/rocprofiler-sdk/0003-allow-using-system-elfio-dependency.patch @@ -0,0 +1,70 @@ +From 27cec58fefe73c26ccca212ebbc002a0b9c1bfa5 Mon Sep 17 00:00:00 2001 +From: Anund +Date: Sun, 11 Oct 2026 17:29:50 +1100 +Subject: [PATCH 3/8] allow using system elfio dependency + +--- + cmake/rocprofiler_options.cmake | 2 ++ + external/CMakeLists.txt | 33 +++++++++++++++++++-------------- + 2 files changed, 21 insertions(+), 14 deletions(-) + +diff --git a/cmake/rocprofiler_options.cmake b/cmake/rocprofiler_options.cmake +index faee11049f..a09af6c2c9 100644 +--- a/cmake/rocprofiler_options.cmake ++++ b/cmake/rocprofiler_options.cmake +@@ -67,6 +67,8 @@ rocprofiler_add_option(ROCPROFILER_BUILD_GOTCHA + "Enable building gotcha library internally" ON) + rocprofiler_add_option(ROCPROFILER_BUILD_YAML_CPP + "Enable building yaml-cpp library internally" ON) ++rocprofiler_add_option(ROCPROFILER_BUILD_ELFIO ++ "Enable building ELFIO library internally" ON) + if(ROCPROFILER_BUILD_TESTS) + rocprofiler_add_option( + ROCPROFILER_BUILD_GTEST +diff --git a/external/CMakeLists.txt b/external/CMakeLists.txt +index cab59c07bd..a75229edf3 100644 +--- a/external/CMakeLists.txt ++++ b/external/CMakeLists.txt +@@ -201,20 +201,25 @@ target_link_libraries( + INTERFACE $) + + # ELFIO +-rocprofiler_checkout_git_submodule( +- RECURSIVE +- RELATIVE_PATH external/elfio +- WORKING_DIRECTORY ${PROJECT_SOURCE_DIR} +- REPO_URL https://github.com/serge1/ELFIO.git +- REPO_BRANCH "Release_3.12") +- +-set(ELFIO_BUILD_EXAMPLES OFF) +-set(ELFIO_BUILD_TESTS OFF) +-add_subdirectory(elfio EXCLUDE_FROM_ALL) +-if(TARGET rocprofiler-sdk-elfio) +- get_target_property(ELFIO_INCLUDE_DIR elfio::elfio INTERFACE_INCLUDE_DIRECTORIES) +- target_include_directories(rocprofiler-sdk-elfio SYSTEM +- INTERFACE ${ELFIO_INCLUDE_DIR}) ++if(ROCPROFILER_BUILD_ELFIO) ++ rocprofiler_checkout_git_submodule( ++ RECURSIVE ++ RELATIVE_PATH external/elfio ++ WORKING_DIRECTORY ${PROJECT_SOURCE_DIR} ++ REPO_URL https://github.com/serge1/ELFIO.git ++ REPO_BRANCH "Release_3.12") ++ ++ set(ELFIO_BUILD_EXAMPLES OFF) ++ set(ELFIO_BUILD_TESTS OFF) ++ add_subdirectory(elfio EXCLUDE_FROM_ALL) ++ if(TARGET rocprofiler-sdk-elfio) ++ get_target_property(ELFIO_INCLUDE_DIR elfio::elfio INTERFACE_INCLUDE_DIRECTORIES) ++ target_include_directories(rocprofiler-sdk-elfio SYSTEM ++ INTERFACE ${ELFIO_INCLUDE_DIR}) ++ endif() ++else() ++ find_package(elfio REQUIRED GLOBAL) ++ target_link_libraries(rocprofiler-sdk-elfio INTERFACE elfio::elfio) + endif() + + # +-- +2.55.0 + diff --git a/pkgs/development/rocm-modules/10/rocprofiler-sdk/0004-allow-using-system-otf2-dependency.patch b/pkgs/development/rocm-modules/10/rocprofiler-sdk/0004-allow-using-system-otf2-dependency.patch new file mode 100644 index 0000000000000..61a2888f79f8c --- /dev/null +++ b/pkgs/development/rocm-modules/10/rocprofiler-sdk/0004-allow-using-system-otf2-dependency.patch @@ -0,0 +1,54 @@ +From d2c8a5872c8d2af1bc8c203ad75f7c1c83cfb919 Mon Sep 17 00:00:00 2001 +From: Anund +Date: Sun, 11 Oct 2026 17:30:13 +1100 +Subject: [PATCH 4/8] allow using system otf2 dependency + +--- + cmake/rocprofiler_options.cmake | 2 ++ + external/CMakeLists.txt | 17 +++++++++-------- + 2 files changed, 11 insertions(+), 8 deletions(-) + +diff --git a/cmake/rocprofiler_options.cmake b/cmake/rocprofiler_options.cmake +index a09af6c2c9..19e092df06 100644 +--- a/cmake/rocprofiler_options.cmake ++++ b/cmake/rocprofiler_options.cmake +@@ -69,6 +69,8 @@ rocprofiler_add_option(ROCPROFILER_BUILD_YAML_CPP + "Enable building yaml-cpp library internally" ON) + rocprofiler_add_option(ROCPROFILER_BUILD_ELFIO + "Enable building ELFIO library internally" ON) ++rocprofiler_add_option(ROCPROFILER_BUILD_OTF2 ++ "Enable building OTF2 library internally" ON) + if(ROCPROFILER_BUILD_TESTS) + rocprofiler_add_option( + ROCPROFILER_BUILD_GTEST +diff --git a/external/CMakeLists.txt b/external/CMakeLists.txt +index a75229edf3..e1be3df85e 100644 +--- a/external/CMakeLists.txt ++++ b/external/CMakeLists.txt +@@ -225,14 +225,15 @@ endif() + # + # OTF2 + # +-add_subdirectory(otf2) +- +-rocprofiler_checkout_git_submodule( +- RECURSIVE +- RELATIVE_PATH external/json +- WORKING_DIRECTORY ${PROJECT_SOURCE_DIR} +- REPO_URL https://github.com/nlohmann/json.git +- REPO_BRANCH "develop") ++if(ROCPROFILER_BUILD_OTF2) ++ add_subdirectory(otf2) ++else() ++ find_package(PkgConfig REQUIRED) ++ pkg_check_modules(OTF2 REQUIRED IMPORTED_TARGET otf2) ++ add_library(otf2 INTERFACE) ++ add_library(otf2::otf2 ALIAS otf2) ++ target_link_libraries(otf2 INTERFACE PkgConfig::OTF2) ++endif() + + # + # JSON +-- +2.55.0 + diff --git a/pkgs/development/rocm-modules/10/rocprofiler-sdk/0005-allow-using-system-json-dependency.patch b/pkgs/development/rocm-modules/10/rocprofiler-sdk/0005-allow-using-system-json-dependency.patch new file mode 100644 index 0000000000000..b6cb539682c45 --- /dev/null +++ b/pkgs/development/rocm-modules/10/rocprofiler-sdk/0005-allow-using-system-json-dependency.patch @@ -0,0 +1,54 @@ +From 3c42b2a8491b44fa58940fcd44b45c64f1b43cf1 Mon Sep 17 00:00:00 2001 +From: Anund +Date: Sun, 11 Oct 2026 17:30:36 +1100 +Subject: [PATCH 5/8] allow using system json dependency + +--- + cmake/rocprofiler_options.cmake | 2 ++ + external/CMakeLists.txt | 17 +++++++++++++++++ + 2 files changed, 19 insertions(+) + +diff --git a/cmake/rocprofiler_options.cmake b/cmake/rocprofiler_options.cmake +index 19e092df06..b7a7a6cbdd 100644 +--- a/cmake/rocprofiler_options.cmake ++++ b/cmake/rocprofiler_options.cmake +@@ -71,6 +71,8 @@ rocprofiler_add_option(ROCPROFILER_BUILD_ELFIO + "Enable building ELFIO library internally" ON) + rocprofiler_add_option(ROCPROFILER_BUILD_OTF2 + "Enable building OTF2 library internally" ON) ++rocprofiler_add_option(ROCPROFILER_BUILD_JSON ++ "Enable building JSON library internally" ON) + if(ROCPROFILER_BUILD_TESTS) + rocprofiler_add_option( + ROCPROFILER_BUILD_GTEST +diff --git a/external/CMakeLists.txt b/external/CMakeLists.txt +index e1be3df85e..a282232f22 100644 +--- a/external/CMakeLists.txt ++++ b/external/CMakeLists.txt +@@ -243,6 +243,23 @@ target_include_directories( + rocprofiler-sdk-json SYSTEM + INTERFACE $) + ++if(ROCPROFILER_BUILD_JSON) ++ rocprofiler_checkout_git_submodule( ++ RECURSIVE ++ RELATIVE_PATH external/json ++ WORKING_DIRECTORY ${PROJECT_SOURCE_DIR} ++ REPO_URL https://github.com/nlohmann/json.git ++ REPO_BRANCH "develop") ++ ++ add_subdirectory(json) ++ target_include_directories( ++ rocprofiler-sdk-json SYSTEM ++ INTERFACE $) ++else() ++ find_package(nlohmann_json REQUIRED GLOBAL) ++ target_link_libraries(rocprofiler-sdk-json INTERFACE nlohmann_json::nlohmann_json) ++endif() ++ + # + # SQLite3 + # +-- +2.55.0 + diff --git a/pkgs/development/rocm-modules/10/rocprofiler-sdk/0006-fix-amd-comgr-resolution.patch b/pkgs/development/rocm-modules/10/rocprofiler-sdk/0006-fix-amd-comgr-resolution.patch new file mode 100644 index 0000000000000..03103ec734619 --- /dev/null +++ b/pkgs/development/rocm-modules/10/rocprofiler-sdk/0006-fix-amd-comgr-resolution.patch @@ -0,0 +1,154 @@ +From 9977c287e106d9c494546212a3544e238363e219 Mon Sep 17 00:00:00 2001 +From: Anund +Date: Sun, 11 Oct 2026 16:52:24 +1100 +Subject: [PATCH 6/8] fix amd-comgr resolution + +--- + .../lib/att-tool/waitcnt/tests/CMakeLists.txt | 1 + + source/lib/python/utilities.cmake | 3 ++- + .../counters/tests/CMakeLists.txt | 2 ++ + .../pc_sampling/parser/tests/CMakeLists.txt | 20 ++++++++++++++----- + .../lib/rocprofiler-sdk/tests/CMakeLists.txt | 2 ++ + .../thread_trace/tests/CMakeLists.txt | 1 + + 6 files changed, 23 insertions(+), 6 deletions(-) + +diff --git a/source/lib/att-tool/waitcnt/tests/CMakeLists.txt b/source/lib/att-tool/waitcnt/tests/CMakeLists.txt +index 8a13e80cbe..48b3debc93 100644 +--- a/source/lib/att-tool/waitcnt/tests/CMakeLists.txt ++++ b/source/lib/att-tool/waitcnt/tests/CMakeLists.txt +@@ -10,6 +10,7 @@ target_link_libraries( + rocprofiler-sdk::rocprofiler-sdk-common-library + rocprofiler-sdk::rocprofiler-sdk-glog + rocprofiler-sdk::rocprofiler-sdk-static-library ++ rocprofiler-sdk::rocprofiler-sdk-amd-comgr + GTest::gtest + GTest::gtest_main) + target_sources(att-decoder-waitcnt-test PRIVATE att_decoder_waitcnt_test.cpp) +diff --git a/source/lib/python/utilities.cmake b/source/lib/python/utilities.cmake +index 1bc9171a3e..21bc9cfb3d 100644 +--- a/source/lib/python/utilities.cmake ++++ b/source/lib/python/utilities.cmake +@@ -209,7 +209,8 @@ function(rocprofiler_rocpd_python_bindings _VERSION) + rocprofiler-sdk::rocprofiler-sdk-gotcha + rocprofiler-sdk::rocprofiler-sdk-dw + rocprofiler-sdk::rocprofiler-sdk-static-library +- rocprofiler-sdk::rocprofiler-sdk-rocpd-library) ++ rocprofiler-sdk::rocprofiler-sdk-rocpd-library ++ rocprofiler-sdk::rocprofiler-sdk-amd-comgr) + + # if "Development" is specified instead of "Development.Module", we need to link to + # python libraries +diff --git a/source/lib/rocprofiler-sdk/counters/tests/CMakeLists.txt b/source/lib/rocprofiler-sdk/counters/tests/CMakeLists.txt +index 5e0d73e0f0..38251a7acc 100644 +--- a/source/lib/rocprofiler-sdk/counters/tests/CMakeLists.txt ++++ b/source/lib/rocprofiler-sdk/counters/tests/CMakeLists.txt +@@ -51,6 +51,7 @@ target_sources( + target_link_libraries( + counter_test_constants + PRIVATE rocprofiler-sdk::rocprofiler-sdk-common-library ++ rocprofiler-sdk::rocprofiler-sdk-amd-comgr + rocprofiler-sdk::rocprofiler-sdk-static-library + rocprofiler-sdk::rocprofiler-sdk-hip + rocprofiler-sdk::rocprofiler-sdk-hsa-runtime) +@@ -73,6 +74,7 @@ target_link_libraries( + rocprofiler-sdk::rocprofiler-sdk-hsa-runtime + rocprofiler-sdk::rocprofiler-sdk-hip + rocprofiler-sdk::rocprofiler-sdk-common-library ++ rocprofiler-sdk::rocprofiler-sdk-amd-comgr + rocprofiler-sdk::rocprofiler-sdk-static-library + GTest::gtest + GTest::gtest_main) +diff --git a/source/lib/rocprofiler-sdk/pc_sampling/parser/tests/CMakeLists.txt b/source/lib/rocprofiler-sdk/pc_sampling/parser/tests/CMakeLists.txt +index 1c512054d6..3bb64572e1 100644 +--- a/source/lib/rocprofiler-sdk/pc_sampling/parser/tests/CMakeLists.txt ++++ b/source/lib/rocprofiler-sdk/pc_sampling/parser/tests/CMakeLists.txt +@@ -30,7 +30,9 @@ target_include_directories(pcs_gfx9_test PRIVATE ${PCTEST_INCLUDE_DIR}) + target_link_libraries( + pcs_gfx9_test + PRIVATE rocprofiler-sdk::rocprofiler-sdk-common-library +- rocprofiler-sdk::rocprofiler-sdk-static-library GTest::gtest ++ rocprofiler-sdk::rocprofiler-sdk-amd-comgr ++ rocprofiler-sdk::rocprofiler-sdk-static-library ++ GTest::gtest + GTest::gtest_main) + + gtest_add_tests( +@@ -52,7 +54,9 @@ target_include_directories(pcs_id_test PRIVATE ${PCTEST_INCLUDE_DIR}) + target_link_libraries( + pcs_id_test + PRIVATE rocprofiler-sdk::rocprofiler-sdk-common-library +- rocprofiler-sdk::rocprofiler-sdk-static-library GTest::gtest ++ rocprofiler-sdk::rocprofiler-sdk-amd-comgr ++ rocprofiler-sdk::rocprofiler-sdk-static-library ++ GTest::gtest + GTest::gtest_main) + + gtest_add_tests( +@@ -75,7 +79,9 @@ target_include_directories(pcs_bench_test PRIVATE ${PCTEST_INCLUDE_DIR}) + target_link_libraries( + pcs_bench_test + PRIVATE rocprofiler-sdk::rocprofiler-sdk-common-library +- rocprofiler-sdk::rocprofiler-sdk-static-library GTest::gtest ++ rocprofiler-sdk::rocprofiler-sdk-amd-comgr ++ rocprofiler-sdk::rocprofiler-sdk-static-library ++ GTest::gtest + GTest::gtest_main) + + add_executable(pcs_thread_test) +@@ -88,7 +94,9 @@ target_include_directories(pcs_thread_test PRIVATE ${PCTEST_INCLUDE_DIR}) + target_link_libraries( + pcs_thread_test + PRIVATE rocprofiler-sdk::rocprofiler-sdk-common-library +- rocprofiler-sdk::rocprofiler-sdk-static-library GTest::gtest ++ rocprofiler-sdk::rocprofiler-sdk-amd-comgr ++ rocprofiler-sdk::rocprofiler-sdk-static-library ++ GTest::gtest + GTest::gtest_main) + + gtest_add_tests( +@@ -111,7 +119,9 @@ target_include_directories(pcs_gfx12_test PRIVATE ${PCTEST_INCLUDE_DIR}) + target_link_libraries( + pcs_gfx12_test + PRIVATE rocprofiler-sdk::rocprofiler-sdk-common-library +- rocprofiler-sdk::rocprofiler-sdk-static-library GTest::gtest ++ rocprofiler-sdk::rocprofiler-sdk-amd-comgr ++ rocprofiler-sdk::rocprofiler-sdk-static-library ++ GTest::gtest + GTest::gtest_main) + + gtest_add_tests( +diff --git a/source/lib/rocprofiler-sdk/tests/CMakeLists.txt b/source/lib/rocprofiler-sdk/tests/CMakeLists.txt +index d71aa7c297..70dfe3376d 100644 +--- a/source/lib/rocprofiler-sdk/tests/CMakeLists.txt ++++ b/source/lib/rocprofiler-sdk/tests/CMakeLists.txt +@@ -28,6 +28,7 @@ target_sources(rocprofiler-sdk-lib-tests PRIVATE ${rocprofiler_lib_sources} + target_link_libraries( + rocprofiler-sdk-lib-tests + PRIVATE rocprofiler-sdk::rocprofiler-sdk-static-library ++ rocprofiler-sdk::rocprofiler-sdk-amd-comgr + rocprofiler-sdk::rocprofiler-sdk-common-library + rocprofiler-sdk::counter-test-constants + rocprofiler-sdk::rocprofiler-sdk-hsa-runtime +@@ -59,6 +60,7 @@ target_sources(rocprofiler-sdk-lib-tests-shared PRIVATE ${rocprofiler_shared_lib + target_link_libraries( + rocprofiler-sdk-lib-tests-shared + PRIVATE rocprofiler-sdk::rocprofiler-sdk-shared-library ++ rocprofiler-sdk::rocprofiler-sdk-amd-comgr + rocprofiler-sdk::rocprofiler-sdk-common-library + rocprofiler-sdk::rocprofiler-sdk-hsa-runtime + rocprofiler-sdk::rocprofiler-sdk-drm +diff --git a/source/lib/rocprofiler-sdk/thread_trace/tests/CMakeLists.txt b/source/lib/rocprofiler-sdk/thread_trace/tests/CMakeLists.txt +index 62acae39fb..7e867ba0a7 100644 +--- a/source/lib/rocprofiler-sdk/thread_trace/tests/CMakeLists.txt ++++ b/source/lib/rocprofiler-sdk/thread_trace/tests/CMakeLists.txt +@@ -14,6 +14,7 @@ target_link_libraries( + rocprofiler-sdk::rocprofiler-sdk-glog + rocprofiler-sdk::rocprofiler-sdk-hsa-runtime + rocprofiler-sdk::rocprofiler-sdk-hip ++ rocprofiler-sdk::rocprofiler-sdk-amd-comgr + rocprofiler-sdk::rocprofiler-sdk-common-library + GTest::gtest + GTest::gtest_main +-- +2.55.0 + diff --git a/pkgs/development/rocm-modules/10/rocprofiler-sdk/0007-fix-missing-includes-and-api-changes-with-fmt-v12.2..patch b/pkgs/development/rocm-modules/10/rocprofiler-sdk/0007-fix-missing-includes-and-api-changes-with-fmt-v12.2..patch new file mode 100644 index 0000000000000..970e2a89b67d4 --- /dev/null +++ b/pkgs/development/rocm-modules/10/rocprofiler-sdk/0007-fix-missing-includes-and-api-changes-with-fmt-v12.2..patch @@ -0,0 +1,260 @@ +From eb68d5d6dcdb085dc3d8d18576fee7cf998f6512 Mon Sep 17 00:00:00 2001 +From: Anund +Date: Sun, 11 Oct 2026 16:59:59 +1100 +Subject: [PATCH 7/8] fix missing includes and api changes with fmt v12.2.0 + +--- + source/lib/common/logging.cpp | 1 + + source/lib/output/generateRocpd.cpp | 1 + + source/lib/output/generateStats.cpp | 1 + + source/lib/output/metadata.cpp | 1 - + source/lib/output/metadata.hpp | 2 +- + source/lib/output/sql/common.hpp | 1 + + source/lib/python/rocpd/libpyrocpd.cpp | 1 + + source/lib/python/rocpd/source/serialization/sql.cpp | 3 +++ + source/lib/python/rocpd/source/sql_generator.hpp | 3 +++ + source/lib/rocprofiler-sdk-tool/tool.cpp | 3 ++- + source/lib/rocprofiler-sdk/counters/tests/device_counting.cpp | 1 + + source/lib/rocprofiler-sdk/counters/tests/dimension.cpp | 1 + + source/lib/rocprofiler-sdk/hip/details/format.hpp | 4 ++-- + source/lib/rocprofiler-sdk/hsa/aql_packet.cpp | 2 +- + source/lib/rocprofiler-sdk/hsa/details/fmt.hpp | 3 +++ + source/lib/rocprofiler-sdk/ompt.cpp | 2 +- + .../pc_sampling/parser/pc_record_interface.cpp | 2 ++ + source/lib/tests/common/parse.cpp | 1 + + 18 files changed, 26 insertions(+), 7 deletions(-) + +diff --git a/source/lib/common/logging.cpp b/source/lib/common/logging.cpp +index 6c07322b06..24aecbc23d 100644 +--- a/source/lib/common/logging.cpp ++++ b/source/lib/common/logging.cpp +@@ -25,6 +25,7 @@ + #include "lib/common/filesystem.hpp" + + #include ++#include + #include + #include + +diff --git a/source/lib/output/generateRocpd.cpp b/source/lib/output/generateRocpd.cpp +index 564a9bd45f..65d9a5d7cf 100644 +--- a/source/lib/output/generateRocpd.cpp ++++ b/source/lib/output/generateRocpd.cpp +@@ -56,6 +56,7 @@ + #include + + #include ++#include + #include + #include + +diff --git a/source/lib/output/generateStats.cpp b/source/lib/output/generateStats.cpp +index 22c1a7f425..3860be129b 100644 +--- a/source/lib/output/generateStats.cpp ++++ b/source/lib/output/generateStats.cpp +@@ -33,6 +33,7 @@ + #include + + #include ++#include + + #include + #include +diff --git a/source/lib/output/metadata.cpp b/source/lib/output/metadata.cpp +index abe9e00b50..f68d46de5b 100644 +--- a/source/lib/output/metadata.cpp ++++ b/source/lib/output/metadata.cpp +@@ -41,7 +41,6 @@ + #include + #include + +-#include + #include + + #include +diff --git a/source/lib/output/metadata.hpp b/source/lib/output/metadata.hpp +index 069401f962..a283896f29 100644 +--- a/source/lib/output/metadata.hpp ++++ b/source/lib/output/metadata.hpp +@@ -45,7 +45,7 @@ + #include + #include + +-#include ++#include + + #include + #include +diff --git a/source/lib/output/sql/common.hpp b/source/lib/output/sql/common.hpp +index 40fb8df9a8..97f96e06c4 100644 +--- a/source/lib/output/sql/common.hpp ++++ b/source/lib/output/sql/common.hpp +@@ -29,6 +29,7 @@ + #include "lib/common/units.hpp" + + #include ++#include + #include + + #include +diff --git a/source/lib/python/rocpd/libpyrocpd.cpp b/source/lib/python/rocpd/libpyrocpd.cpp +index 009afd694b..8ad4eb3458 100644 +--- a/source/lib/python/rocpd/libpyrocpd.cpp ++++ b/source/lib/python/rocpd/libpyrocpd.cpp +@@ -55,6 +55,7 @@ + #include + + #include ++#include + #include + #include + #include +diff --git a/source/lib/python/rocpd/source/serialization/sql.cpp b/source/lib/python/rocpd/source/serialization/sql.cpp +index d10e878be5..9192abc45b 100644 +--- a/source/lib/python/rocpd/source/serialization/sql.cpp ++++ b/source/lib/python/rocpd/source/serialization/sql.cpp +@@ -23,6 +23,9 @@ + #include "lib/python/rocpd/source/serialization/sql.hpp" + #include "lib/output/sql/common.hpp" + ++#include ++#include ++ + namespace cereal + { + SQLite3InputArchive::SQLite3InputArchive(sqlite3* conn, +diff --git a/source/lib/python/rocpd/source/sql_generator.hpp b/source/lib/python/rocpd/source/sql_generator.hpp +index 6284857afb..881ad23a72 100644 +--- a/source/lib/python/rocpd/source/sql_generator.hpp ++++ b/source/lib/python/rocpd/source/sql_generator.hpp +@@ -38,6 +38,9 @@ + #include + #include + ++#include ++#include ++ + namespace rocpd + { + namespace tool = ::rocprofiler::tool; +diff --git a/source/lib/rocprofiler-sdk-tool/tool.cpp b/source/lib/rocprofiler-sdk-tool/tool.cpp +index 7b03fa3eb8..6ddb2274e5 100644 +--- a/source/lib/rocprofiler-sdk-tool/tool.cpp ++++ b/source/lib/rocprofiler-sdk-tool/tool.cpp +@@ -78,7 +78,8 @@ + #include + #include + +-#include ++#include ++#include + + #include + #include +diff --git a/source/lib/rocprofiler-sdk/counters/tests/device_counting.cpp b/source/lib/rocprofiler-sdk/counters/tests/device_counting.cpp +index 9587b219f3..d82a6ec40b 100644 +--- a/source/lib/rocprofiler-sdk/counters/tests/device_counting.cpp ++++ b/source/lib/rocprofiler-sdk/counters/tests/device_counting.cpp +@@ -39,6 +39,7 @@ + #include + + #include ++#include + #include + #include + #include +diff --git a/source/lib/rocprofiler-sdk/counters/tests/dimension.cpp b/source/lib/rocprofiler-sdk/counters/tests/dimension.cpp +index 387c167bd0..22fcda9bf7 100644 +--- a/source/lib/rocprofiler-sdk/counters/tests/dimension.cpp ++++ b/source/lib/rocprofiler-sdk/counters/tests/dimension.cpp +@@ -39,6 +39,7 @@ + #include + + #include ++#include + #include + #include + #include +diff --git a/source/lib/rocprofiler-sdk/hip/details/format.hpp b/source/lib/rocprofiler-sdk/hip/details/format.hpp +index f65cf016a6..46f734d65d 100644 +--- a/source/lib/rocprofiler-sdk/hip/details/format.hpp ++++ b/source/lib/rocprofiler-sdk/hip/details/format.hpp +@@ -31,8 +31,8 @@ + #include + #include + +-#include "fmt/core.h" +-#include "fmt/ranges.h" ++#include ++#include + + #define ROCP_SDK_HIP_FORMATTER(TYPE, ...) \ + template <> \ +diff --git a/source/lib/rocprofiler-sdk/hsa/aql_packet.cpp b/source/lib/rocprofiler-sdk/hsa/aql_packet.cpp +index f1c0c3a56e..389a182e9d 100644 +--- a/source/lib/rocprofiler-sdk/hsa/aql_packet.cpp ++++ b/source/lib/rocprofiler-sdk/hsa/aql_packet.cpp +@@ -21,7 +21,7 @@ + // THE SOFTWARE. + + #include "lib/rocprofiler-sdk/hsa/aql_packet.hpp" +-#include ++#include + #include + #include + #include "lib/common/logging.hpp" +diff --git a/source/lib/rocprofiler-sdk/hsa/details/fmt.hpp b/source/lib/rocprofiler-sdk/hsa/details/fmt.hpp +index c136a2739c..f0d7d9e94f 100644 +--- a/source/lib/rocprofiler-sdk/hsa/details/fmt.hpp ++++ b/source/lib/rocprofiler-sdk/hsa/details/fmt.hpp +@@ -22,6 +22,9 @@ + + #include "lib/rocprofiler-sdk/hsa/queue.hpp" + ++#include ++#include ++ + namespace fmt + { + template <> +diff --git a/source/lib/rocprofiler-sdk/ompt.cpp b/source/lib/rocprofiler-sdk/ompt.cpp +index a9ccc571c8..0d7166465a 100644 +--- a/source/lib/rocprofiler-sdk/ompt.cpp ++++ b/source/lib/rocprofiler-sdk/ompt.cpp +@@ -31,7 +31,7 @@ + #include + #include + +-#include ++#include + #include + #include + +diff --git a/source/lib/rocprofiler-sdk/pc_sampling/parser/pc_record_interface.cpp b/source/lib/rocprofiler-sdk/pc_sampling/parser/pc_record_interface.cpp +index 8d418df50e..a4163529c1 100644 +--- a/source/lib/rocprofiler-sdk/pc_sampling/parser/pc_record_interface.cpp ++++ b/source/lib/rocprofiler-sdk/pc_sampling/parser/pc_record_interface.cpp +@@ -24,6 +24,8 @@ + + #include "lib/common/utility.hpp" + ++#include ++ + template <> + uint64_t + PCSamplingParserContext::alloc( +diff --git a/source/lib/tests/common/parse.cpp b/source/lib/tests/common/parse.cpp +index 5e3b63c85f..ccfc0912bc 100644 +--- a/source/lib/tests/common/parse.cpp ++++ b/source/lib/tests/common/parse.cpp +@@ -23,6 +23,7 @@ + #include + + #include ++#include + #include + + #include +-- +2.55.0 + diff --git a/pkgs/development/rocm-modules/10/rocprofiler-sdk/0008-fix-compilation-errors-from-missing-includes.patch b/pkgs/development/rocm-modules/10/rocprofiler-sdk/0008-fix-compilation-errors-from-missing-includes.patch new file mode 100644 index 0000000000000..ab694273ab2c2 --- /dev/null +++ b/pkgs/development/rocm-modules/10/rocprofiler-sdk/0008-fix-compilation-errors-from-missing-includes.patch @@ -0,0 +1,93 @@ +From 3346d7d75513445c19f04a9e972216522752e469 Mon Sep 17 00:00:00 2001 +From: Anund +Date: Sun, 11 Oct 2026 17:00:20 +1100 +Subject: [PATCH 8/8] fix compilation errors from missing includes + +--- + source/lib/att-tool/att_lib_wrapper.hpp | 2 ++ + source/lib/att-tool/wave.hpp | 1 + + source/lib/rocprofiler-sdk-rocpd/sql.cpp | 1 + + source/lib/rocprofiler-sdk/counters/metrics.cpp | 1 + + source/lib/rocprofiler-sdk/counters/metrics.hpp | 1 + + source/lib/rocprofiler-sdk/tests/status.cpp | 1 + + 6 files changed, 7 insertions(+) + +diff --git a/source/lib/att-tool/att_lib_wrapper.hpp b/source/lib/att-tool/att_lib_wrapper.hpp +index e7e58c5991..7dcd000a43 100644 +--- a/source/lib/att-tool/att_lib_wrapper.hpp ++++ b/source/lib/att-tool/att_lib_wrapper.hpp +@@ -28,9 +28,11 @@ + #include + + #include ++#include + #include + #include + #include ++#include + #include + + namespace rocprofiler +diff --git a/source/lib/att-tool/wave.hpp b/source/lib/att-tool/wave.hpp +index 1a7b1adda6..65686d8ea3 100644 +--- a/source/lib/att-tool/wave.hpp ++++ b/source/lib/att-tool/wave.hpp +@@ -29,6 +29,7 @@ + #include "waitcnt/analysis.hpp" + #include "wstates.hpp" + ++#include + #include + #include + #include +diff --git a/source/lib/rocprofiler-sdk-rocpd/sql.cpp b/source/lib/rocprofiler-sdk-rocpd/sql.cpp +index b052ec51c3..7e8742686e 100644 +--- a/source/lib/rocprofiler-sdk-rocpd/sql.cpp ++++ b/source/lib/rocprofiler-sdk-rocpd/sql.cpp +@@ -39,6 +39,7 @@ + #include + + #include ++#include + #include + #include + +diff --git a/source/lib/rocprofiler-sdk/counters/metrics.cpp b/source/lib/rocprofiler-sdk/counters/metrics.cpp +index 201ae4fd25..4780a0ba31 100644 +--- a/source/lib/rocprofiler-sdk/counters/metrics.cpp ++++ b/source/lib/rocprofiler-sdk/counters/metrics.cpp +@@ -45,6 +45,7 @@ + #include // for dladdr + #include + #include ++#include + #include + #include + +diff --git a/source/lib/rocprofiler-sdk/counters/metrics.hpp b/source/lib/rocprofiler-sdk/counters/metrics.hpp +index 7915bc8805..a893c2c9b3 100644 +--- a/source/lib/rocprofiler-sdk/counters/metrics.hpp ++++ b/source/lib/rocprofiler-sdk/counters/metrics.hpp +@@ -35,6 +35,7 @@ + #include + #include + #include ++#include + + namespace rocprofiler + { +diff --git a/source/lib/rocprofiler-sdk/tests/status.cpp b/source/lib/rocprofiler-sdk/tests/status.cpp +index a5a492101d..b01f511b99 100644 +--- a/source/lib/rocprofiler-sdk/tests/status.cpp ++++ b/source/lib/rocprofiler-sdk/tests/status.cpp +@@ -25,6 +25,7 @@ + + #include + ++#include + #include + + TEST(rocprofiler_lib, error_string) +-- +2.55.0 + diff --git a/pkgs/development/rocm-modules/10/rocprofiler-sdk/0009-rocprofiler-sdk-guard-ompt-auto-start.patch b/pkgs/development/rocm-modules/10/rocprofiler-sdk/0009-rocprofiler-sdk-guard-ompt-auto-start.patch new file mode 100644 index 0000000000000..147d79483318e --- /dev/null +++ b/pkgs/development/rocm-modules/10/rocprofiler-sdk/0009-rocprofiler-sdk-guard-ompt-auto-start.patch @@ -0,0 +1,50 @@ +From 502d2df0ddd84f0f2fa718b9a02ee0f01f36dac1 Mon Sep 17 00:00:00 2001 +From: Luna Nova +Date: Tue, 2 Jun 2026 01:31:05 -0700 +Subject: [PATCH] [rocprofiler-sdk] don't auto-start OMPT tool before glog is + initialized + +The OpenMP runtime resolves its weak ompt_start_tool to the strong symbol we +export and calls it during OpenMP init. That can fire from an unrelated +library's constructor (observed: OpenBLAS calling omp_get_num_places) while +librocprofiler-sdk is still being dlopen'd. init_logging() then dereferences +glog's gflags FLAGS_vmodule, whose backing pointer is still null until glog's +static initializers run, and the process segfaults on `import torch`. + +The init order is not reliably fixable from here: a dependency cycle among the +ROCm libraries makes the loader run our constructors before libglog's, so a +flag set by our own constructor does not imply glog is ready. Instead gate the +tool start on glog itself, by testing whether gflags has populated FLAGS_vmodule +yet; reading the raw pointer is safe even before construction. It is read via an +asm label because the gflags header only exposes it as a reference, which the +compiler assumes is never null. Declining (nullptr) when glog is not yet ready +is a valid OMPT "no tool" response; deliberate profiling (rocprofv3 preloads the +tool early, before such constructors) is unaffected. +--- + source/lib/rocprofiler-sdk/ompt.cpp | 4 ++++ + 1 file changed, 4 insertions(+) + +diff --git a/source/lib/rocprofiler-sdk/ompt.cpp b/source/lib/rocprofiler-sdk/ompt.cpp +index a9ccc57..3231087 100644 +--- a/source/lib/rocprofiler-sdk/ompt.cpp ++++ b/source/lib/rocprofiler-sdk/ompt.cpp +@@ -199,6 +199,8 @@ finalize_ompt() + } // namespace ompt + } // namespace rocprofiler + ++extern void* const rocprofiler_glog_vmodule_flag asm("_ZN3fLS13FLAGS_vmoduleB5cxx11E"); ++ + extern "C" { + + rocprofiler_status_t +@@ -245,6 +247,8 @@ ompt_start_tool(unsigned int omp_version, const char* runtime_version) ROCPROFIL + ompt_start_tool_result_t* + ompt_start_tool(unsigned int omp_version, const char* runtime_version) + { ++ if(rocprofiler_glog_vmodule_flag == nullptr) return nullptr; ++ + ::rocprofiler::registration::init_logging(); + ::rocprofiler::registration::initialize(); + return rocprofiler_ompt_start_tool(omp_version, runtime_version); +-- +2.54.0 diff --git a/pkgs/development/rocm-modules/10/rocprofiler-sdk/default.nix b/pkgs/development/rocm-modules/10/rocprofiler-sdk/default.nix new file mode 100644 index 0000000000000..a93c5e93c4e3e --- /dev/null +++ b/pkgs/development/rocm-modules/10/rocprofiler-sdk/default.nix @@ -0,0 +1,226 @@ +{ + lib, + stdenv, + fetchFromGitHub, + cmake, + ninja, + pkg-config, + clr, + rocm-cmake, + rocm-runtime, + rocprofiler-register, + rocprof-trace-decoder, + aqlprofile, + rocm-comgr, + rocmUpdateScript, + rccl, + python3, + python3Packages, + libdrm, + elfutils, + sqlite, + otf2, + zlib, + zstd, + xz, + numactl, + fmt, + glog, + gtest, + fetchpatch, + yaml-cpp, + elfio, + nlohmann_json, + makeWrapper, + gpuTargets ? (clr.localGpuTargets or clr.gpuTargets), + buildTests ? false, + buildSamples ? false, +}: + +# FIXME: devendor remaining git submodules: +# external/cereal -> https://github.com/jrmadsen/cereal +# external/gotcha -> https://github.com/jrmadsen/GOTCHA +# external/perfetto -> https://github.com/google/perfetto +# external/ptl -> https://github.com/jrmadsen/PTL + +# rocprofiler-sdk is the home of rocprofv3 +stdenv.mkDerivation (finalAttrs: { + pname = "rocprofiler-sdk"; + version = "7.2.4"; + + outputs = [ + "out" + "dev" + ]; + + src = fetchFromGitHub { + owner = "ROCm"; + repo = "rocm-systems"; + tag = "rocm-${finalAttrs.version}"; + hash = "sha256-7XCxu917Mgp3SQAKlTWj3ympgwOYW3aJFcOv/GhPk1c="; + fetchSubmodules = true; + sparseCheckout = [ + "projects/rocprofiler-sdk" + ]; + }; + sourceRoot = "${finalAttrs.src.name}/projects/rocprofiler-sdk"; + + strictDeps = true; + + nativeBuildInputs = [ + cmake + ninja + pkg-config + clr + python3 + makeWrapper + ]; + + buildInputs = [ + clr + rocm-cmake + rocm-runtime + rocprofiler-register + aqlprofile + rocm-comgr + libdrm + elfutils + sqlite + otf2 + zlib + zstd + xz + numactl + fmt + glog + gtest + yaml-cpp + elfio + nlohmann_json + rccl + python3Packages.pybind11 + ]; + + patches = [ + (fetchpatch { + # Fix missing amd_comgr linkage in pc-sampling integration test + url = "https://github.com/ROCm/rocm-systems/commit/94a4595a5d02bc066f7a32e1b2134a99a5231213.patch"; + hash = "sha256-86Fx0bKL0pvXTwVN8QJL+yzCbMYkmMaKzcU4PYcW6ig="; + relative = "projects/rocprofiler-sdk"; + }) + ] + ++ [ + # Just the missing CPackComponent reference sourced from this commit: + # https://github.com/ROCm/rocm-systems/commit/86ee7b2eb2273adaf1181ef9a6b2091465c6f0c7 + ./0001-fix-missing-CPackComponent-cmake-include.patch + ] + ++ [ + # Can be removed when a release contains the changes found in this pr: + # https://github.com/ROCm/rocm-systems/pull/4721 + ./0002-allow-using-system-yaml-dependency.patch + ./0003-allow-using-system-elfio-dependency.patch + ./0004-allow-using-system-otf2-dependency.patch + ./0005-allow-using-system-json-dependency.patch + ./0006-fix-amd-comgr-resolution.patch + ] + ++ [ + # Sourced from several commits that address issues with fmt, dropping conflicting changes no longer needed to build + # https://github.com/ROCm/rocm-systems/commit/36d9d33d90879bfbd406498011070ebd929a56b1 + # https://github.com/ROCm/rocm-systems/commit/e2f588592ecfb0653ed5b3078753186325adf70a + # https://github.com/ROCm/rocm-systems/commit/86ee7b2eb2273adaf1181ef9a6b2091465c6f0c7 (just the fmt changes) + ./0007-fix-missing-includes-and-api-changes-with-fmt-v12.2..patch + ] + ++ [ + # One new import failure added to source commit: + # https://github.com/ROCm/rocm-systems/pull/4721/changes/f7f24a54cbe55425fbefc87c7a3d0f4c85224948 + # which is also part of https://github.com/ROCm/rocm-systems/pull/4721 + ./0008-fix-compilation-errors-from-missing-includes.patch + ] + ++ [ + # Prevent a segfault on `import torch` (and other consumers that link + # librocprofiler-sdk for tracing) when OpenMP auto-discovers our + # ompt_start_tool before glog is initialized. Upstream incidentally fixes + # this by dropping glog in rocm-systems d80117889b3f + # "[rocprofiler-sdk] Migrate from glog to Abseil Logging (#4668)", which + # is too invasive (40 files + new abseil submodule) to backport. + ./0009-rocprofiler-sdk-guard-ompt-auto-start.patch + ]; + + postPatch = '' + # NixOS' ROCm distribution does not support libomptarget yet + substituteInPlace samples/CMakeLists.txt \ + --replace-fail 'add_subdirectory(openmp_target)' '# add_subdirectory(openmp_target)' + substituteInPlace tests/CMakeLists.txt \ + --replace-fail 'add_subdirectory(openmp-tools)' '# add_subdirectory(openmp-tools)' + substituteInPlace tests/bin/CMakeLists.txt \ + --replace-fail 'add_subdirectory(openmp)' '# add_subdirectory(openmp)' + + # This requires building perfetto's trace-processor-shell via a weird external script + substituteInPlace tests/CMakeLists.txt \ + --replace-fail 'add_subdirectory(pytest-packages)' "" + + patchShebangs source/libexec/rocprofiler-sdk/rocprofiler-sdk-launch-compiler/rocprofiler-sdk-launch-compiler.sh + ''; + + cmakeFlags = [ + (lib.cmakeBool "ROCPROFILER_BUILD_GHC_FS" false) + (lib.cmakeBool "ROCPROFILER_BUILD_FMT" false) + (lib.cmakeBool "ROCPROFILER_BUILD_GLOG" false) + (lib.cmakeBool "ROCPROFILER_BUILD_GTEST" false) + (lib.cmakeBool "ROCPROFILER_BUILD_PYBIND11" false) + (lib.cmakeBool "ROCPROFILER_BUILD_YAML_CPP" false) + (lib.cmakeBool "ROCPROFILER_BUILD_ELFIO" false) + (lib.cmakeBool "ROCPROFILER_BUILD_OTF2" false) + (lib.cmakeBool "ROCPROFILER_BUILD_JSON" false) + (lib.cmakeBool "ROCPROFILER_BUILD_TESTS" buildTests) + (lib.cmakeBool "ROCPROFILER_BUILD_SAMPLES" buildSamples) + (lib.cmakeBool "ROCPROFILER_BUILD_BENCHMARK" false) + (lib.cmakeBool "ROCPROFILER_BUILD_WERROR" false) + # rocprofiler-sdk's CMake file doesn't add this dependency properly. + "-DCMAKE_HIP_FLAGS=-I${rocm-runtime}/include" + "-DCMAKE_INSTALL_BINDIR=bin" + "-DCMAKE_INSTALL_LIBDIR=lib" + "-DCMAKE_INSTALL_INCLUDEDIR=include" + # Required for rocprofiler-sdk-launch-compiler.sh + "-DCMAKE_INSTALL_LIBEXECDIR=libexec" + "--debug-find-pkg=amd_comgr" + "--trace-source=tests/pc_sampling/CMakeLists.txt" + "--trace-expand" + ] + ++ lib.optionals (buildTests || buildSamples) [ + # rocprofiler-sdk normally doesn't depend on which GPU is in the system, only when + # building tests or samples. + (lib.cmakeFeature "GPU_TARGETS" (lib.concatStringsSep ";" gpuTargets)) + ]; + cxxCMakeFlags = [ + "-Wno-unused-variable" + ]; + + doCheck = false; # Requires GPU + + postFixup = '' + patchelf $out/lib/*.so \ + --add-rpath ${aqlprofile}/lib \ + --add-needed libhsa-amd-aqlprofile64.so + + wrapProgram $out/bin/rocprofv3 --add-flags "--att-library-path ${ + lib.makeLibraryPath [ rocprof-trace-decoder ] + }" + ''; + + postInstall = '' + mkdir -p $dev/lib $dev/share/rocprofiler-sdk + mv $out/lib/cmake $dev/lib/ + mv $out/share/rocprofiler-sdk/{samples,tests} $dev/share/rocprofiler-sdk/ + ''; + + passthru.updateScript = rocmUpdateScript { inherit finalAttrs; }; + + meta = { + description = "ROCm GPU performance analysis SDK"; + homepage = "https://github.com/ROCm/rocprofiler-sdk"; + license = lib.licenses.mit; + teams = [ lib.teams.rocm ]; + platforms = lib.platforms.linux; + }; +}) diff --git a/pkgs/development/rocm-modules/10/rocprofiler/default.nix b/pkgs/development/rocm-modules/10/rocprofiler/default.nix new file mode 100644 index 0000000000000..02500210e2d2b --- /dev/null +++ b/pkgs/development/rocm-modules/10/rocprofiler/default.nix @@ -0,0 +1,141 @@ +{ + lib, + stdenv, + fetchFromGitHub, + rocmUpdateScript, + symlinkJoin, + cmake, + clang, + clr, + aqlprofile, + rocm-core, + rocm-runtime, + rocm-device-libs, + roctracer, + rocdbgapi, + numactl, + libpciaccess, + libxml2, + llvm, + elfutils, + mpi, + gtest, + python3Packages, + gpuTargets ? clr.localGpuTargets or clr.gpuTargets, +}: + +let + rocmtoolkit-merged = symlinkJoin { + name = "rocmtoolkit-merged"; + + paths = [ + rocm-core + rocm-runtime + rocm-device-libs + roctracer + rocdbgapi + clr + ]; + + postBuild = '' + rm -rf $out/nix-support + ''; + }; +in +stdenv.mkDerivation (finalAttrs: { + pname = "rocprofiler"; + version = "7.2.4"; + + src = fetchFromGitHub { + owner = "ROCm"; + repo = "rocm-systems"; + tag = "rocm-${finalAttrs.version}"; + sparseCheckout = [ + "projects/rocprofiler" + "shared" + ]; + fetchSubmodules = true; + hash = "sha256-Wo0pymD8LsrdczdIUEEVe5x2Id//KIFkh40kliAQgWo="; + }; + sourceRoot = "${finalAttrs.src.name}/projects/rocprofiler"; + + nativeBuildInputs = [ + cmake + clang + clr + python3Packages.lxml + python3Packages.cppheaderparser + python3Packages.pyyaml + python3Packages.barectf + python3Packages.pandas + ]; + + buildInputs = [ + llvm.clang-unwrapped + llvm.llvm + numactl + libpciaccess + libxml2 + elfutils + mpi + gtest + aqlprofile + ]; + + propagatedBuildInputs = [ rocmtoolkit-merged ]; + + #HACK: rocprofiler's cmake doesn't add these deps properly + env.CXXFLAGS = "-I${libpciaccess}/include -I${numactl.dev}/include -I${rocmtoolkit-merged}/include -I${elfutils.dev}/include -w"; + + cmakeFlags = [ + "-DCMAKE_MODULE_PATH=${clr}/lib/cmake/hip" + "-DHIP_ROOT_DIR=${clr}" + "-DGPU_TARGETS=${lib.concatStringsSep ";" gpuTargets}" + # Manually define CMAKE_INSTALL_ + # See: https://github.com/NixOS/nixpkgs/pull/197838 + "-DCMAKE_INSTALL_BINDIR=bin" + "-DCMAKE_INSTALL_LIBDIR=lib" + "-DCMAKE_INSTALL_INCLUDEDIR=include" + ]; + + postPatch = '' + patchShebangs . + + substituteInPlace cmake_modules/rocprofiler_utils.cmake \ + --replace-fail 'function(ROCPROFILER_CHECKOUT_GIT_SUBMODULE)' 'function(ROCPROFILER_CHECKOUT_GIT_SUBMODULE) + return()' + + substituteInPlace CMakeLists.txt \ + --replace-fail 'set(ROCPROFILER_BUILD_TESTS ON)' "" + + substituteInPlace tests-v2/featuretests/profiler/CMakeLists.txt \ + --replace "--build-id=sha1" "--build-id=sha1 --rocm-path=${clr} --rocm-device-lib-path=${rocm-device-libs}/amdgcn/bitcode" + + substituteInPlace test/CMakeLists.txt \ + --replace "\''${ROCM_ROOT_DIR}/amdgcn/bitcode" "${rocm-device-libs}/amdgcn/bitcode" + ''; + + postInstall = '' + # Why do these have the executable bit set? + chmod -x $out/libexec/rocprofiler/counters/*.xml + # rocprof shell script wants to find it in the same bin dir, easiest to symlink in + ln -s ${clr}/bin/rocm_agent_enumerator $out/bin/rocm_agent_enumerator + ''; + + postFixup = '' + patchelf $out/lib/*.so \ + --add-rpath ${aqlprofile}/lib \ + --add-needed libhsa-amd-aqlprofile64.so + ''; + + passthru.updateScript = rocmUpdateScript { inherit finalAttrs; }; + passthru.rocmtoolkit-merged = rocmtoolkit-merged; + + meta = { + description = "Profiling with perf-counters and derived metrics"; + homepage = "https://github.com/ROCm/rocm-systems/tree/develop/projects/rocprofiler"; + license = lib.licenses.mit; # mitx11 + teams = [ lib.teams.rocm ]; + platforms = lib.platforms.linux; + }; +}) diff --git a/pkgs/development/rocm-modules/10/rocr-debug-agent/default.nix b/pkgs/development/rocm-modules/10/rocr-debug-agent/default.nix new file mode 100644 index 0000000000000..a153ff75e2847 --- /dev/null +++ b/pkgs/development/rocm-modules/10/rocr-debug-agent/default.nix @@ -0,0 +1,55 @@ +{ + lib, + stdenv, + fetchFromGitHub, + rocmUpdateScript, + cmake, + python3, + clr, + rocdbgapi, + elfutils, +}: + +stdenv.mkDerivation (finalAttrs: { + pname = "rocr-debug-agent"; + version = "7.2.4"; + + src = fetchFromGitHub { + owner = "ROCm"; + repo = "rocr_debug_agent"; + tag = "rocm-${finalAttrs.version}"; + hash = "sha256-w2Zg4kpuKy68DkVGsBTUsjRZoV/Y/Z3Q8s0oSIR3Ask="; + }; + + nativeBuildInputs = [ + cmake + clr + python3 # TODO: check for scripts that need patchShebangs in output + ]; + + buildInputs = [ + rocdbgapi + elfutils + ]; + + cmakeFlags = [ + "-DCMAKE_MODULE_PATH=${clr}/lib/cmake/hip" + "-DHIP_ROOT_DIR=${clr}" + "-DHIP_PATH=${clr}" + ]; + + # Weird install target + postInstall = '' + rm -rf $out/src + ''; + + passthru.updateScript = rocmUpdateScript { inherit finalAttrs; }; + + meta = { + description = "Library that provides some debugging functionality for ROCr"; + homepage = "https://github.com/ROCm/rocr_debug_agent"; + license = lib.licenses.ncsa; + teams = [ lib.teams.rocm ]; + platforms = lib.platforms.linux; + }; +}) diff --git a/pkgs/development/rocm-modules/10/rocshmem/default.nix b/pkgs/development/rocm-modules/10/rocshmem/default.nix new file mode 100644 index 0000000000000..33c8f4cce5a46 --- /dev/null +++ b/pkgs/development/rocm-modules/10/rocshmem/default.nix @@ -0,0 +1,69 @@ +{ + lib, + stdenv, + fetchFromGitHub, + rocmUpdateScript, + cmake, + rocm-cmake, + rocm-core, + rocm-runtime, + clr, + mpi, + useMpi ? true, + useReverseOffload ? useMpi, + buildExamples ? false, + gpuTargets ? (clr.localGpuTargets or [ ]), +}: + +stdenv.mkDerivation (finalAttrs: { + pname = "rocshmem${clr.gpuArchSuffix}"; + version = "7.2.4"; + + src = fetchFromGitHub { + owner = "ROCm"; + repo = "rocSHMEM"; + tag = "rocm-${finalAttrs.version}"; + hash = "sha256-7TiUABwCVPvosoLdR8zN+QGiX+OD7iD+HKMLnGMmRYA="; + }; + + nativeBuildInputs = [ + cmake + rocm-cmake + clr + ]; + + buildInputs = [ + rocm-runtime + ] + ++ lib.optionals useMpi [ + mpi + ]; + + cmakeFlags = [ + (lib.cmakeBool "CMAKE_POSITION_INDEPENDENT_CODE" true) + (lib.cmakeFeature "CMAKE_CXX_COMPILER" "hipcc") + (lib.cmakeFeature "ROCM_PATH" "${clr}") + (lib.cmakeFeature "ROCM_VERSION" rocm-core.ROCM_LIBPATCH_VERSION) + (lib.cmakeBool "USE_IPC" true) + (lib.cmakeBool "USE_RO" useReverseOffload) + (lib.cmakeBool "USE_SINGLE_NODE" (!useMpi)) + (lib.cmakeBool "USE_EXTERNAL_MPI" useMpi) + (lib.cmakeBool "BUILD_EXAMPLES" buildExamples) + (lib.cmakeFeature "CMAKE_INSTALL_BINDIR" "bin") + (lib.cmakeFeature "CMAKE_INSTALL_LIBDIR" "lib") + (lib.cmakeFeature "CMAKE_INSTALL_INCLUDEDIR" "include") + ] + ++ lib.optionals (gpuTargets != [ ]) [ + (lib.cmakeFeature "GPU_TARGETS" (lib.concatStringsSep ";" gpuTargets)) + ]; + + passthru.updateScript = rocmUpdateScript { inherit finalAttrs; }; + + meta = { + description = "The ROCm OpenSHMEM (rocSHMEM) runtime"; + homepage = "https://github.com/ROCm/rocSHMEM"; + license = lib.licenses.mit; + teams = [ lib.teams.rocm ]; + platforms = lib.platforms.linux; + }; +}) From f7a6fe36c2e9f802eff42a31865709232834e073 Mon Sep 17 00:00:00 2001 From: randomizedcoder Date: Thu, 22 Oct 2026 07:18:53 -0700 Subject: [PATCH 02/12] rocmPackages_10: share rocprof-compute-viewer, mscclpp with rocmPackages rocprof-compute-viewer, mscclpp are unchanged between ROCm 7.2.4 and 10.1 (no 10.x upstream release, or versioned independently of ROCm), so the rocmPackages_10 scope calls the existing expression instead of copying it. Assisted-by: Claude Code (claude-opus-5-5) --- pkgs/development/rocm-modules/10/default.nix | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/pkgs/development/rocm-modules/10/default.nix b/pkgs/development/rocm-modules/10/default.nix index fc71188cf36b6..6adebf4b7c681 100644 --- a/pkgs/development/rocm-modules/10/default.nix +++ b/pkgs/development/rocm-modules/10/default.nix @@ -82,8 +82,12 @@ let inherit (llvm) clang; }; + rocprof-compute-viewer = self.callPackage ../rocprof-compute-viewer { }; + roctracer = self.callPackage ./roctracer { }; + mscclpp = self.callPackage ../mscclpp { }; + half = self.callPackage ./half { }; # Even if config.rocmSupport is false we need rocmSupport true From 714d302a59ac40fee7211e2c10da6d6a497432e1 Mon Sep 17 00:00:00 2001 From: randomizedcoder Date: Thu, 22 Oct 2026 07:18:54 -0700 Subject: [PATCH 03/12] rocmPackages_10.aqlprofile: init at 10.1 Update the rocmPackages.aqlprofile copy from the previous commit to ROCm 10.1 and add it to the rocmPackages_10 scope. Source/version bump only. Assisted-by: Claude Code (claude-opus-5-5) --- pkgs/development/rocm-modules/10/aqlprofile/default.nix | 6 +++--- pkgs/development/rocm-modules/10/default.nix | 2 ++ 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/pkgs/development/rocm-modules/10/aqlprofile/default.nix b/pkgs/development/rocm-modules/10/aqlprofile/default.nix index 34b1d92f3d57f..84e13ff75271a 100644 --- a/pkgs/development/rocm-modules/10/aqlprofile/default.nix +++ b/pkgs/development/rocm-modules/10/aqlprofile/default.nix @@ -9,17 +9,17 @@ stdenv.mkDerivation (finalAttrs: { pname = "aqlprofile"; - version = "7.2.4"; + version = "10.1"; src = fetchFromGitHub { owner = "ROCm"; repo = "rocm-systems"; - tag = "rocm-${finalAttrs.version}"; + tag = "therock-${finalAttrs.version}"; sparseCheckout = [ "projects/aqlprofile" "shared" ]; - hash = "sha256-74HjB5Ughu17rSRx9mfCCsPJI4TVyXnT4aU7vIbm7ak="; + hash = "sha256-7yeEJoyShSCwy1MTCeArYBabh5qTVm5uZL8N74rvxPA="; }; sourceRoot = "${finalAttrs.src.name}/projects/aqlprofile"; diff --git a/pkgs/development/rocm-modules/10/default.nix b/pkgs/development/rocm-modules/10/default.nix index 6adebf4b7c681..853eb103d4520 100644 --- a/pkgs/development/rocm-modules/10/default.nix +++ b/pkgs/development/rocm-modules/10/default.nix @@ -63,6 +63,8 @@ let inherit (self) rocmUpdateScript; }; + aqlprofile = self.callPackage ./aqlprofile { }; + rocm-docs-core = python3Packages.callPackage ../rocm-docs-core { }; hip-common = self.callPackage ./hip-common { }; From ccf1430f94cd469c525f1e99395a37fe87ffb6ba Mon Sep 17 00:00:00 2001 From: randomizedcoder Date: Thu, 22 Oct 2026 07:18:54 -0700 Subject: [PATCH 04/12] rocmPackages_10.rocprof-trace-decoder: init at 0.2.2 Update the rocmPackages.rocprof-trace-decoder copy from the previous commit to ROCm 10.1 and add it to the rocmPackages_10 scope. From "rocmPackages.rocprof-trace-decoder: 0.1.7 -> 0.2.2": Track the rocm-systems monorepo at the therock-10.1 tag (the project keeps its own 0.x version, so the tag cannot derive from finalAttrs.version). Drop both local patches: use-system-dependencies.patch is obsolete (upstream removed the json FetchContent and prefers system gtest) and fix-test-dependency.patch (PR #3800) is merged upstream. Disable the ATT integration tests, which need pyelftools and bundled fixtures. From "rocmPackages.rocprof-trace-decoder: take comgr and runtime from the scope": It took the top-level rocmPackages and used rocmPackages.rocm-comgr and rocmPackages.rocm-runtime, so the per-arch scopes (rocmPackages.gfx906, ...) and any other instance of the scope built it against the default set's libraries. Take them as scope arguments like every other package. The default rocmPackages.rocprof-trace-decoder derivation is unchanged. Assisted-by: Claude Code (claude-opus-5-5) --- pkgs/development/rocm-modules/10/default.nix | 2 + .../10/rocprof-trace-decoder/default.nix | 25 +++--- .../fix-test-dependency.patch | 15 ---- .../use-system-dependencies.patch | 81 ------------------- 4 files changed, 14 insertions(+), 109 deletions(-) delete mode 100644 pkgs/development/rocm-modules/10/rocprof-trace-decoder/fix-test-dependency.patch delete mode 100644 pkgs/development/rocm-modules/10/rocprof-trace-decoder/use-system-dependencies.patch diff --git a/pkgs/development/rocm-modules/10/default.nix b/pkgs/development/rocm-modules/10/default.nix index 853eb103d4520..a11712cb371a3 100644 --- a/pkgs/development/rocm-modules/10/default.nix +++ b/pkgs/development/rocm-modules/10/default.nix @@ -86,6 +86,8 @@ let rocprof-compute-viewer = self.callPackage ../rocprof-compute-viewer { }; + rocprof-trace-decoder = self.callPackage ./rocprof-trace-decoder { }; + roctracer = self.callPackage ./roctracer { }; mscclpp = self.callPackage ../mscclpp { }; diff --git a/pkgs/development/rocm-modules/10/rocprof-trace-decoder/default.nix b/pkgs/development/rocm-modules/10/rocprof-trace-decoder/default.nix index 3ab1bb6446886..77eaa6dc1e31d 100644 --- a/pkgs/development/rocm-modules/10/rocprof-trace-decoder/default.nix +++ b/pkgs/development/rocm-modules/10/rocprof-trace-decoder/default.nix @@ -2,7 +2,8 @@ lib, stdenv, fetchFromGitHub, - rocmPackages, + rocm-comgr, + rocm-runtime, cmake, python3, nlohmann_json, @@ -11,39 +12,37 @@ stdenv.mkDerivation (finalAttrs: { pname = "rocprof-trace-decoder"; - version = "0.1.7"; + version = "0.2.2"; src = fetchFromGitHub { owner = "ROCm"; repo = "rocm-systems"; - # No tags (yet?) - rev = "feeca99950c590e0b8228733405c4a1a10fa4773"; + # rocprof-trace-decoder keeps its own 0.x version, so the rocm-systems + # monorepo tag cannot be derived from finalAttrs.version like sibling packages. + rev = "therock-10.1"; sparseCheckout = [ "projects/rocprof-trace-decoder" "shared" ]; - hash = "sha256-aJhPiZf5380jj2IeCipgcTEQYogr5R19UnVwKRGnkxo="; + hash = "sha256-0cbkljtw/gZJwXPUpJuLXpQlXfR/MQgEGbLDsRdzpcw="; }; sourceRoot = "${finalAttrs.src.name}/projects/rocprof-trace-decoder"; - patches = [ - ./use-system-dependencies.patch - # https://github.com/ROCm/rocm-systems/pull/3800 - ./fix-test-dependency.patch - ]; - strictDeps = true; nativeBuildInputs = [ cmake ]; buildInputs = [ - rocmPackages.rocm-comgr - rocmPackages.rocm-runtime + rocm-comgr + rocm-runtime ]; cmakeFlags = [ (lib.cmakeBool "BUILD_TESTS" finalAttrs.finalPackage.doCheck) + # The ATT integration tests need the pyelftools python module + # and bundled trace-data fixtures; keep the unit tests, skip integration. + (lib.cmakeBool "BUILD_INTEGRATION_TESTS" false) ]; nativeCheckInputs = [ diff --git a/pkgs/development/rocm-modules/10/rocprof-trace-decoder/fix-test-dependency.patch b/pkgs/development/rocm-modules/10/rocprof-trace-decoder/fix-test-dependency.patch deleted file mode 100644 index 7278ec688094a..0000000000000 --- a/pkgs/development/rocm-modules/10/rocprof-trace-decoder/fix-test-dependency.patch +++ /dev/null @@ -1,15 +0,0 @@ -diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt -index a923cadce53..95a4d3a807f 100644 ---- a/test/CMakeLists.txt -+++ b/test/CMakeLists.txt -@@ -186,7 +186,9 @@ if(BUILD_INTEGRATION_TESTS) - WORKING_DIRECTORY - ${TEST_BIN_DIR} - FIXTURES_REQUIRED -- unpack_data) -+ unpack_data -+ DEPENDS -+ ${DATA}_execute) - endif() - endforeach(DATA) - endif() diff --git a/pkgs/development/rocm-modules/10/rocprof-trace-decoder/use-system-dependencies.patch b/pkgs/development/rocm-modules/10/rocprof-trace-decoder/use-system-dependencies.patch deleted file mode 100644 index 1f821a1110882..0000000000000 --- a/pkgs/development/rocm-modules/10/rocprof-trace-decoder/use-system-dependencies.patch +++ /dev/null @@ -1,81 +0,0 @@ -diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt -index a923cad..53b0f49 100644 ---- a/test/CMakeLists.txt -+++ b/test/CMakeLists.txt -@@ -34,13 +34,7 @@ if(DISABLE_COMGR) - endif() - - if(NOT APPLE AND BUILD_INTEGRATION_TESTS) -- # Add nlohmann JSON as an external dependency -- include(FetchContent) -- FetchContent_Declare( -- json -- GIT_REPOSITORY https://github.com/nlohmann/json.git -- GIT_TAG v3.11.3) -- FetchContent_MakeAvailable(json) -+ find_package(nlohmann_json REQUIRED) - - add_subdirectory(att-tool) - endif() -diff --git a/test/att-tool/CMakeLists.txt b/test/att-tool/CMakeLists.txt -index 208af16..acd161f 100644 ---- a/test/att-tool/CMakeLists.txt -+++ b/test/att-tool/CMakeLists.txt -@@ -1,7 +1,7 @@ - # - # ATT decoder wrapper library for use by the rocprofv3 tool - # --find_library(COMGR REQUIRED NAMES amd_comgr HINTS /opt/rocm/lib) -+find_library(COMGR REQUIRED NAMES amd_comgr) - - set(ATT_TOOL_SOURCE_FILES - waitcnt/analysis.cpp -@@ -19,8 +19,11 @@ set(ATT_TOOL_SOURCE_FILES - - set(DECODER_SRC ${CMAKE_CURRENT_SOURCE_DIR}/../../source/) - --set(INCLUDE_DIRS ${CMAKE_CURRENT_SOURCE_DIR}/../../include/ ${DECODER_SRC} ${CMAKE_CURRENT_SOURCE_DIR} ${json_SOURCE_DIR}/include /opt/rocm/include) --set(LINK_LIBS ${COMGR} pthread) -+set(INCLUDE_DIRS ${CMAKE_CURRENT_SOURCE_DIR}/../../include/ ${DECODER_SRC} ${CMAKE_CURRENT_SOURCE_DIR}) -+find_path(COMGR_INCLUDE_DIR REQUIRED NAMES amd_comgr.h PATH_SUFFIXES amd_comgr) -+find_path(HSA_INCLUDE_DIR REQUIRED NAMES hsa/amd_hsa_elf.h) -+set(LINK_LIBS ${COMGR} pthread nlohmann_json::nlohmann_json) -+list(APPEND INCLUDE_DIRS ${COMGR_INCLUDE_DIR} ${HSA_INCLUDE_DIR}) - - # Sources re-globbed only for sanitizer builds - file(GLOB ATT_DECODER_V3_FILES -diff --git a/test/att-tool/sdk/disassembly.hpp b/test/att-tool/sdk/disassembly.hpp -index c054143..ec3d6d2 100644 ---- a/test/att-tool/sdk/disassembly.hpp -+++ b/test/att-tool/sdk/disassembly.hpp -@@ -22,7 +22,7 @@ - - #pragma once - --#include -+#include - #include - - #include -diff --git a/test/unit/CMakeLists.txt b/test/unit/CMakeLists.txt -index 8adafc0..9501efe 100644 ---- a/test/unit/CMakeLists.txt -+++ b/test/unit/CMakeLists.txt -@@ -9,16 +9,7 @@ project(att-decoder-unit-tests LANGUAGES CXX) - set(CMAKE_CXX_STANDARD 17) - set(CMAKE_CXX_STANDARD_REQUIRED ON) - --# Fetch GoogleTest --include(FetchContent) --FetchContent_Declare( -- googletest -- GIT_REPOSITORY https://github.com/google/googletest.git -- GIT_TAG v1.14.0) --set(INSTALL_GTEST -- OFF -- CACHE BOOL "" FORCE) --FetchContent_MakeAvailable(googletest) -+find_package(GTest REQUIRED) - - enable_testing() - From d6929991aea7ee8e3dcf6645ec7683cafa9f1718 Mon Sep 17 00:00:00 2001 From: randomizedcoder Date: Thu, 22 Oct 2026 07:18:55 -0700 Subject: [PATCH 05/12] rocmPackages_10.rocdbgapi: init at 10.1 Update the rocmPackages.rocdbgapi copy from the previous commit to ROCm 10.1 and add it to the rocmPackages_10 scope. From "rocmPackages.{rocdbgapi,rocr-debug-agent}: move to rocm-systems monorepo": ROCdbgapi and rocr_debug_agent moved into the rocm-systems monorepo in ROCm 10. Switch both to the sparse-checkout source (projects/ + shared) at the therock-10.1 tag. Assisted-by: Claude Code (claude-opus-5-5) --- pkgs/development/rocm-modules/10/default.nix | 2 ++ .../rocm-modules/10/rocdbgapi/default.nix | 14 ++++++++++---- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/pkgs/development/rocm-modules/10/default.nix b/pkgs/development/rocm-modules/10/default.nix index a11712cb371a3..76ea49641bb1a 100644 --- a/pkgs/development/rocm-modules/10/default.nix +++ b/pkgs/development/rocm-modules/10/default.nix @@ -90,6 +90,8 @@ let roctracer = self.callPackage ./roctracer { }; + rocdbgapi = self.callPackage ./rocdbgapi { }; + mscclpp = self.callPackage ../mscclpp { }; half = self.callPackage ./half { }; diff --git a/pkgs/development/rocm-modules/10/rocdbgapi/default.nix b/pkgs/development/rocm-modules/10/rocdbgapi/default.nix index 8cceaa35137b3..c0014ac9a3640 100644 --- a/pkgs/development/rocm-modules/10/rocdbgapi/default.nix +++ b/pkgs/development/rocm-modules/10/rocdbgapi/default.nix @@ -47,7 +47,7 @@ let in stdenv.mkDerivation (finalAttrs: { pname = "rocdbgapi"; - version = "7.2.4"; + version = "10.1"; outputs = [ "out" @@ -60,10 +60,16 @@ stdenv.mkDerivation (finalAttrs: { src = fetchFromGitHub { owner = "ROCm"; - repo = "ROCdbgapi"; - tag = "rocm-${finalAttrs.version}"; - hash = "sha256-KqvhwfIv8pbr8WbnfAKl71fg5yxbwYcpzZcGU9Htdkc="; + # ROCdbgapi lives in the rocm-systems monorepo since ROCm 10 + repo = "rocm-systems"; + tag = "therock-${finalAttrs.version}"; + sparseCheckout = [ + "projects/rocdbgapi" + "shared" + ]; + hash = "sha256-vadmzQL3Sqtbtf7vMKCN6jabBuxnugPHDJd2yDhVDTM="; }; + sourceRoot = "${finalAttrs.src.name}/projects/rocdbgapi"; nativeBuildInputs = [ cmake From 90c358a5797695248803cb14473677762ecf1abe Mon Sep 17 00:00:00 2001 From: randomizedcoder Date: Thu, 22 Oct 2026 07:18:56 -0700 Subject: [PATCH 06/12] rocmPackages_10.rocgdb: init at 10.1 Update the rocmPackages.rocgdb copy from the previous commit to ROCm 10.1 and add it to the rocmPackages_10 scope. From "rocmPackages.rocgdb: 7.2.4 -> 10.1.0". Assisted-by: Claude Code (claude-opus-5-5) --- pkgs/development/rocm-modules/10/default.nix | 2 ++ pkgs/development/rocm-modules/10/rocgdb/default.nix | 7 ++++--- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/pkgs/development/rocm-modules/10/default.nix b/pkgs/development/rocm-modules/10/default.nix index 76ea49641bb1a..f10765a04559d 100644 --- a/pkgs/development/rocm-modules/10/default.nix +++ b/pkgs/development/rocm-modules/10/default.nix @@ -90,6 +90,8 @@ let roctracer = self.callPackage ./roctracer { }; + rocgdb = self.callPackage ./rocgdb { }; + rocdbgapi = self.callPackage ./rocdbgapi { }; mscclpp = self.callPackage ../mscclpp { }; diff --git a/pkgs/development/rocm-modules/10/rocgdb/default.nix b/pkgs/development/rocm-modules/10/rocgdb/default.nix index 918f624b673d2..4dbb291e5305f 100644 --- a/pkgs/development/rocm-modules/10/rocgdb/default.nix +++ b/pkgs/development/rocm-modules/10/rocgdb/default.nix @@ -23,13 +23,14 @@ stdenv.mkDerivation (finalAttrs: { pname = "rocgdb"; - version = "7.2.4"; + version = "10.1"; src = fetchFromGitHub { owner = "ROCm"; repo = "ROCgdb"; - tag = "rocm-${finalAttrs.version}"; - hash = "sha256-oml/HLExnnjh7+axeWPZRWecpwK2BnzVOaGvXYhrxKs="; + # ROCgdb switched to the two-component therock-X.Y tag scheme in 10.0. + tag = "therock-${finalAttrs.version}"; + hash = "sha256-BenTuntdO+NUgzty0en2b7uaIvugISNU4rqxRG/Ka1w="; }; nativeBuildInputs = [ From 80a94c1165adadf5f601dbd449c6e3f1fdef3edd Mon Sep 17 00:00:00 2001 From: randomizedcoder Date: Thu, 22 Oct 2026 07:18:56 -0700 Subject: [PATCH 07/12] rocmPackages_10.rocr-debug-agent: init at 10.1 Update the rocmPackages.rocr-debug-agent copy from the previous commit to ROCm 10.1 and add it to the rocmPackages_10 scope. From "rocmPackages.{rocdbgapi,rocr-debug-agent}: move to rocm-systems monorepo": ROCdbgapi and rocr_debug_agent moved into the rocm-systems monorepo in ROCm 10. Switch both to the sparse-checkout source (projects/ + shared) at the therock-10.1 tag. Assisted-by: Claude Code (claude-opus-5-5) --- pkgs/development/rocm-modules/10/default.nix | 2 ++ .../rocm-modules/10/rocr-debug-agent/default.nix | 14 ++++++++++---- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/pkgs/development/rocm-modules/10/default.nix b/pkgs/development/rocm-modules/10/default.nix index f10765a04559d..03ea95c9224fc 100644 --- a/pkgs/development/rocm-modules/10/default.nix +++ b/pkgs/development/rocm-modules/10/default.nix @@ -94,6 +94,8 @@ let rocdbgapi = self.callPackage ./rocdbgapi { }; + rocr-debug-agent = self.callPackage ./rocr-debug-agent { }; + mscclpp = self.callPackage ../mscclpp { }; half = self.callPackage ./half { }; diff --git a/pkgs/development/rocm-modules/10/rocr-debug-agent/default.nix b/pkgs/development/rocm-modules/10/rocr-debug-agent/default.nix index a153ff75e2847..b134c42718a49 100644 --- a/pkgs/development/rocm-modules/10/rocr-debug-agent/default.nix +++ b/pkgs/development/rocm-modules/10/rocr-debug-agent/default.nix @@ -12,14 +12,20 @@ stdenv.mkDerivation (finalAttrs: { pname = "rocr-debug-agent"; - version = "7.2.4"; + version = "10.1"; src = fetchFromGitHub { owner = "ROCm"; - repo = "rocr_debug_agent"; - tag = "rocm-${finalAttrs.version}"; - hash = "sha256-w2Zg4kpuKy68DkVGsBTUsjRZoV/Y/Z3Q8s0oSIR3Ask="; + # rocr_debug_agent lives in the rocm-systems monorepo since ROCm 10 + repo = "rocm-systems"; + tag = "therock-${finalAttrs.version}"; + sparseCheckout = [ + "projects/rocr-debug-agent" + "shared" + ]; + hash = "sha256-WpBG1ogF161EM3tgXnVGstyDBdCmTXQPUPnkZF1eF3A="; }; + sourceRoot = "${finalAttrs.src.name}/projects/rocr-debug-agent"; nativeBuildInputs = [ cmake From 6b5e088beca49b7c2d9940fc186f9ead4349fd09 Mon Sep 17 00:00:00 2001 From: randomizedcoder Date: Thu, 22 Oct 2026 07:18:57 -0700 Subject: [PATCH 08/12] rocmPackages_10.rocprofiler: init at 10.1 Update the rocmPackages.rocprofiler copy from the previous commit to ROCm 10.1 and add it to the rocmPackages_10 scope. From the mass bump: - rocprofiler-register: drop 3 fetchpatches now upstream. Assisted-by: Claude Code (claude-opus-5-5) --- pkgs/development/rocm-modules/10/default.nix | 4 ++++ pkgs/development/rocm-modules/10/rocprofiler/default.nix | 6 +++--- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/pkgs/development/rocm-modules/10/default.nix b/pkgs/development/rocm-modules/10/default.nix index 03ea95c9224fc..d18d539f16a2a 100644 --- a/pkgs/development/rocm-modules/10/default.nix +++ b/pkgs/development/rocm-modules/10/default.nix @@ -80,6 +80,10 @@ let # hsakmt was merged into rocm-runtime hsakmt = self.rocm-runtime; + + rocprofiler = self.callPackage ./rocprofiler { + inherit (llvm) clang; + }; rocprofiler-register = self.callPackage ./rocprofiler-register { inherit (llvm) clang; }; diff --git a/pkgs/development/rocm-modules/10/rocprofiler/default.nix b/pkgs/development/rocm-modules/10/rocprofiler/default.nix index 02500210e2d2b..358a2467e7975 100644 --- a/pkgs/development/rocm-modules/10/rocprofiler/default.nix +++ b/pkgs/development/rocm-modules/10/rocprofiler/default.nix @@ -44,18 +44,18 @@ let in stdenv.mkDerivation (finalAttrs: { pname = "rocprofiler"; - version = "7.2.4"; + version = "10.1"; src = fetchFromGitHub { owner = "ROCm"; repo = "rocm-systems"; - tag = "rocm-${finalAttrs.version}"; + tag = "therock-${finalAttrs.version}"; sparseCheckout = [ "projects/rocprofiler" "shared" ]; fetchSubmodules = true; - hash = "sha256-Wo0pymD8LsrdczdIUEEVe5x2Id//KIFkh40kliAQgWo="; + hash = "sha256-vKs+2TpbxmHZNmQK0WDRRKohUTpu/Zkc1V1b8V+lExk="; }; sourceRoot = "${finalAttrs.src.name}/projects/rocprofiler"; From 29472b7330c6ac391e3f80cd14afb6c706d5d6fb Mon Sep 17 00:00:00 2001 From: randomizedcoder Date: Thu, 22 Oct 2026 07:18:57 -0700 Subject: [PATCH 09/12] rocmPackages_10.rdc: init at 10.1 Update the rocmPackages.rdc copy from the previous commit to ROCm 10.1 and add it to the rocmPackages_10 scope. From "rocmPackages.rdc: drop CXXFLAGS patch fixed upstream in therock-10.1": ROCm/rocm-systems#2423 was closed without merging, but therock-10.1 fixes the same problem: projects/rdc/CMakeLists.txt now appends to CMAKE_CXX_FLAGS instead of overwriting it. fix-cmake-cxxflags.patch no longer applies. The libcap pkg-config patch (#2424) is still needed and applies with offsets. Assisted-by: Claude Code (claude-opus-5-5) --- pkgs/development/rocm-modules/10/default.nix | 2 + .../rocm-modules/10/rdc/default.nix | 10 +- .../10/rdc/fix-cmake-cxxflags.patch | 217 ------------------ 3 files changed, 6 insertions(+), 223 deletions(-) delete mode 100644 pkgs/development/rocm-modules/10/rdc/fix-cmake-cxxflags.patch diff --git a/pkgs/development/rocm-modules/10/default.nix b/pkgs/development/rocm-modules/10/default.nix index d18d539f16a2a..9f2264f660abc 100644 --- a/pkgs/development/rocm-modules/10/default.nix +++ b/pkgs/development/rocm-modules/10/default.nix @@ -65,6 +65,8 @@ let aqlprofile = self.callPackage ./aqlprofile { }; + rdc = self.callPackage ./rdc { }; + rocm-docs-core = python3Packages.callPackage ../rocm-docs-core { }; hip-common = self.callPackage ./hip-common { }; diff --git a/pkgs/development/rocm-modules/10/rdc/default.nix b/pkgs/development/rocm-modules/10/rdc/default.nix index 8c5debc4dec47..fe03b7f0510fd 100644 --- a/pkgs/development/rocm-modules/10/rdc/default.nix +++ b/pkgs/development/rocm-modules/10/rdc/default.nix @@ -49,7 +49,7 @@ let in stdenv.mkDerivation (finalAttrs: { pname = "rdc"; - version = "7.2.4"; + version = "10.1"; outputs = [ "out" @@ -64,19 +64,17 @@ stdenv.mkDerivation (finalAttrs: { src = fetchFromGitHub { owner = "ROCm"; repo = "rocm-systems"; - tag = "rocm-${finalAttrs.version}"; + tag = "therock-${finalAttrs.version}"; sparseCheckout = [ "projects/rdc" "shared" ]; - hash = "sha256-SmySauRxFnEQJVTjGYf4TpmQclTwZG2RZrk3u6ko5Qo="; + hash = "sha256-tcov375DXHX1L/HhACevulzBOhq7Gp08j8SDEuVgPYU="; }; sourceRoot = "${finalAttrs.src.name}/projects/rdc"; patches = [ - # https://github.com/ROCm/rocm-systems/pull/2423 - ./fix-cmake-cxxflags.patch - # https://github.com/ROCm/rocm-systems/pull/2424 + # Find libcap through pkg-config (https://github.com/ROCm/rocm-systems/pull/2424, closed) ./fix-libcap-pkgconfig.patch ]; diff --git a/pkgs/development/rocm-modules/10/rdc/fix-cmake-cxxflags.patch b/pkgs/development/rocm-modules/10/rdc/fix-cmake-cxxflags.patch deleted file mode 100644 index bf7f3dbb0eef4..0000000000000 --- a/pkgs/development/rocm-modules/10/rdc/fix-cmake-cxxflags.patch +++ /dev/null @@ -1,217 +0,0 @@ -From 92f25181dbf722cb749e445851580df4ea779299 Mon Sep 17 00:00:00 2001 -From: Luna Nova -Date: Sun, 21 Dec 2025 08:01:08 -0800 -Subject: [PATCH 1/2] fix(rdc): set CMAKE_CXX_FLAGS after project() to avoid - clobbering env - -CMAKE_CXX_FLAGS' initial value is set from $CXXFLAGS on project() call -so the previous location ignored CXXFLAGS from env or CMake toolchain -config. - -Ref: https://cmake.org/cmake/help/v4.2/variable/CMAKE_LANG_FLAGS_INIT.html -Fixes: 874a7b438f ("CMAKE - Fix build types") ---- - CMakeLists.txt | 48 +++++++++++++++++++------------------ - 1 file changed, 25 insertions(+), 23 deletions(-) - -diff --git a/CMakeLists.txt b/CMakeLists.txt -index 907c9fbff42..8b386c7be3d 100755 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -55,29 +55,6 @@ set_property( - PROPERTY STRINGS "Debug" "Release" "RelWithDebInfo" "MinSizeRel" - ) - --# Set compile flags --set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -m64 -msse -msse2") --set(CMAKE_CXX_FLAGS_DEBUG -- "${CMAKE_CXX_FLAGS_DEBUG} -O0 -ggdb -DDEBUG" -- CACHE STRING -- "Flags for Debug builds" --) --set(CMAKE_CXX_FLAGS_RELEASE -- "${CMAKE_CXX_FLAGS_RELEASE} -O2 -s -DNDEBUG" -- CACHE STRING -- "Flags for Release builds" --) --set(CMAKE_CXX_FLAGS_RELWITHDEBINFO -- "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} -O2 -g -DNDEBUG" -- CACHE STRING -- "Flags for RelWithDebInfo builds" --) --set(CMAKE_CXX_FLAGS_MINSIZEREL -- "${CMAKE_CXX_FLAGS_MINSIZEREL} -Os -DNDEBUG" -- CACHE STRING -- "Flags for MinSizeRel builds" --) -- - set(CMAKE_MODULE_PATH - "${CMAKE_CURRENT_SOURCE_DIR}/cmake_modules/" - CACHE INTERNAL -@@ -155,6 +132,31 @@ project(${RDC} VERSION "${VERSION_STRING}" HOMEPAGE_URL "https://github.com/Rade - # this must go after project() - include(GNUInstallDirs) - -+# NB: CMAKE__FLAGS are initialized from environment (CXXFLAGS et al.) -+# during project(). Setting them before project() discards env and toolchain -+# defaults. Cf. CMAKE__FLAGS_INIT for toolchain overrides. -+set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -m64 -msse -msse2") -+set(CMAKE_CXX_FLAGS_DEBUG -+ "${CMAKE_CXX_FLAGS_DEBUG} -O0 -ggdb -DDEBUG" -+ CACHE STRING -+ "Flags for Debug builds" -+) -+set(CMAKE_CXX_FLAGS_RELEASE -+ "${CMAKE_CXX_FLAGS_RELEASE} -O2 -s -DNDEBUG" -+ CACHE STRING -+ "Flags for Release builds" -+) -+set(CMAKE_CXX_FLAGS_RELWITHDEBINFO -+ "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} -O2 -g -DNDEBUG" -+ CACHE STRING -+ "Flags for RelWithDebInfo builds" -+) -+set(CMAKE_CXX_FLAGS_MINSIZEREL -+ "${CMAKE_CXX_FLAGS_MINSIZEREL} -Os -DNDEBUG" -+ CACHE STRING -+ "Flags for MinSizeRel builds" -+) -+ - set(COMMON_DIR "${CMAKE_CURRENT_SOURCE_DIR}/common") - - set(GRPC_ROOT_DEFAULT "/usr") - -From 0c8710c3570963b29c709b1cd1f78b15fd73a950 Mon Sep 17 00:00:00 2001 -From: Luna Nova -Date: Sun, 21 Dec 2025 08:13:04 -0800 -Subject: [PATCH 2/2] fix(rdc): don't reimplement CMake default build type flag - logic - -The previous approach was overly complicated and added nothing. CMake already defaults -similar flags for each of the default supported build types. -Additionally, the previous flags broke AArch64 as -m64 -msse are incompatible. -It's not necessary to explicitly set this with modern toolchains. - -Fixes: 874a7b438f ("CMAKE - Fix build types") -Fixes: bc7f01e992 ("Initial RDC commit") ---- - CMakeLists.txt | 25 +--------------------- - example/CMakeLists.txt | 26 ++--------------------- - tests/example/CMakeLists.txt | 24 +-------------------- - 3 files changed, 4 insertions(+), 71 deletions(-) - -diff --git a/CMakeLists.txt b/CMakeLists.txt -index 8b386c7be3d..251fcddd653 100755 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -132,30 +132,7 @@ project(${RDC} VERSION "${VERSION_STRING}" HOMEPAGE_URL "https://github.com/Rade - # this must go after project() - include(GNUInstallDirs) - --# NB: CMAKE__FLAGS are initialized from environment (CXXFLAGS et al.) --# during project(). Setting them before project() discards env and toolchain --# defaults. Cf. CMAKE__FLAGS_INIT for toolchain overrides. --set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -m64 -msse -msse2") --set(CMAKE_CXX_FLAGS_DEBUG -- "${CMAKE_CXX_FLAGS_DEBUG} -O0 -ggdb -DDEBUG" -- CACHE STRING -- "Flags for Debug builds" --) --set(CMAKE_CXX_FLAGS_RELEASE -- "${CMAKE_CXX_FLAGS_RELEASE} -O2 -s -DNDEBUG" -- CACHE STRING -- "Flags for Release builds" --) --set(CMAKE_CXX_FLAGS_RELWITHDEBINFO -- "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} -O2 -g -DNDEBUG" -- CACHE STRING -- "Flags for RelWithDebInfo builds" --) --set(CMAKE_CXX_FLAGS_MINSIZEREL -- "${CMAKE_CXX_FLAGS_MINSIZEREL} -Os -DNDEBUG" -- CACHE STRING -- "Flags for MinSizeRel builds" --) -+add_compile_options(-Wall -Wextra) - - set(COMMON_DIR "${CMAKE_CURRENT_SOURCE_DIR}/common") - -diff --git a/example/CMakeLists.txt b/example/CMakeLists.txt -index 378a2005818..7c51307ec38 100755 ---- a/example/CMakeLists.txt -+++ b/example/CMakeLists.txt -@@ -31,30 +31,6 @@ cmake_minimum_required(VERSION 3.15) - option(CMAKE_VERBOSE_MAKEFILE "Enable verbose output" ON) - option(CMAKE_EXPORT_COMPILE_COMMANDS "Export compile commands for linters and autocompleters" ON) - --# Set compile flags --set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -m64 -msse -msse2") --set(CMAKE_CXX_FLAGS_DEBUG -- "${CMAKE_CXX_FLAGS_DEBUG} -O0 -ggdb -DDEBUG" -- CACHE STRING -- "Flags for Debug builds" --) --# note: no '-s' here unlike other CMakeLists.txt --set(CMAKE_CXX_FLAGS_RELEASE -- "${CMAKE_CXX_FLAGS_RELEASE} -O2 -DNDEBUG" -- CACHE STRING -- "Flags for Release builds" --) --set(CMAKE_CXX_FLAGS_RELWITHDEBINFO -- "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} -O2 -g -DNDEBUG" -- CACHE STRING -- "Flags for RelWithDebInfo builds" --) --set(CMAKE_CXX_FLAGS_MINSIZEREL -- "${CMAKE_CXX_FLAGS_MINSIZEREL} -Os -DNDEBUG" -- CACHE STRING -- "Flags for MinSizeRel builds" --) -- - set(CMAKE_CXX_STANDARD 17 CACHE STRING "The C++ standard to use") - set(CMAKE_CXX_STANDARD_REQUIRED ON) - set(CMAKE_CXX_EXTENSIONS OFF) -@@ -66,6 +42,8 @@ endif() - - project(RDC_example) - -+add_compile_options(-Wall -Wextra) -+ - # provides cmake_print_variables(VAR) - include(CMakePrintHelpers) - -diff --git a/tests/example/CMakeLists.txt b/tests/example/CMakeLists.txt -index d5614f387bd..13c2f3857a1 100755 ---- a/tests/example/CMakeLists.txt -+++ b/tests/example/CMakeLists.txt -@@ -22,29 +22,7 @@ message("&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&") - message(" Cmake Example Lib ") - message("&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&") - --# Set compile flags --set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -m64 -msse -msse2") --set(CMAKE_CXX_FLAGS_DEBUG -- "${CMAKE_CXX_FLAGS_DEBUG} -O0 -ggdb -DDEBUG" -- CACHE STRING -- "Flags for Debug builds" --) --# note: no '-s' here unlike other CMakeLists.txt --set(CMAKE_CXX_FLAGS_RELEASE -- "${CMAKE_CXX_FLAGS_RELEASE} -O2 -DNDEBUG" -- CACHE STRING -- "Flags for Release builds" --) --set(CMAKE_CXX_FLAGS_RELWITHDEBINFO -- "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} -O2 -g -DNDEBUG" -- CACHE STRING -- "Flags for RelWithDebInfo builds" --) --set(CMAKE_CXX_FLAGS_MINSIZEREL -- "${CMAKE_CXX_FLAGS_MINSIZEREL} -Os -DNDEBUG" -- CACHE STRING -- "Flags for MinSizeRel builds" --) -+add_compile_options(-Wall -Wextra) - - # Required Defines first: - From 6ea18ed121aac71690a7744f0c56c84905776dd8 Mon Sep 17 00:00:00 2001 From: randomizedcoder Date: Thu, 22 Oct 2026 07:18:58 -0700 Subject: [PATCH 10/12] rocmPackages_10.rccl: init at 10.1 Update the rocmPackages.rccl copy from the previous commit to ROCm 10.1 and add it to the rocmPackages_10 scope. From "rocmPackages.rccl: monorepo source, rocm_smi -> amd_smi, drop mscclpp": rccl moved into the rocm-systems monorepo in ROCm 10. Switch to the sparse-checkout source and adapt: - rocm_smi -> amd_smi (CMakeLists find_package(amd_smi) gated on ROCM_VERSION >= 71100; SMI is dlopen'd at runtime). - Drop fix_hw_reg_hw_id_gt_gfx10.patch: its __trace_hwreg() target was removed when collTrace was restructured; the other hunk only touches tools/JitterBench (not built by default). - Drop the MSCCLPP integration (ENABLE_MSCCLPP / MSCCLPP_ROOT): upstream removed it from CMakeLists, so the separate mscclpp input is gone. Revised during the split review: Drop -DENABLE_MSCCL_KERNEL; 10.x no longer has the option. Assisted-by: Claude Code (claude-opus-5-5) --- pkgs/development/rocm-modules/10/default.nix | 2 ++ .../rocm-modules/10/rccl/default.nix | 29 +++++++--------- .../10/rccl/fix_hw_reg_hw_id_gt_gfx10.patch | 33 ------------------- 3 files changed, 14 insertions(+), 50 deletions(-) delete mode 100644 pkgs/development/rocm-modules/10/rccl/fix_hw_reg_hw_id_gt_gfx10.patch diff --git a/pkgs/development/rocm-modules/10/default.nix b/pkgs/development/rocm-modules/10/default.nix index 9f2264f660abc..c129e332e4eed 100644 --- a/pkgs/development/rocm-modules/10/default.nix +++ b/pkgs/development/rocm-modules/10/default.nix @@ -104,6 +104,8 @@ let mscclpp = self.callPackage ../mscclpp { }; + rccl = self.callPackage ./rccl { }; + half = self.callPackage ./half { }; # Even if config.rocmSupport is false we need rocmSupport true diff --git a/pkgs/development/rocm-modules/10/rccl/default.nix b/pkgs/development/rocm-modules/10/rccl/default.nix index 1dbcd0c84945c..2269b178b9283 100644 --- a/pkgs/development/rocm-modules/10/rccl/default.nix +++ b/pkgs/development/rocm-modules/10/rccl/default.nix @@ -5,11 +5,10 @@ rocmUpdateScript, cmake, rocm-cmake, - rocm-smi, + amdsmi, rocm-core, pkg-config, clr, - mscclpp, perl, hipify, python3, @@ -40,7 +39,7 @@ in # infiniband ib_peer_mem support isn't in the mainline kernel but is carried by some distros stdenv.mkDerivation (finalAttrs: { pname = "rccl${clr.gpuArchSuffix}"; - version = "7.2.4"; + version = "10.1"; outputs = [ "out" @@ -51,15 +50,19 @@ stdenv.mkDerivation (finalAttrs: { patches = [ ./rccl-test-missing-iomanip.diff - ./fix_hw_reg_hw_id_gt_gfx10.patch ]; src = fetchFromGitHub { owner = "ROCm"; - repo = "rccl"; - tag = "rocm-${finalAttrs.version}"; - hash = "sha256-A1IQYIDWqu3JLiPQ70G52s1/0ZweQxFlgMUH81qJWmU="; + repo = "rocm-systems"; + tag = "therock-${finalAttrs.version}"; + sparseCheckout = [ + "projects/rccl" + "shared" + ]; + hash = "sha256-OkX15/P1wQ9E8QfAOklXvxmVw700kvIyi6CwdorqNhA="; }; + sourceRoot = "${finalAttrs.src.name}/projects/rccl"; requiredSystemFeatures = [ "big-parallel" ]; # Very resource intensive LTO @@ -75,13 +78,13 @@ stdenv.mkDerivation (finalAttrs: { ]; buildInputs = [ - rocm-smi + # Headers only; RCCL dlopens amd_smi at runtime. + amdsmi fmt gtest roctracer rocprofiler rocprofiler-register - mscclpp ] ++ lib.optionals buildTests [ chrpath @@ -95,10 +98,6 @@ stdenv.mkDerivation (finalAttrs: { "-DROCM_PATCH_VERSION=${rocm-core.ROCM_LIBPATCH_VERSION}" "-DROCM_VERSION=${rocm-core.ROCM_LIBPATCH_VERSION}" "-DBUILD_BFD=OFF" # Can't get it to detect bfd.h - "-DENABLE_MSCCL_KERNEL=ON" - # FIXME: this is still running a download because if(NOT mscclpp_nccl_FOUND) is commented out T_T - "-DENABLE_MSCCLPP=OFF" - #"-DMSCCLPP_ROOT=${mscclpp}" # Manually define CMAKE_INSTALL_ # See: https://github.com/NixOS/nixpkgs/pull/197838 "-DCMAKE_INSTALL_BINDIR=bin" @@ -121,10 +120,6 @@ stdenv.mkDerivation (finalAttrs: { env.LDFLAGS = "${san}"; postPatch = '' patchShebangs src tools - substituteInPlace CMakeLists.txt \ - --replace-fail '${"\${HOST_OS_ID}"}' '"ubuntu"' \ - --replace-fail 'target_include_directories(rccl PRIVATE ''${ROCM_SMI_INCLUDE_DIR})' \ - 'target_include_directories(rccl PRIVATE ''${ROCM_SMI_INCLUDE_DIRS})' ''; postInstall = diff --git a/pkgs/development/rocm-modules/10/rccl/fix_hw_reg_hw_id_gt_gfx10.patch b/pkgs/development/rocm-modules/10/rccl/fix_hw_reg_hw_id_gt_gfx10.patch deleted file mode 100644 index c69000814a8a6..0000000000000 --- a/pkgs/development/rocm-modules/10/rccl/fix_hw_reg_hw_id_gt_gfx10.patch +++ /dev/null @@ -1,33 +0,0 @@ -fix: __trace_hwreg should use HW_REG_HW_ID1 for all gfx10/11/12 -diff --git a/src/device/common.h b/src/device/common.h -index c6c61021..742885f4 100644 ---- a/src/device/common.h -+++ b/src/device/common.h -@@ -26,8 +26,9 @@ - { __atomic_store_n((DST), (SRC), __ATOMIC_SEQ_CST); } - #endif - --#if defined(__gfx1100__) || defined(__gfx1101__) || defined(__gfx1102__) || defined(__gfx1200__) || defined(__gfx1201__) --#define __trace_hwreg() -+#if defined(__GFX10__) || defined(__GFX11__) || defined(__GFX12__) -+#define __trace_hwreg() \ -+ asm volatile ("s_getreg_b32 %0, hwreg(HW_REG_HW_ID1)" : "=s" (collTrace->data_0)); - #else - #define __trace_hwreg() \ - asm volatile ("s_getreg_b32 %0, hwreg(HW_REG_HW_ID)" : "=s" (collTrace->data_0)); -diff --git a/tools/JitterBench/Common.hpp b/tools/JitterBench/Common.hpp -index bad12a1b..b59856a8 100644 ---- a/tools/JitterBench/Common.hpp -+++ b/tools/JitterBench/Common.hpp -@@ -43,9 +43,9 @@ THE SOFTWARE. - #endif - - // Macro for collecting HW_REG_HW_ID --#if defined(__gfx1100__) || defined(__gfx1101__) || defined(__gfx1102__) || defined(__NVCC__) -+#if defined(__GFX10__) || defined(__GFX11__) || defined(__GFX12__) - #define GetHwId(val) \ -- val = 0 -+ asm volatile ("s_getreg_b32 %0, hwreg(HW_REG_HW_ID1)" : "=s" (val)); - #else - #define GetHwId(val) \ - asm volatile ("s_getreg_b32 %0, hwreg(HW_REG_HW_ID)" : "=s" (val)); From e89558d595225db803b9baa7afb46bfccb767327 Mon Sep 17 00:00:00 2001 From: randomizedcoder Date: Thu, 22 Oct 2026 07:18:59 -0700 Subject: [PATCH 11/12] rocmPackages_10.rocprofiler-sdk: init at 10.1 Update the rocmPackages.rocprofiler-sdk copy from the previous commit to ROCm 10.1 and add it to the rocmPackages_10 scope. From "rocmPackages.rocprofiler-sdk: drop patches upstreamed in therock-10.1": ROCm 10.1 merged the whole nixpkgs patch stack, so remove it: - 86ee7b2e / 36d9d33d / 94a4595a fetchpatches (system-libraries build, fmt memory header, amd_comgr linkage): present upstream. - 0001 (rename-consumer-test) and 0008 (stop-setting-warning-flags): only touched test CMakeLists; tests are off by default. - 0002 (missing STL headers), 0003 (amd-comgr dep), 0004 (find_package GLOBAL scoping): upstream. - 0005/0006/0007 (system elfio/otf2/json): the ROCPROFILER_BUILD_ELFIO/ OTF2/JSON options and their system-dependency branches are upstream (PR #2319 / #1243). - 0010 (fmt 12.2 format.h): upstream. The -DROCPROFILER_BUILD_{ELFIO,OTF2,JSON}=false cmakeFlags still drive those now-upstream options to use the system elfio/otf2/nlohmann_json. rocprofiler-sdk-tool now find_package(rocprof-trace-decoder REQUIRED)s at configure time, so add it as a build input. Revised during the split review: Drop the 0009 glog guard, the glog input and ROCPROFILER_BUILD_GLOG: the 10.1 SDK logs through Abseil (rocm-systems d80117889b3f is in therock-10.1), and the guard's glog symbol only resolved through rocprofiler-register. Add ompt-explicit-tool.patch: ompt_start_tool now declines unless a tool was requested through ROCP_TOOL_LIBRARIES (as rocprofv3 does) or rocprofiler_force_configure. Registering clients from libomp's initialisation dlopens every library defining rocprofiler_configure; with torch, libtorch_cpu (Kineto) is still loading, glibc reruns its pending constructors, and OpenBLAS reenters OpenMP initialisation, livelocking import. Clients found by symbol still register when the HIP runtime starts and only miss OMPT callbacks. This replaces the OMP_TOOL edit torch carried in PR 573885. Assisted-by: Claude Code (claude-opus-5-5) --- pkgs/development/rocm-modules/10/default.nix | 1 + ...missing-CPackComponent-cmake-include.patch | 25 -- ...2-allow-using-system-yaml-dependency.patch | 68 ----- ...-allow-using-system-elfio-dependency.patch | 70 ----- ...4-allow-using-system-otf2-dependency.patch | 54 ---- ...5-allow-using-system-json-dependency.patch | 54 ---- .../0006-fix-amd-comgr-resolution.patch | 154 ----------- ...udes-and-api-changes-with-fmt-v12.2..patch | 260 ------------------ ...ilation-errors-from-missing-includes.patch | 93 ------- ...ocprofiler-sdk-guard-ompt-auto-start.patch | 50 ---- .../10/rocprofiler-sdk/default.nix | 97 +++---- .../rocprofiler-sdk/ompt-explicit-tool.patch | 76 +++++ 12 files changed, 109 insertions(+), 893 deletions(-) delete mode 100644 pkgs/development/rocm-modules/10/rocprofiler-sdk/0001-fix-missing-CPackComponent-cmake-include.patch delete mode 100644 pkgs/development/rocm-modules/10/rocprofiler-sdk/0002-allow-using-system-yaml-dependency.patch delete mode 100644 pkgs/development/rocm-modules/10/rocprofiler-sdk/0003-allow-using-system-elfio-dependency.patch delete mode 100644 pkgs/development/rocm-modules/10/rocprofiler-sdk/0004-allow-using-system-otf2-dependency.patch delete mode 100644 pkgs/development/rocm-modules/10/rocprofiler-sdk/0005-allow-using-system-json-dependency.patch delete mode 100644 pkgs/development/rocm-modules/10/rocprofiler-sdk/0006-fix-amd-comgr-resolution.patch delete mode 100644 pkgs/development/rocm-modules/10/rocprofiler-sdk/0007-fix-missing-includes-and-api-changes-with-fmt-v12.2..patch delete mode 100644 pkgs/development/rocm-modules/10/rocprofiler-sdk/0008-fix-compilation-errors-from-missing-includes.patch delete mode 100644 pkgs/development/rocm-modules/10/rocprofiler-sdk/0009-rocprofiler-sdk-guard-ompt-auto-start.patch create mode 100644 pkgs/development/rocm-modules/10/rocprofiler-sdk/ompt-explicit-tool.patch diff --git a/pkgs/development/rocm-modules/10/default.nix b/pkgs/development/rocm-modules/10/default.nix index c129e332e4eed..fc166698fcda2 100644 --- a/pkgs/development/rocm-modules/10/default.nix +++ b/pkgs/development/rocm-modules/10/default.nix @@ -89,6 +89,7 @@ let rocprofiler-register = self.callPackage ./rocprofiler-register { inherit (llvm) clang; }; + rocprofiler-sdk = self.callPackage ./rocprofiler-sdk { }; rocprof-compute-viewer = self.callPackage ../rocprof-compute-viewer { }; diff --git a/pkgs/development/rocm-modules/10/rocprofiler-sdk/0001-fix-missing-CPackComponent-cmake-include.patch b/pkgs/development/rocm-modules/10/rocprofiler-sdk/0001-fix-missing-CPackComponent-cmake-include.patch deleted file mode 100644 index 1e65ac7a76ee5..0000000000000 --- a/pkgs/development/rocm-modules/10/rocprofiler-sdk/0001-fix-missing-CPackComponent-cmake-include.patch +++ /dev/null @@ -1,25 +0,0 @@ -From 5ae420cc204d0afb1ad388ddbceec237a4164569 Mon Sep 17 00:00:00 2001 -From: Anund -Date: Sun, 11 Oct 2026 17:28:05 +1100 -Subject: [PATCH 1/8] fix missing CPackComponent cmake include - ---- - cmake/rocprofiler_config_packaging.cmake | 2 ++ - 1 file changed, 2 insertions(+) - -diff --git a/cmake/rocprofiler_config_packaging.cmake b/cmake/rocprofiler_config_packaging.cmake -index 84c2ecf230..55d9f58f38 100644 ---- a/cmake/rocprofiler_config_packaging.cmake -+++ b/cmake/rocprofiler_config_packaging.cmake -@@ -126,6 +126,8 @@ endif() - list(APPEND _DEB_PACKAGE_DEPENDS ${ROCPROFILER_CPACK_DEBIAN_PACKAGE_DEPENDS}) - list(APPEND _RPM_PACKAGE_REQUIRES ${ROCPROFILER_CPACK_RPM_PACKAGE_REQUIRES}) - -+include(CPackComponent) -+ - foreach(COMPONENT_GROUP ${ROCPROFILER_COMPONENT_GROUPS}) - set(_DEP "${COMPONENT_DEP_${COMPONENT_GROUP}}") - set(_NAME "${COMPONENT_NAME_${COMPONENT_GROUP}}") --- -2.55.0 - diff --git a/pkgs/development/rocm-modules/10/rocprofiler-sdk/0002-allow-using-system-yaml-dependency.patch b/pkgs/development/rocm-modules/10/rocprofiler-sdk/0002-allow-using-system-yaml-dependency.patch deleted file mode 100644 index 3fa335a25eb9a..0000000000000 --- a/pkgs/development/rocm-modules/10/rocprofiler-sdk/0002-allow-using-system-yaml-dependency.patch +++ /dev/null @@ -1,68 +0,0 @@ -From 0477671140ffc3d1b50e1cca69f107b51112faa8 Mon Sep 17 00:00:00 2001 -From: Anund -Date: Sun, 11 Oct 2026 17:29:27 +1100 -Subject: [PATCH 2/8] allow using system yaml dependency - ---- - cmake/rocprofiler_options.cmake | 2 ++ - external/CMakeLists.txt | 29 +++++++++++++++++------------ - 2 files changed, 19 insertions(+), 12 deletions(-) - -diff --git a/cmake/rocprofiler_options.cmake b/cmake/rocprofiler_options.cmake -index 08d1032635..faee11049f 100644 ---- a/cmake/rocprofiler_options.cmake -+++ b/cmake/rocprofiler_options.cmake -@@ -65,6 +65,8 @@ rocprofiler_add_option(ROCPROFILER_BUILD_PYBIND11 - "Enable building pybind11 library internally" ON) - rocprofiler_add_option(ROCPROFILER_BUILD_GOTCHA - "Enable building gotcha library internally" ON) -+rocprofiler_add_option(ROCPROFILER_BUILD_YAML_CPP -+ "Enable building yaml-cpp library internally" ON) - if(ROCPROFILER_BUILD_TESTS) - rocprofiler_add_option( - ROCPROFILER_BUILD_GTEST -diff --git a/external/CMakeLists.txt b/external/CMakeLists.txt -index 5bee3dc032..cab59c07bd 100644 ---- a/external/CMakeLists.txt -+++ b/external/CMakeLists.txt -@@ -131,20 +131,25 @@ if(NOT TARGET PTL::ptl-static) - add_subdirectory(ptl EXCLUDE_FROM_ALL) - endif() - --rocprofiler_checkout_git_submodule( -- RECURSIVE -- RELATIVE_PATH external/yaml-cpp -- WORKING_DIRECTORY ${PROJECT_SOURCE_DIR} -- REPO_URL https://github.com/jbeder/yaml-cpp.git -- REPO_BRANCH "master") -+if(ROCPROFILER_BUILD_YAML_CPP) -+ rocprofiler_checkout_git_submodule( -+ RECURSIVE -+ RELATIVE_PATH external/yaml-cpp -+ WORKING_DIRECTORY ${PROJECT_SOURCE_DIR} -+ REPO_URL https://github.com/jbeder/yaml-cpp.git -+ REPO_BRANCH "master") - --add_subdirectory(yaml-cpp EXCLUDE_FROM_ALL) -+ add_subdirectory(yaml-cpp EXCLUDE_FROM_ALL) - --target_link_libraries(rocprofiler-sdk-yaml-cpp -- INTERFACE $) --target_include_directories( -- rocprofiler-sdk-yaml-cpp -- INTERFACE $) -+ target_link_libraries(rocprofiler-sdk-yaml-cpp -+ INTERFACE $) -+ target_include_directories( -+ rocprofiler-sdk-yaml-cpp -+ INTERFACE $) -+else() -+ find_package(yaml-cpp 0.8.0 REQUIRED) -+ target_link_libraries(rocprofiler-sdk-yaml-cpp INTERFACE yaml-cpp::yaml-cpp) -+endif() - - # checkout submodule if not already checked out or clone repo if no .gitmodules file - rocprofiler_checkout_git_submodule( --- -2.55.0 - diff --git a/pkgs/development/rocm-modules/10/rocprofiler-sdk/0003-allow-using-system-elfio-dependency.patch b/pkgs/development/rocm-modules/10/rocprofiler-sdk/0003-allow-using-system-elfio-dependency.patch deleted file mode 100644 index 702f380edb420..0000000000000 --- a/pkgs/development/rocm-modules/10/rocprofiler-sdk/0003-allow-using-system-elfio-dependency.patch +++ /dev/null @@ -1,70 +0,0 @@ -From 27cec58fefe73c26ccca212ebbc002a0b9c1bfa5 Mon Sep 17 00:00:00 2001 -From: Anund -Date: Sun, 11 Oct 2026 17:29:50 +1100 -Subject: [PATCH 3/8] allow using system elfio dependency - ---- - cmake/rocprofiler_options.cmake | 2 ++ - external/CMakeLists.txt | 33 +++++++++++++++++++-------------- - 2 files changed, 21 insertions(+), 14 deletions(-) - -diff --git a/cmake/rocprofiler_options.cmake b/cmake/rocprofiler_options.cmake -index faee11049f..a09af6c2c9 100644 ---- a/cmake/rocprofiler_options.cmake -+++ b/cmake/rocprofiler_options.cmake -@@ -67,6 +67,8 @@ rocprofiler_add_option(ROCPROFILER_BUILD_GOTCHA - "Enable building gotcha library internally" ON) - rocprofiler_add_option(ROCPROFILER_BUILD_YAML_CPP - "Enable building yaml-cpp library internally" ON) -+rocprofiler_add_option(ROCPROFILER_BUILD_ELFIO -+ "Enable building ELFIO library internally" ON) - if(ROCPROFILER_BUILD_TESTS) - rocprofiler_add_option( - ROCPROFILER_BUILD_GTEST -diff --git a/external/CMakeLists.txt b/external/CMakeLists.txt -index cab59c07bd..a75229edf3 100644 ---- a/external/CMakeLists.txt -+++ b/external/CMakeLists.txt -@@ -201,20 +201,25 @@ target_link_libraries( - INTERFACE $) - - # ELFIO --rocprofiler_checkout_git_submodule( -- RECURSIVE -- RELATIVE_PATH external/elfio -- WORKING_DIRECTORY ${PROJECT_SOURCE_DIR} -- REPO_URL https://github.com/serge1/ELFIO.git -- REPO_BRANCH "Release_3.12") -- --set(ELFIO_BUILD_EXAMPLES OFF) --set(ELFIO_BUILD_TESTS OFF) --add_subdirectory(elfio EXCLUDE_FROM_ALL) --if(TARGET rocprofiler-sdk-elfio) -- get_target_property(ELFIO_INCLUDE_DIR elfio::elfio INTERFACE_INCLUDE_DIRECTORIES) -- target_include_directories(rocprofiler-sdk-elfio SYSTEM -- INTERFACE ${ELFIO_INCLUDE_DIR}) -+if(ROCPROFILER_BUILD_ELFIO) -+ rocprofiler_checkout_git_submodule( -+ RECURSIVE -+ RELATIVE_PATH external/elfio -+ WORKING_DIRECTORY ${PROJECT_SOURCE_DIR} -+ REPO_URL https://github.com/serge1/ELFIO.git -+ REPO_BRANCH "Release_3.12") -+ -+ set(ELFIO_BUILD_EXAMPLES OFF) -+ set(ELFIO_BUILD_TESTS OFF) -+ add_subdirectory(elfio EXCLUDE_FROM_ALL) -+ if(TARGET rocprofiler-sdk-elfio) -+ get_target_property(ELFIO_INCLUDE_DIR elfio::elfio INTERFACE_INCLUDE_DIRECTORIES) -+ target_include_directories(rocprofiler-sdk-elfio SYSTEM -+ INTERFACE ${ELFIO_INCLUDE_DIR}) -+ endif() -+else() -+ find_package(elfio REQUIRED GLOBAL) -+ target_link_libraries(rocprofiler-sdk-elfio INTERFACE elfio::elfio) - endif() - - # --- -2.55.0 - diff --git a/pkgs/development/rocm-modules/10/rocprofiler-sdk/0004-allow-using-system-otf2-dependency.patch b/pkgs/development/rocm-modules/10/rocprofiler-sdk/0004-allow-using-system-otf2-dependency.patch deleted file mode 100644 index 61a2888f79f8c..0000000000000 --- a/pkgs/development/rocm-modules/10/rocprofiler-sdk/0004-allow-using-system-otf2-dependency.patch +++ /dev/null @@ -1,54 +0,0 @@ -From d2c8a5872c8d2af1bc8c203ad75f7c1c83cfb919 Mon Sep 17 00:00:00 2001 -From: Anund -Date: Sun, 11 Oct 2026 17:30:13 +1100 -Subject: [PATCH 4/8] allow using system otf2 dependency - ---- - cmake/rocprofiler_options.cmake | 2 ++ - external/CMakeLists.txt | 17 +++++++++-------- - 2 files changed, 11 insertions(+), 8 deletions(-) - -diff --git a/cmake/rocprofiler_options.cmake b/cmake/rocprofiler_options.cmake -index a09af6c2c9..19e092df06 100644 ---- a/cmake/rocprofiler_options.cmake -+++ b/cmake/rocprofiler_options.cmake -@@ -69,6 +69,8 @@ rocprofiler_add_option(ROCPROFILER_BUILD_YAML_CPP - "Enable building yaml-cpp library internally" ON) - rocprofiler_add_option(ROCPROFILER_BUILD_ELFIO - "Enable building ELFIO library internally" ON) -+rocprofiler_add_option(ROCPROFILER_BUILD_OTF2 -+ "Enable building OTF2 library internally" ON) - if(ROCPROFILER_BUILD_TESTS) - rocprofiler_add_option( - ROCPROFILER_BUILD_GTEST -diff --git a/external/CMakeLists.txt b/external/CMakeLists.txt -index a75229edf3..e1be3df85e 100644 ---- a/external/CMakeLists.txt -+++ b/external/CMakeLists.txt -@@ -225,14 +225,15 @@ endif() - # - # OTF2 - # --add_subdirectory(otf2) -- --rocprofiler_checkout_git_submodule( -- RECURSIVE -- RELATIVE_PATH external/json -- WORKING_DIRECTORY ${PROJECT_SOURCE_DIR} -- REPO_URL https://github.com/nlohmann/json.git -- REPO_BRANCH "develop") -+if(ROCPROFILER_BUILD_OTF2) -+ add_subdirectory(otf2) -+else() -+ find_package(PkgConfig REQUIRED) -+ pkg_check_modules(OTF2 REQUIRED IMPORTED_TARGET otf2) -+ add_library(otf2 INTERFACE) -+ add_library(otf2::otf2 ALIAS otf2) -+ target_link_libraries(otf2 INTERFACE PkgConfig::OTF2) -+endif() - - # - # JSON --- -2.55.0 - diff --git a/pkgs/development/rocm-modules/10/rocprofiler-sdk/0005-allow-using-system-json-dependency.patch b/pkgs/development/rocm-modules/10/rocprofiler-sdk/0005-allow-using-system-json-dependency.patch deleted file mode 100644 index b6cb539682c45..0000000000000 --- a/pkgs/development/rocm-modules/10/rocprofiler-sdk/0005-allow-using-system-json-dependency.patch +++ /dev/null @@ -1,54 +0,0 @@ -From 3c42b2a8491b44fa58940fcd44b45c64f1b43cf1 Mon Sep 17 00:00:00 2001 -From: Anund -Date: Sun, 11 Oct 2026 17:30:36 +1100 -Subject: [PATCH 5/8] allow using system json dependency - ---- - cmake/rocprofiler_options.cmake | 2 ++ - external/CMakeLists.txt | 17 +++++++++++++++++ - 2 files changed, 19 insertions(+) - -diff --git a/cmake/rocprofiler_options.cmake b/cmake/rocprofiler_options.cmake -index 19e092df06..b7a7a6cbdd 100644 ---- a/cmake/rocprofiler_options.cmake -+++ b/cmake/rocprofiler_options.cmake -@@ -71,6 +71,8 @@ rocprofiler_add_option(ROCPROFILER_BUILD_ELFIO - "Enable building ELFIO library internally" ON) - rocprofiler_add_option(ROCPROFILER_BUILD_OTF2 - "Enable building OTF2 library internally" ON) -+rocprofiler_add_option(ROCPROFILER_BUILD_JSON -+ "Enable building JSON library internally" ON) - if(ROCPROFILER_BUILD_TESTS) - rocprofiler_add_option( - ROCPROFILER_BUILD_GTEST -diff --git a/external/CMakeLists.txt b/external/CMakeLists.txt -index e1be3df85e..a282232f22 100644 ---- a/external/CMakeLists.txt -+++ b/external/CMakeLists.txt -@@ -243,6 +243,23 @@ target_include_directories( - rocprofiler-sdk-json SYSTEM - INTERFACE $) - -+if(ROCPROFILER_BUILD_JSON) -+ rocprofiler_checkout_git_submodule( -+ RECURSIVE -+ RELATIVE_PATH external/json -+ WORKING_DIRECTORY ${PROJECT_SOURCE_DIR} -+ REPO_URL https://github.com/nlohmann/json.git -+ REPO_BRANCH "develop") -+ -+ add_subdirectory(json) -+ target_include_directories( -+ rocprofiler-sdk-json SYSTEM -+ INTERFACE $) -+else() -+ find_package(nlohmann_json REQUIRED GLOBAL) -+ target_link_libraries(rocprofiler-sdk-json INTERFACE nlohmann_json::nlohmann_json) -+endif() -+ - # - # SQLite3 - # --- -2.55.0 - diff --git a/pkgs/development/rocm-modules/10/rocprofiler-sdk/0006-fix-amd-comgr-resolution.patch b/pkgs/development/rocm-modules/10/rocprofiler-sdk/0006-fix-amd-comgr-resolution.patch deleted file mode 100644 index 03103ec734619..0000000000000 --- a/pkgs/development/rocm-modules/10/rocprofiler-sdk/0006-fix-amd-comgr-resolution.patch +++ /dev/null @@ -1,154 +0,0 @@ -From 9977c287e106d9c494546212a3544e238363e219 Mon Sep 17 00:00:00 2001 -From: Anund -Date: Sun, 11 Oct 2026 16:52:24 +1100 -Subject: [PATCH 6/8] fix amd-comgr resolution - ---- - .../lib/att-tool/waitcnt/tests/CMakeLists.txt | 1 + - source/lib/python/utilities.cmake | 3 ++- - .../counters/tests/CMakeLists.txt | 2 ++ - .../pc_sampling/parser/tests/CMakeLists.txt | 20 ++++++++++++++----- - .../lib/rocprofiler-sdk/tests/CMakeLists.txt | 2 ++ - .../thread_trace/tests/CMakeLists.txt | 1 + - 6 files changed, 23 insertions(+), 6 deletions(-) - -diff --git a/source/lib/att-tool/waitcnt/tests/CMakeLists.txt b/source/lib/att-tool/waitcnt/tests/CMakeLists.txt -index 8a13e80cbe..48b3debc93 100644 ---- a/source/lib/att-tool/waitcnt/tests/CMakeLists.txt -+++ b/source/lib/att-tool/waitcnt/tests/CMakeLists.txt -@@ -10,6 +10,7 @@ target_link_libraries( - rocprofiler-sdk::rocprofiler-sdk-common-library - rocprofiler-sdk::rocprofiler-sdk-glog - rocprofiler-sdk::rocprofiler-sdk-static-library -+ rocprofiler-sdk::rocprofiler-sdk-amd-comgr - GTest::gtest - GTest::gtest_main) - target_sources(att-decoder-waitcnt-test PRIVATE att_decoder_waitcnt_test.cpp) -diff --git a/source/lib/python/utilities.cmake b/source/lib/python/utilities.cmake -index 1bc9171a3e..21bc9cfb3d 100644 ---- a/source/lib/python/utilities.cmake -+++ b/source/lib/python/utilities.cmake -@@ -209,7 +209,8 @@ function(rocprofiler_rocpd_python_bindings _VERSION) - rocprofiler-sdk::rocprofiler-sdk-gotcha - rocprofiler-sdk::rocprofiler-sdk-dw - rocprofiler-sdk::rocprofiler-sdk-static-library -- rocprofiler-sdk::rocprofiler-sdk-rocpd-library) -+ rocprofiler-sdk::rocprofiler-sdk-rocpd-library -+ rocprofiler-sdk::rocprofiler-sdk-amd-comgr) - - # if "Development" is specified instead of "Development.Module", we need to link to - # python libraries -diff --git a/source/lib/rocprofiler-sdk/counters/tests/CMakeLists.txt b/source/lib/rocprofiler-sdk/counters/tests/CMakeLists.txt -index 5e0d73e0f0..38251a7acc 100644 ---- a/source/lib/rocprofiler-sdk/counters/tests/CMakeLists.txt -+++ b/source/lib/rocprofiler-sdk/counters/tests/CMakeLists.txt -@@ -51,6 +51,7 @@ target_sources( - target_link_libraries( - counter_test_constants - PRIVATE rocprofiler-sdk::rocprofiler-sdk-common-library -+ rocprofiler-sdk::rocprofiler-sdk-amd-comgr - rocprofiler-sdk::rocprofiler-sdk-static-library - rocprofiler-sdk::rocprofiler-sdk-hip - rocprofiler-sdk::rocprofiler-sdk-hsa-runtime) -@@ -73,6 +74,7 @@ target_link_libraries( - rocprofiler-sdk::rocprofiler-sdk-hsa-runtime - rocprofiler-sdk::rocprofiler-sdk-hip - rocprofiler-sdk::rocprofiler-sdk-common-library -+ rocprofiler-sdk::rocprofiler-sdk-amd-comgr - rocprofiler-sdk::rocprofiler-sdk-static-library - GTest::gtest - GTest::gtest_main) -diff --git a/source/lib/rocprofiler-sdk/pc_sampling/parser/tests/CMakeLists.txt b/source/lib/rocprofiler-sdk/pc_sampling/parser/tests/CMakeLists.txt -index 1c512054d6..3bb64572e1 100644 ---- a/source/lib/rocprofiler-sdk/pc_sampling/parser/tests/CMakeLists.txt -+++ b/source/lib/rocprofiler-sdk/pc_sampling/parser/tests/CMakeLists.txt -@@ -30,7 +30,9 @@ target_include_directories(pcs_gfx9_test PRIVATE ${PCTEST_INCLUDE_DIR}) - target_link_libraries( - pcs_gfx9_test - PRIVATE rocprofiler-sdk::rocprofiler-sdk-common-library -- rocprofiler-sdk::rocprofiler-sdk-static-library GTest::gtest -+ rocprofiler-sdk::rocprofiler-sdk-amd-comgr -+ rocprofiler-sdk::rocprofiler-sdk-static-library -+ GTest::gtest - GTest::gtest_main) - - gtest_add_tests( -@@ -52,7 +54,9 @@ target_include_directories(pcs_id_test PRIVATE ${PCTEST_INCLUDE_DIR}) - target_link_libraries( - pcs_id_test - PRIVATE rocprofiler-sdk::rocprofiler-sdk-common-library -- rocprofiler-sdk::rocprofiler-sdk-static-library GTest::gtest -+ rocprofiler-sdk::rocprofiler-sdk-amd-comgr -+ rocprofiler-sdk::rocprofiler-sdk-static-library -+ GTest::gtest - GTest::gtest_main) - - gtest_add_tests( -@@ -75,7 +79,9 @@ target_include_directories(pcs_bench_test PRIVATE ${PCTEST_INCLUDE_DIR}) - target_link_libraries( - pcs_bench_test - PRIVATE rocprofiler-sdk::rocprofiler-sdk-common-library -- rocprofiler-sdk::rocprofiler-sdk-static-library GTest::gtest -+ rocprofiler-sdk::rocprofiler-sdk-amd-comgr -+ rocprofiler-sdk::rocprofiler-sdk-static-library -+ GTest::gtest - GTest::gtest_main) - - add_executable(pcs_thread_test) -@@ -88,7 +94,9 @@ target_include_directories(pcs_thread_test PRIVATE ${PCTEST_INCLUDE_DIR}) - target_link_libraries( - pcs_thread_test - PRIVATE rocprofiler-sdk::rocprofiler-sdk-common-library -- rocprofiler-sdk::rocprofiler-sdk-static-library GTest::gtest -+ rocprofiler-sdk::rocprofiler-sdk-amd-comgr -+ rocprofiler-sdk::rocprofiler-sdk-static-library -+ GTest::gtest - GTest::gtest_main) - - gtest_add_tests( -@@ -111,7 +119,9 @@ target_include_directories(pcs_gfx12_test PRIVATE ${PCTEST_INCLUDE_DIR}) - target_link_libraries( - pcs_gfx12_test - PRIVATE rocprofiler-sdk::rocprofiler-sdk-common-library -- rocprofiler-sdk::rocprofiler-sdk-static-library GTest::gtest -+ rocprofiler-sdk::rocprofiler-sdk-amd-comgr -+ rocprofiler-sdk::rocprofiler-sdk-static-library -+ GTest::gtest - GTest::gtest_main) - - gtest_add_tests( -diff --git a/source/lib/rocprofiler-sdk/tests/CMakeLists.txt b/source/lib/rocprofiler-sdk/tests/CMakeLists.txt -index d71aa7c297..70dfe3376d 100644 ---- a/source/lib/rocprofiler-sdk/tests/CMakeLists.txt -+++ b/source/lib/rocprofiler-sdk/tests/CMakeLists.txt -@@ -28,6 +28,7 @@ target_sources(rocprofiler-sdk-lib-tests PRIVATE ${rocprofiler_lib_sources} - target_link_libraries( - rocprofiler-sdk-lib-tests - PRIVATE rocprofiler-sdk::rocprofiler-sdk-static-library -+ rocprofiler-sdk::rocprofiler-sdk-amd-comgr - rocprofiler-sdk::rocprofiler-sdk-common-library - rocprofiler-sdk::counter-test-constants - rocprofiler-sdk::rocprofiler-sdk-hsa-runtime -@@ -59,6 +60,7 @@ target_sources(rocprofiler-sdk-lib-tests-shared PRIVATE ${rocprofiler_shared_lib - target_link_libraries( - rocprofiler-sdk-lib-tests-shared - PRIVATE rocprofiler-sdk::rocprofiler-sdk-shared-library -+ rocprofiler-sdk::rocprofiler-sdk-amd-comgr - rocprofiler-sdk::rocprofiler-sdk-common-library - rocprofiler-sdk::rocprofiler-sdk-hsa-runtime - rocprofiler-sdk::rocprofiler-sdk-drm -diff --git a/source/lib/rocprofiler-sdk/thread_trace/tests/CMakeLists.txt b/source/lib/rocprofiler-sdk/thread_trace/tests/CMakeLists.txt -index 62acae39fb..7e867ba0a7 100644 ---- a/source/lib/rocprofiler-sdk/thread_trace/tests/CMakeLists.txt -+++ b/source/lib/rocprofiler-sdk/thread_trace/tests/CMakeLists.txt -@@ -14,6 +14,7 @@ target_link_libraries( - rocprofiler-sdk::rocprofiler-sdk-glog - rocprofiler-sdk::rocprofiler-sdk-hsa-runtime - rocprofiler-sdk::rocprofiler-sdk-hip -+ rocprofiler-sdk::rocprofiler-sdk-amd-comgr - rocprofiler-sdk::rocprofiler-sdk-common-library - GTest::gtest - GTest::gtest_main --- -2.55.0 - diff --git a/pkgs/development/rocm-modules/10/rocprofiler-sdk/0007-fix-missing-includes-and-api-changes-with-fmt-v12.2..patch b/pkgs/development/rocm-modules/10/rocprofiler-sdk/0007-fix-missing-includes-and-api-changes-with-fmt-v12.2..patch deleted file mode 100644 index 970e2a89b67d4..0000000000000 --- a/pkgs/development/rocm-modules/10/rocprofiler-sdk/0007-fix-missing-includes-and-api-changes-with-fmt-v12.2..patch +++ /dev/null @@ -1,260 +0,0 @@ -From eb68d5d6dcdb085dc3d8d18576fee7cf998f6512 Mon Sep 17 00:00:00 2001 -From: Anund -Date: Sun, 11 Oct 2026 16:59:59 +1100 -Subject: [PATCH 7/8] fix missing includes and api changes with fmt v12.2.0 - ---- - source/lib/common/logging.cpp | 1 + - source/lib/output/generateRocpd.cpp | 1 + - source/lib/output/generateStats.cpp | 1 + - source/lib/output/metadata.cpp | 1 - - source/lib/output/metadata.hpp | 2 +- - source/lib/output/sql/common.hpp | 1 + - source/lib/python/rocpd/libpyrocpd.cpp | 1 + - source/lib/python/rocpd/source/serialization/sql.cpp | 3 +++ - source/lib/python/rocpd/source/sql_generator.hpp | 3 +++ - source/lib/rocprofiler-sdk-tool/tool.cpp | 3 ++- - source/lib/rocprofiler-sdk/counters/tests/device_counting.cpp | 1 + - source/lib/rocprofiler-sdk/counters/tests/dimension.cpp | 1 + - source/lib/rocprofiler-sdk/hip/details/format.hpp | 4 ++-- - source/lib/rocprofiler-sdk/hsa/aql_packet.cpp | 2 +- - source/lib/rocprofiler-sdk/hsa/details/fmt.hpp | 3 +++ - source/lib/rocprofiler-sdk/ompt.cpp | 2 +- - .../pc_sampling/parser/pc_record_interface.cpp | 2 ++ - source/lib/tests/common/parse.cpp | 1 + - 18 files changed, 26 insertions(+), 7 deletions(-) - -diff --git a/source/lib/common/logging.cpp b/source/lib/common/logging.cpp -index 6c07322b06..24aecbc23d 100644 ---- a/source/lib/common/logging.cpp -+++ b/source/lib/common/logging.cpp -@@ -25,6 +25,7 @@ - #include "lib/common/filesystem.hpp" - - #include -+#include - #include - #include - -diff --git a/source/lib/output/generateRocpd.cpp b/source/lib/output/generateRocpd.cpp -index 564a9bd45f..65d9a5d7cf 100644 ---- a/source/lib/output/generateRocpd.cpp -+++ b/source/lib/output/generateRocpd.cpp -@@ -56,6 +56,7 @@ - #include - - #include -+#include - #include - #include - -diff --git a/source/lib/output/generateStats.cpp b/source/lib/output/generateStats.cpp -index 22c1a7f425..3860be129b 100644 ---- a/source/lib/output/generateStats.cpp -+++ b/source/lib/output/generateStats.cpp -@@ -33,6 +33,7 @@ - #include - - #include -+#include - - #include - #include -diff --git a/source/lib/output/metadata.cpp b/source/lib/output/metadata.cpp -index abe9e00b50..f68d46de5b 100644 ---- a/source/lib/output/metadata.cpp -+++ b/source/lib/output/metadata.cpp -@@ -41,7 +41,6 @@ - #include - #include - --#include - #include - - #include -diff --git a/source/lib/output/metadata.hpp b/source/lib/output/metadata.hpp -index 069401f962..a283896f29 100644 ---- a/source/lib/output/metadata.hpp -+++ b/source/lib/output/metadata.hpp -@@ -45,7 +45,7 @@ - #include - #include - --#include -+#include - - #include - #include -diff --git a/source/lib/output/sql/common.hpp b/source/lib/output/sql/common.hpp -index 40fb8df9a8..97f96e06c4 100644 ---- a/source/lib/output/sql/common.hpp -+++ b/source/lib/output/sql/common.hpp -@@ -29,6 +29,7 @@ - #include "lib/common/units.hpp" - - #include -+#include - #include - - #include -diff --git a/source/lib/python/rocpd/libpyrocpd.cpp b/source/lib/python/rocpd/libpyrocpd.cpp -index 009afd694b..8ad4eb3458 100644 ---- a/source/lib/python/rocpd/libpyrocpd.cpp -+++ b/source/lib/python/rocpd/libpyrocpd.cpp -@@ -55,6 +55,7 @@ - #include - - #include -+#include - #include - #include - #include -diff --git a/source/lib/python/rocpd/source/serialization/sql.cpp b/source/lib/python/rocpd/source/serialization/sql.cpp -index d10e878be5..9192abc45b 100644 ---- a/source/lib/python/rocpd/source/serialization/sql.cpp -+++ b/source/lib/python/rocpd/source/serialization/sql.cpp -@@ -23,6 +23,9 @@ - #include "lib/python/rocpd/source/serialization/sql.hpp" - #include "lib/output/sql/common.hpp" - -+#include -+#include -+ - namespace cereal - { - SQLite3InputArchive::SQLite3InputArchive(sqlite3* conn, -diff --git a/source/lib/python/rocpd/source/sql_generator.hpp b/source/lib/python/rocpd/source/sql_generator.hpp -index 6284857afb..881ad23a72 100644 ---- a/source/lib/python/rocpd/source/sql_generator.hpp -+++ b/source/lib/python/rocpd/source/sql_generator.hpp -@@ -38,6 +38,9 @@ - #include - #include - -+#include -+#include -+ - namespace rocpd - { - namespace tool = ::rocprofiler::tool; -diff --git a/source/lib/rocprofiler-sdk-tool/tool.cpp b/source/lib/rocprofiler-sdk-tool/tool.cpp -index 7b03fa3eb8..6ddb2274e5 100644 ---- a/source/lib/rocprofiler-sdk-tool/tool.cpp -+++ b/source/lib/rocprofiler-sdk-tool/tool.cpp -@@ -78,7 +78,8 @@ - #include - #include - --#include -+#include -+#include - - #include - #include -diff --git a/source/lib/rocprofiler-sdk/counters/tests/device_counting.cpp b/source/lib/rocprofiler-sdk/counters/tests/device_counting.cpp -index 9587b219f3..d82a6ec40b 100644 ---- a/source/lib/rocprofiler-sdk/counters/tests/device_counting.cpp -+++ b/source/lib/rocprofiler-sdk/counters/tests/device_counting.cpp -@@ -39,6 +39,7 @@ - #include - - #include -+#include - #include - #include - #include -diff --git a/source/lib/rocprofiler-sdk/counters/tests/dimension.cpp b/source/lib/rocprofiler-sdk/counters/tests/dimension.cpp -index 387c167bd0..22fcda9bf7 100644 ---- a/source/lib/rocprofiler-sdk/counters/tests/dimension.cpp -+++ b/source/lib/rocprofiler-sdk/counters/tests/dimension.cpp -@@ -39,6 +39,7 @@ - #include - - #include -+#include - #include - #include - #include -diff --git a/source/lib/rocprofiler-sdk/hip/details/format.hpp b/source/lib/rocprofiler-sdk/hip/details/format.hpp -index f65cf016a6..46f734d65d 100644 ---- a/source/lib/rocprofiler-sdk/hip/details/format.hpp -+++ b/source/lib/rocprofiler-sdk/hip/details/format.hpp -@@ -31,8 +31,8 @@ - #include - #include - --#include "fmt/core.h" --#include "fmt/ranges.h" -+#include -+#include - - #define ROCP_SDK_HIP_FORMATTER(TYPE, ...) \ - template <> \ -diff --git a/source/lib/rocprofiler-sdk/hsa/aql_packet.cpp b/source/lib/rocprofiler-sdk/hsa/aql_packet.cpp -index f1c0c3a56e..389a182e9d 100644 ---- a/source/lib/rocprofiler-sdk/hsa/aql_packet.cpp -+++ b/source/lib/rocprofiler-sdk/hsa/aql_packet.cpp -@@ -21,7 +21,7 @@ - // THE SOFTWARE. - - #include "lib/rocprofiler-sdk/hsa/aql_packet.hpp" --#include -+#include - #include - #include - #include "lib/common/logging.hpp" -diff --git a/source/lib/rocprofiler-sdk/hsa/details/fmt.hpp b/source/lib/rocprofiler-sdk/hsa/details/fmt.hpp -index c136a2739c..f0d7d9e94f 100644 ---- a/source/lib/rocprofiler-sdk/hsa/details/fmt.hpp -+++ b/source/lib/rocprofiler-sdk/hsa/details/fmt.hpp -@@ -22,6 +22,9 @@ - - #include "lib/rocprofiler-sdk/hsa/queue.hpp" - -+#include -+#include -+ - namespace fmt - { - template <> -diff --git a/source/lib/rocprofiler-sdk/ompt.cpp b/source/lib/rocprofiler-sdk/ompt.cpp -index a9ccc571c8..0d7166465a 100644 ---- a/source/lib/rocprofiler-sdk/ompt.cpp -+++ b/source/lib/rocprofiler-sdk/ompt.cpp -@@ -31,7 +31,7 @@ - #include - #include - --#include -+#include - #include - #include - -diff --git a/source/lib/rocprofiler-sdk/pc_sampling/parser/pc_record_interface.cpp b/source/lib/rocprofiler-sdk/pc_sampling/parser/pc_record_interface.cpp -index 8d418df50e..a4163529c1 100644 ---- a/source/lib/rocprofiler-sdk/pc_sampling/parser/pc_record_interface.cpp -+++ b/source/lib/rocprofiler-sdk/pc_sampling/parser/pc_record_interface.cpp -@@ -24,6 +24,8 @@ - - #include "lib/common/utility.hpp" - -+#include -+ - template <> - uint64_t - PCSamplingParserContext::alloc( -diff --git a/source/lib/tests/common/parse.cpp b/source/lib/tests/common/parse.cpp -index 5e3b63c85f..ccfc0912bc 100644 ---- a/source/lib/tests/common/parse.cpp -+++ b/source/lib/tests/common/parse.cpp -@@ -23,6 +23,7 @@ - #include - - #include -+#include - #include - - #include --- -2.55.0 - diff --git a/pkgs/development/rocm-modules/10/rocprofiler-sdk/0008-fix-compilation-errors-from-missing-includes.patch b/pkgs/development/rocm-modules/10/rocprofiler-sdk/0008-fix-compilation-errors-from-missing-includes.patch deleted file mode 100644 index ab694273ab2c2..0000000000000 --- a/pkgs/development/rocm-modules/10/rocprofiler-sdk/0008-fix-compilation-errors-from-missing-includes.patch +++ /dev/null @@ -1,93 +0,0 @@ -From 3346d7d75513445c19f04a9e972216522752e469 Mon Sep 17 00:00:00 2001 -From: Anund -Date: Sun, 11 Oct 2026 17:00:20 +1100 -Subject: [PATCH 8/8] fix compilation errors from missing includes - ---- - source/lib/att-tool/att_lib_wrapper.hpp | 2 ++ - source/lib/att-tool/wave.hpp | 1 + - source/lib/rocprofiler-sdk-rocpd/sql.cpp | 1 + - source/lib/rocprofiler-sdk/counters/metrics.cpp | 1 + - source/lib/rocprofiler-sdk/counters/metrics.hpp | 1 + - source/lib/rocprofiler-sdk/tests/status.cpp | 1 + - 6 files changed, 7 insertions(+) - -diff --git a/source/lib/att-tool/att_lib_wrapper.hpp b/source/lib/att-tool/att_lib_wrapper.hpp -index e7e58c5991..7dcd000a43 100644 ---- a/source/lib/att-tool/att_lib_wrapper.hpp -+++ b/source/lib/att-tool/att_lib_wrapper.hpp -@@ -28,9 +28,11 @@ - #include - - #include -+#include - #include - #include - #include -+#include - #include - - namespace rocprofiler -diff --git a/source/lib/att-tool/wave.hpp b/source/lib/att-tool/wave.hpp -index 1a7b1adda6..65686d8ea3 100644 ---- a/source/lib/att-tool/wave.hpp -+++ b/source/lib/att-tool/wave.hpp -@@ -29,6 +29,7 @@ - #include "waitcnt/analysis.hpp" - #include "wstates.hpp" - -+#include - #include - #include - #include -diff --git a/source/lib/rocprofiler-sdk-rocpd/sql.cpp b/source/lib/rocprofiler-sdk-rocpd/sql.cpp -index b052ec51c3..7e8742686e 100644 ---- a/source/lib/rocprofiler-sdk-rocpd/sql.cpp -+++ b/source/lib/rocprofiler-sdk-rocpd/sql.cpp -@@ -39,6 +39,7 @@ - #include - - #include -+#include - #include - #include - -diff --git a/source/lib/rocprofiler-sdk/counters/metrics.cpp b/source/lib/rocprofiler-sdk/counters/metrics.cpp -index 201ae4fd25..4780a0ba31 100644 ---- a/source/lib/rocprofiler-sdk/counters/metrics.cpp -+++ b/source/lib/rocprofiler-sdk/counters/metrics.cpp -@@ -45,6 +45,7 @@ - #include // for dladdr - #include - #include -+#include - #include - #include - -diff --git a/source/lib/rocprofiler-sdk/counters/metrics.hpp b/source/lib/rocprofiler-sdk/counters/metrics.hpp -index 7915bc8805..a893c2c9b3 100644 ---- a/source/lib/rocprofiler-sdk/counters/metrics.hpp -+++ b/source/lib/rocprofiler-sdk/counters/metrics.hpp -@@ -35,6 +35,7 @@ - #include - #include - #include -+#include - - namespace rocprofiler - { -diff --git a/source/lib/rocprofiler-sdk/tests/status.cpp b/source/lib/rocprofiler-sdk/tests/status.cpp -index a5a492101d..b01f511b99 100644 ---- a/source/lib/rocprofiler-sdk/tests/status.cpp -+++ b/source/lib/rocprofiler-sdk/tests/status.cpp -@@ -25,6 +25,7 @@ - - #include - -+#include - #include - - TEST(rocprofiler_lib, error_string) --- -2.55.0 - diff --git a/pkgs/development/rocm-modules/10/rocprofiler-sdk/0009-rocprofiler-sdk-guard-ompt-auto-start.patch b/pkgs/development/rocm-modules/10/rocprofiler-sdk/0009-rocprofiler-sdk-guard-ompt-auto-start.patch deleted file mode 100644 index 147d79483318e..0000000000000 --- a/pkgs/development/rocm-modules/10/rocprofiler-sdk/0009-rocprofiler-sdk-guard-ompt-auto-start.patch +++ /dev/null @@ -1,50 +0,0 @@ -From 502d2df0ddd84f0f2fa718b9a02ee0f01f36dac1 Mon Sep 17 00:00:00 2001 -From: Luna Nova -Date: Tue, 2 Jun 2026 01:31:05 -0700 -Subject: [PATCH] [rocprofiler-sdk] don't auto-start OMPT tool before glog is - initialized - -The OpenMP runtime resolves its weak ompt_start_tool to the strong symbol we -export and calls it during OpenMP init. That can fire from an unrelated -library's constructor (observed: OpenBLAS calling omp_get_num_places) while -librocprofiler-sdk is still being dlopen'd. init_logging() then dereferences -glog's gflags FLAGS_vmodule, whose backing pointer is still null until glog's -static initializers run, and the process segfaults on `import torch`. - -The init order is not reliably fixable from here: a dependency cycle among the -ROCm libraries makes the loader run our constructors before libglog's, so a -flag set by our own constructor does not imply glog is ready. Instead gate the -tool start on glog itself, by testing whether gflags has populated FLAGS_vmodule -yet; reading the raw pointer is safe even before construction. It is read via an -asm label because the gflags header only exposes it as a reference, which the -compiler assumes is never null. Declining (nullptr) when glog is not yet ready -is a valid OMPT "no tool" response; deliberate profiling (rocprofv3 preloads the -tool early, before such constructors) is unaffected. ---- - source/lib/rocprofiler-sdk/ompt.cpp | 4 ++++ - 1 file changed, 4 insertions(+) - -diff --git a/source/lib/rocprofiler-sdk/ompt.cpp b/source/lib/rocprofiler-sdk/ompt.cpp -index a9ccc57..3231087 100644 ---- a/source/lib/rocprofiler-sdk/ompt.cpp -+++ b/source/lib/rocprofiler-sdk/ompt.cpp -@@ -199,6 +199,8 @@ finalize_ompt() - } // namespace ompt - } // namespace rocprofiler - -+extern void* const rocprofiler_glog_vmodule_flag asm("_ZN3fLS13FLAGS_vmoduleB5cxx11E"); -+ - extern "C" { - - rocprofiler_status_t -@@ -245,6 +247,8 @@ ompt_start_tool(unsigned int omp_version, const char* runtime_version) ROCPROFIL - ompt_start_tool_result_t* - ompt_start_tool(unsigned int omp_version, const char* runtime_version) - { -+ if(rocprofiler_glog_vmodule_flag == nullptr) return nullptr; -+ - ::rocprofiler::registration::init_logging(); - ::rocprofiler::registration::initialize(); - return rocprofiler_ompt_start_tool(omp_version, runtime_version); --- -2.54.0 diff --git a/pkgs/development/rocm-modules/10/rocprofiler-sdk/default.nix b/pkgs/development/rocm-modules/10/rocprofiler-sdk/default.nix index a93c5e93c4e3e..6da6fe8b92773 100644 --- a/pkgs/development/rocm-modules/10/rocprofiler-sdk/default.nix +++ b/pkgs/development/rocm-modules/10/rocprofiler-sdk/default.nix @@ -25,9 +25,7 @@ xz, numactl, fmt, - glog, gtest, - fetchpatch, yaml-cpp, elfio, nlohmann_json, @@ -46,7 +44,7 @@ # rocprofiler-sdk is the home of rocprofv3 stdenv.mkDerivation (finalAttrs: { pname = "rocprofiler-sdk"; - version = "7.2.4"; + version = "10.1"; outputs = [ "out" @@ -56,8 +54,8 @@ stdenv.mkDerivation (finalAttrs: { src = fetchFromGitHub { owner = "ROCm"; repo = "rocm-systems"; - tag = "rocm-${finalAttrs.version}"; - hash = "sha256-7XCxu917Mgp3SQAKlTWj3ympgwOYW3aJFcOv/GhPk1c="; + tag = "therock-${finalAttrs.version}"; + hash = "sha256-UmYHC+87XIW+Z4WVd7k0MQ9baTvFlq/SgCt9Foy1mPI="; fetchSubmodules = true; sparseCheckout = [ "projects/rocprofiler-sdk" @@ -82,6 +80,9 @@ stdenv.mkDerivation (finalAttrs: { rocm-runtime rocprofiler-register aqlprofile + # rocprofiler-sdk-tool does find_package(rocprof-trace-decoder REQUIRED) at + # configure time for the ATT quick-scan feature. + rocprof-trace-decoder rocm-comgr libdrm elfutils @@ -92,7 +93,6 @@ stdenv.mkDerivation (finalAttrs: { xz numactl fmt - glog gtest yaml-cpp elfio @@ -102,70 +102,40 @@ stdenv.mkDerivation (finalAttrs: { ]; patches = [ - (fetchpatch { - # Fix missing amd_comgr linkage in pc-sampling integration test - url = "https://github.com/ROCm/rocm-systems/commit/94a4595a5d02bc066f7a32e1b2134a99a5231213.patch"; - hash = "sha256-86Fx0bKL0pvXTwVN8QJL+yzCbMYkmMaKzcU4PYcW6ig="; - relative = "projects/rocprofiler-sdk"; - }) - ] - ++ [ - # Just the missing CPackComponent reference sourced from this commit: - # https://github.com/ROCm/rocm-systems/commit/86ee7b2eb2273adaf1181ef9a6b2091465c6f0c7 - ./0001-fix-missing-CPackComponent-cmake-include.patch - ] - ++ [ - # Can be removed when a release contains the changes found in this pr: - # https://github.com/ROCm/rocm-systems/pull/4721 - ./0002-allow-using-system-yaml-dependency.patch - ./0003-allow-using-system-elfio-dependency.patch - ./0004-allow-using-system-otf2-dependency.patch - ./0005-allow-using-system-json-dependency.patch - ./0006-fix-amd-comgr-resolution.patch - ] - ++ [ - # Sourced from several commits that address issues with fmt, dropping conflicting changes no longer needed to build - # https://github.com/ROCm/rocm-systems/commit/36d9d33d90879bfbd406498011070ebd929a56b1 - # https://github.com/ROCm/rocm-systems/commit/e2f588592ecfb0653ed5b3078753186325adf70a - # https://github.com/ROCm/rocm-systems/commit/86ee7b2eb2273adaf1181ef9a6b2091465c6f0c7 (just the fmt changes) - ./0007-fix-missing-includes-and-api-changes-with-fmt-v12.2..patch - ] - ++ [ - # One new import failure added to source commit: - # https://github.com/ROCm/rocm-systems/pull/4721/changes/f7f24a54cbe55425fbefc87c7a3d0f4c85224948 - # which is also part of https://github.com/ROCm/rocm-systems/pull/4721 - ./0008-fix-compilation-errors-from-missing-includes.patch - ] - ++ [ - # Prevent a segfault on `import torch` (and other consumers that link - # librocprofiler-sdk for tracing) when OpenMP auto-discovers our - # ompt_start_tool before glog is initialized. Upstream incidentally fixes - # this by dropping glog in rocm-systems d80117889b3f - # "[rocprofiler-sdk] Migrate from glog to Abseil Logging (#4668)", which - # is too invasive (40 files + new abseil submodule) to backport. - ./0009-rocprofiler-sdk-guard-ompt-auto-start.patch + ./ompt-explicit-tool.patch ]; postPatch = '' - # NixOS' ROCm distribution does not support libomptarget yet - substituteInPlace samples/CMakeLists.txt \ - --replace-fail 'add_subdirectory(openmp_target)' '# add_subdirectory(openmp_target)' - substituteInPlace tests/CMakeLists.txt \ - --replace-fail 'add_subdirectory(openmp-tools)' '# add_subdirectory(openmp-tools)' - substituteInPlace tests/bin/CMakeLists.txt \ - --replace-fail 'add_subdirectory(openmp)' '# add_subdirectory(openmp)' - - # This requires building perfetto's trace-processor-shell via a weird external script - substituteInPlace tests/CMakeLists.txt \ - --replace-fail 'add_subdirectory(pytest-packages)' "" - - patchShebangs source/libexec/rocprofiler-sdk/rocprofiler-sdk-launch-compiler/rocprofiler-sdk-launch-compiler.sh + # NixOS' ROCm distribution does not support libomptarget yet + substituteInPlace samples/CMakeLists.txt \ + --replace-fail 'add_subdirectory(openmp_target)' '# add_subdirectory(openmp_target)' + substituteInPlace tests/CMakeLists.txt \ + --replace-fail 'add_subdirectory(openmp-tools)' '# add_subdirectory(openmp-tools)' + substituteInPlace tests/bin/CMakeLists.txt \ + --replace-fail 'add_subdirectory(openmp)' '# add_subdirectory(openmp)' + + # This requires building perfetto's trace-processor-shell via a weird external script + substituteInPlace tests/CMakeLists.txt \ + --replace-fail 'add_subdirectory(pytest-packages)' "" + + # The sources have bare system includes (`` in the output/sql + + # python-binding sources, `` in the vendored aqlprofile) + # that assume a distro-style /usr/include. nixpkgs keeps those headers in the + # packages' dev outputs, and the rocm-toolchain clang used here + # (-DCMAKE_CXX_COMPILER=clang++, unwrapped) ignores NIX_CFLAGS_COMPILE, so add + # them as a real CMake -isystem at the top of the tree. (A global + # -DCMAKE_CXX_FLAGS instead would clobber abseil's C++-standard detection.) + substituteInPlace CMakeLists.txt \ + --replace-fail 'add_subdirectory(external)' \ + 'include_directories(SYSTEM ${lib.getDev sqlite}/include ${lib.getDev libdrm}/include) + add_subdirectory(external)' + + patchShebangs source/libexec/rocprofiler-sdk/rocprofiler-sdk-launch-compiler/rocprofiler-sdk-launch-compiler.sh ''; cmakeFlags = [ (lib.cmakeBool "ROCPROFILER_BUILD_GHC_FS" false) (lib.cmakeBool "ROCPROFILER_BUILD_FMT" false) - (lib.cmakeBool "ROCPROFILER_BUILD_GLOG" false) (lib.cmakeBool "ROCPROFILER_BUILD_GTEST" false) (lib.cmakeBool "ROCPROFILER_BUILD_PYBIND11" false) (lib.cmakeBool "ROCPROFILER_BUILD_YAML_CPP" false) @@ -192,9 +162,6 @@ stdenv.mkDerivation (finalAttrs: { # building tests or samples. (lib.cmakeFeature "GPU_TARGETS" (lib.concatStringsSep ";" gpuTargets)) ]; - cxxCMakeFlags = [ - "-Wno-unused-variable" - ]; doCheck = false; # Requires GPU diff --git a/pkgs/development/rocm-modules/10/rocprofiler-sdk/ompt-explicit-tool.patch b/pkgs/development/rocm-modules/10/rocprofiler-sdk/ompt-explicit-tool.patch new file mode 100644 index 0000000000000..75f57e30e6e47 --- /dev/null +++ b/pkgs/development/rocm-modules/10/rocprofiler-sdk/ompt-explicit-tool.patch @@ -0,0 +1,76 @@ +Subject: [PATCH] Avoid unsolicited OMPT initialization + +OpenMP calls ompt_start_tool from its own initialization, which can run +inside a library constructor. Registering clients from there dlopens every +library that defines rocprofiler_configure; if one of them is still being +loaded (PyTorch's libtorch_cpu, for Kineto), glibc reruns pending +constructors and OpenBLAS reenters OpenMP initialization, which livelocks +on its init lock. Decline the tool unless one was requested through +ROCP_TOOL_LIBRARIES (as rocprofv3 does) or rocprofiler_force_configure. +Clients found by symbol still register when the HIP runtime starts; they +only miss OMPT callbacks. + +OpenMP queries ompt_start_tool only once, at startup, so attaching a +profiler to an already running process cannot enable OMPT tracing; the +other services are unaffected. + +--- a/source/lib/rocprofiler-sdk/ompt.cpp ++++ b/source/lib/rocprofiler-sdk/ompt.cpp +@@ -265,6 +265,9 @@ ompt_start_tool(unsigned int omp_version, const char* runtime_version) ROCPROFIL + ompt_start_tool_result_t* + ompt_start_tool(unsigned int omp_version, const char* runtime_version) + { ++ // Registering clients during OpenMP startup can reenter it (see above). ++ if(!::rocprofiler::registration::is_tool_requested()) return nullptr; ++ + ::rocprofiler::registration::init_logging(); + ::rocprofiler::registration::initialize(); + return rocprofiler_ompt_start_tool(omp_version, runtime_version); +--- a/source/lib/rocprofiler-sdk/registration.cpp ++++ b/source/lib/rocprofiler-sdk/registration.cpp +@@ -86,6 +86,7 @@ + #include + #include + #include ++#include + #include + #include + #include +@@ -1039,6 +1040,16 @@ get_client_offset() + return _v; + } + ++static std::atomic forced_configure_requested{false}; ++ ++bool ++is_tool_requested() ++{ ++ if(forced_configure_requested.load(std::memory_order_acquire)) return true; ++ const auto* tools = secure_getenv("ROCP_TOOL_LIBRARIES"); ++ return tools && *tools; ++} ++ + int + get_init_status() + { +@@ -1235,6 +1246,8 @@ rocprofiler_force_configure(rocprofiler_configure_func_t configure_func) + + if(rocprofiler::registration::get_fini_status() != 0) return ROCPROFILER_STATUS_ERROR_FINALIZED; + ++ rocprofiler::registration::forced_configure_requested.store(true, std::memory_order_release); ++ + ROCP_INFO << "forcing rocprofiler configuration"; + + auto* forced_configs = rocprofiler::registration::get_forced_configures(); +--- a/source/lib/rocprofiler-sdk/registration.hpp ++++ b/source/lib/rocprofiler-sdk/registration.hpp +@@ -49,6 +49,9 @@ namespace registration + void + init_logging(); + ++bool ++is_tool_requested(); ++ + // initialize the clients + void + initialize(); From e01bc52f9be9e141650ddd589330650a7d3d5fbb Mon Sep 17 00:00:00 2001 From: randomizedcoder Date: Thu, 22 Oct 2026 07:18:59 -0700 Subject: [PATCH 12/12] rocmPackages_10.rocshmem: init at 10.1 Update the rocmPackages.rocshmem copy from the previous commit to ROCm 10.1 and add it to the rocmPackages_10 scope. From "rocmPackages.rocshmem: move to rocm-systems monorepo, fix device bitcode": rocSHMEM moved into the rocm-systems monorepo in ROCm 10. Switch to the sparse-checkout source and fix its device-bitcode build: cmake/DeviceBitcode.cmake compiles device-side .bc with a manual clang command whose -I list omits the HSA headers (the host librocshmem.a gets them via the hsa-runtime64 link interface), so the bitcode build failed with "'hsa/hsa.h' file not found". Add rocm-runtime's include dir to the bitcode flags. Assisted-by: Claude Code (claude-opus-5-5) --- pkgs/development/rocm-modules/10/default.nix | 2 ++ .../rocm-modules/10/rocshmem/default.nix | 23 +++++++++++++++---- 2 files changed, 21 insertions(+), 4 deletions(-) diff --git a/pkgs/development/rocm-modules/10/default.nix b/pkgs/development/rocm-modules/10/default.nix index fc166698fcda2..ca6fa75dbb7ff 100644 --- a/pkgs/development/rocm-modules/10/default.nix +++ b/pkgs/development/rocm-modules/10/default.nix @@ -107,6 +107,8 @@ let rccl = self.callPackage ./rccl { }; + rocshmem = self.callPackage ./rocshmem { }; + half = self.callPackage ./half { }; # Even if config.rocmSupport is false we need rocmSupport true diff --git a/pkgs/development/rocm-modules/10/rocshmem/default.nix b/pkgs/development/rocm-modules/10/rocshmem/default.nix index 33c8f4cce5a46..c18d6c77da492 100644 --- a/pkgs/development/rocm-modules/10/rocshmem/default.nix +++ b/pkgs/development/rocm-modules/10/rocshmem/default.nix @@ -17,14 +17,20 @@ stdenv.mkDerivation (finalAttrs: { pname = "rocshmem${clr.gpuArchSuffix}"; - version = "7.2.4"; + version = "10.1"; src = fetchFromGitHub { owner = "ROCm"; - repo = "rocSHMEM"; - tag = "rocm-${finalAttrs.version}"; - hash = "sha256-7TiUABwCVPvosoLdR8zN+QGiX+OD7iD+HKMLnGMmRYA="; + # rocSHMEM lives in the rocm-systems monorepo since ROCm 10 + repo = "rocm-systems"; + tag = "therock-${finalAttrs.version}"; + sparseCheckout = [ + "projects/rocshmem" + "shared" + ]; + hash = "sha256-uVUHYyJbaE5vauN1mczLf7rYNxRSD93eJDIDbzbYzHs="; }; + sourceRoot = "${finalAttrs.src.name}/projects/rocshmem"; nativeBuildInputs = [ cmake @@ -39,6 +45,15 @@ stdenv.mkDerivation (finalAttrs: { mpi ]; + # The device bitcode command does not see the HSA headers the host target gets. + postPatch = '' + substituteInPlace cmake/DeviceBitcode.cmake \ + --replace-fail \ + '-Xclang -mcode-object-version=none' \ + '-Xclang -mcode-object-version=none + -I${rocm-runtime}/include' + ''; + cmakeFlags = [ (lib.cmakeBool "CMAKE_POSITION_INDEPENDENT_CODE" true) (lib.cmakeFeature "CMAKE_CXX_COMPILER" "hipcc")