Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 13 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,8 @@ if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
endif()

set(ROCM_MAJOR_VERSION 6)
set(ROCM_MINOR_VERSION 3)
set(ROCM_PATCH_VERSION 1)
set(ROCM_MINOR_VERSION 4)
set(ROCM_PATCH_VERSION 0)

################################################################################
# Feature selection
Expand All @@ -63,6 +63,7 @@ cmake_dependent_option(THEROCK_ENABLE_CORE "Enable building of core libraries" O
cmake_dependent_option(THEROCK_ENABLE_COMM_LIBS "Enable building of comm libraries" ON "THEROCK_ENABLE_ALL" OFF)
cmake_dependent_option(THEROCK_ENABLE_MATH_LIBS "Enable building of math libraries" ON "THEROCK_ENABLE_ALL" OFF)
cmake_dependent_option(THEROCK_ENABLE_ML_LIBS "Enable building of ML libraries" ON "THEROCK_ENABLE_ALL" OFF)
cmake_dependent_option(THEROCK_ENABLE_PROFILER "Enable building the profiler libraries" ON "THEROCK_ENABLE_ALL" OFF)
option(THEROCK_ENABLE_HOST_MATH "Build all bundled host math libraries by default" OFF)
option(THEROCK_RESET_FEATURES "One-shot flag which forces all feature flags to their default state for this configuration run" OFF)

Expand Down Expand Up @@ -99,6 +100,13 @@ therock_add_feature(HIP_RUNTIME
REQUIRES COMPILER CORE_RUNTIME
)

# Profiler Features.
therock_add_feature(PROFILER_SDK
GROUP PROFILER
DESCRIPTION "Enables the rocprofiler-sdk project"
REQUIRES HIP_RUNTIME
)

# Comm-libs Features.
therock_add_feature(RCCL
GROUP COMM_LIBS
Expand Down Expand Up @@ -210,6 +218,9 @@ add_subdirectory(base)
if(NOT WIN32)
add_subdirectory(compiler)
add_subdirectory(core)
# Note that rocprofiler-register is in base and is what higher level clients
# depend on. The profiler itself is independent.
add_subdirectory(profiler)
add_subdirectory(comm-libs)
add_subdirectory(math-libs)
add_subdirectory(ml-libs)
Expand Down
4 changes: 2 additions & 2 deletions HIP_VERSION.in
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
${ROCM_MAJOR_VERSION}
0
0
${ROCM_MINOR_VERSION}
${ROCM_PATCH_VERSION}
5 changes: 5 additions & 0 deletions build_tools/fetch_sources.py
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,8 @@ def populate_ancillary_sources(args):
but it is also often broken. So we just do the right thing here as a transitionary
step to fixing the underlying software packages."""
populate_submodules_if_exists(args.dir / "rocprofiler-register")
populate_submodules_if_exists(args.dir / "rocprofiler-sdk")
populate_submodules_if_exists(args.dir / "rocprofiler-systems")


def populate_submodules_if_exists(git_dir: Path):
Expand Down Expand Up @@ -187,6 +189,9 @@ def main(argv):
"rocm-core",
"rocminfo",
"rocprofiler-register",
"rocprofiler-compute",
"rocprofiler-sdk",
"rocprofiler-systems",
"ROCR-Runtime",
],
)
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
From b6bd3ab99c8a9a15a8ad3d51d40807392aed27e8 Mon Sep 17 00:00:00 2001
From: Stella Laurenzo <stellaraccident@gmail.com>
Date: Wed, 12 Feb 2025 18:38:02 -0800
Subject: [PATCH] Extend the hack to propagate HIP usage requirements a bit
further.

* Also fetches usage requirements from hip::amdhip64 -> rocprofiler-sdk-hip-nolink
* Adds rocprofiler-sdk-hip-nolink as a dependency of two libraries that indirectly depend on hip headers via hip.h.
* The above may not be completely as precise as it can be (it seems like there should be an intermediate library for this of some kind).
* Also conditions the link of hsa-amd-aqlprofile64_library on whether the library was found. I have no idea if this is correct, but I don't have that library and lack an easy way to get it. Since the find_library can fail, I am left assuming it is optional (otherwise, there should be some error reporting). The resulting libraries seem to have all symbols defined.
---
cmake/rocprofiler_config_interfaces.cmake | 11 ++++++++++-
source/lib/common/container/CMakeLists.txt | 1 +
source/lib/output/CMakeLists.txt | 3 ++-
3 files changed, 13 insertions(+), 2 deletions(-)

diff --git a/cmake/rocprofiler_config_interfaces.cmake b/cmake/rocprofiler_config_interfaces.cmake
index a01a6df..47c6eaf 100644
--- a/cmake/rocprofiler_config_interfaces.cmake
+++ b/cmake/rocprofiler_config_interfaces.cmake
@@ -127,7 +127,14 @@ find_package(
${rocm_version_DIR}
${ROCM_PATH})
target_link_libraries(rocprofiler-sdk-hip INTERFACE hip::host)
+# TODO: As of 2024/2/12, the hip::host target does not advertise its
+# include directory but amdhip64 does. This ordinarily wouldn't be an issue
+# because most folks just get it transitively, but here this is doing direct
+# property copying to get usage requirements.
+# The proper fix is for hip to export a hip::headers target with only usage
+# requirements and depend on that.
rocprofiler_config_nolink_target(rocprofiler-sdk-hip-nolink hip::host)
+rocprofiler_config_nolink_target(rocprofiler-sdk-hip-nolink hip::amdhip64)

# ----------------------------------------------------------------------------------------#
#
@@ -218,7 +225,9 @@ find_library(
HINTS ${rocm_version_DIR} ${ROCM_PATH}
PATHS ${rocm_version_DIR} ${ROCM_PATH})

-target_link_libraries(rocprofiler-sdk-hsa-aql INTERFACE ${hsa-amd-aqlprofile64_library})
+if(hsa-amd-aqlprofile64_library)
+ target_link_libraries(rocprofiler-sdk-hsa-aql INTERFACE ${hsa-amd-aqlprofile64_library})
+endif()

# ----------------------------------------------------------------------------------------#
#
diff --git a/source/lib/common/container/CMakeLists.txt b/source/lib/common/container/CMakeLists.txt
index f1ab957..b152ebd 100644
--- a/source/lib/common/container/CMakeLists.txt
+++ b/source/lib/common/container/CMakeLists.txt
@@ -9,3 +9,4 @@ set(containers_sources ring_buffer.cpp record_header_buffer.cpp ring_buffer.cpp

target_sources(rocprofiler-sdk-common-library PRIVATE ${containers_sources}
${containers_headers})
+target_link_libraries(rocprofiler-sdk-common-library PRIVATE rocprofiler-sdk-hip-nolink)
diff --git a/source/lib/output/CMakeLists.txt b/source/lib/output/CMakeLists.txt
index ca65538..fa2f3ad 100644
--- a/source/lib/output/CMakeLists.txt
+++ b/source/lib/output/CMakeLists.txt
@@ -60,4 +60,5 @@ target_link_libraries(
rocprofiler-sdk::rocprofiler-sdk-common-library
rocprofiler-sdk::rocprofiler-sdk-cereal
rocprofiler-sdk::rocprofiler-sdk-perfetto
- rocprofiler-sdk::rocprofiler-sdk-otf2)
+ rocprofiler-sdk::rocprofiler-sdk-otf2
+ rocprofiler-sdk-hip-nolink)
--
2.43.0

32 changes: 32 additions & 0 deletions profiler/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
if(THEROCK_ENABLE_PROFILER_SDK)

##############################################################################
# rocprofiler-sdk
##############################################################################
therock_cmake_subproject_declare(rocprofiler-sdk
EXTERNAL_SOURCE_DIR "rocprofiler-sdk"
BACKGROUND_BUILD
CMAKE_ARGS
-DHIP_PLATFORM=amd
RUNTIME_DEPS
hip-clr
rocprofiler-register
)
therock_cmake_subproject_provide_package(rocprofiler-sdk rocprofiler-sdk lib/cmake/rocprofiler-sdk)
therock_cmake_subproject_provide_package(rocprofiler-sdk rocprofiler-sdk-roctx lib/cmake/rocprofiler-sdk-roctx)
therock_cmake_subproject_activate(rocprofiler-sdk)

therock_provide_artifact(rocprofiler-sdk
TARGET_NEUTRAL
DESCRIPTOR artifact-rocprofiler-sdk.toml
COMPONENTS
dbg
dev
doc
lib
run
SUBPROJECT_DEPS
rocprofiler-sdk
)

endif(THEROCK_ENABLE_PROFILER_SDK)
19 changes: 19 additions & 0 deletions profiler/artifact-rocprofiler-sdk.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# rocprofiler-sdk
[components.dbg."profiler/rocprofiler-sdk/stage"]
[components.dev."profiler/rocprofiler-sdk/stage"]
include = [
"share/rocprofiler-sdk/samples/**",
]
[components.doc."profiler/rocprofiler-sdk/stage"]
[components.lib."profiler/rocprofiler-sdk/stage"]
include = [
"libexec/rocprofiler-sdk/**",
]
[components.run."profiler/rocprofiler-sdk/stage"]
include = [
"bin/**",
]
[components.test."profiler/rocprofiler-sdk/stage"]
include = [
"share/rocprofiler-sdk/tests/**",
]
1 change: 1 addition & 0 deletions profiler/rocprofiler-compute
1 change: 1 addition & 0 deletions profiler/rocprofiler-sdk
1 change: 1 addition & 0 deletions profiler/rocprofiler-systems
Loading