Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update roctracer_spec.md #68

Open
wants to merge 32 commits into
base: amd-master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
6fffa50
optimized tool stats;
Aug 11, 2020
db1ccb0
flush-rate option fixed;
Aug 15, 2020
dae98a3
Format ostream ops;
Aug 28, 2020
b730da0
Fix for trace checker
rkebichi Sep 11, 2020
4c2b6cb
codeobj tracing prof protocol
Sep 19, 2020
35bc1e9
gen_ostream_ops.py fix - ostream operators as inline static
Sep 9, 2020
5bf3efa
build normalizing - generating under build directory
Sep 7, 2020
401c48b
testing using v3 object
Sep 17, 2020
96ea2d6
HCC_HOME env cleanup
Sep 11, 2020
28e4b8e
SWDEV-253997 : packaging fix: installing hsa_ostream_ops.h
Sep 25, 2020
367e2c4
SWDEV-251491 : gen_ostream_ops.py porting to python3
Oct 1, 2020
fb0c230
SWDEV-249924 : hip correlation id explicite propogation; tracer debug…
Sep 22, 2020
8bb2d30
SWDEV-258731 : cleanup
Oct 30, 2020
9f02bb9
Add RUNPATH to libtracer_tool.so
pruthvistony-amd Jun 5, 2020
73fb6ea
CMakeList.txt: conformant package names
nelsonc-amd Oct 16, 2020
0876c25
SWDEV-251491 : disabling hipModuleUnload tracing which is called on exit
Oct 1, 2020
18c83ea
hip library loader check
Sep 23, 2020
d8d7137
SWDEV-213367 : codeobj event implementation
Sep 3, 2020
c163244
SWDEV-254329 : extending debug trace with timestamps, cmake option '-…
Oct 13, 2020
2293663
code obj tests: adding load base
Oct 15, 2020
68b1850
SWDEV-255938 NEW - added regex and depth support to ostream ops
rkebichi Nov 18, 2020
ff8ac19
adding tests dry run to check if platform is in working state
Nov 23, 2020
d4cd091
Adding dumping of HSA handles
Nov 3, 2020
bf70a1a
SWDEV-264282 : fixing tracer_tool linking
Dec 10, 2020
bfb9095
calling python3 explictely
Dec 10, 2020
3c1a4b3
SWDEV-259683 HIP API records filtering
rkebichi Nov 18, 2020
36b1b2f
SWDEV-251491 : disabling tracing on exit
Dec 22, 2020
7ea1e9a
SWDEV-251491 : fixing tracing on exit
Dec 25, 2020
2a64bd0
SWDEV-271503 Fixed core dump
rkebichi Mar 25, 2021
89ab109
SWDEV-281008 replace hcc_detail by amd_detail
rkebichi Apr 14, 2021
f32619b
updating known issues
ammarwa Oct 28, 2021
c253c8a
Update roctracer_spec.md
RawSwat Jan 17, 2022
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
49 changes: 44 additions & 5 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -100,12 +100,15 @@ set ( PUBLIC_HEADERS
roctracer_kfd.h
roctracer_roctx.h
roctracer_cb_table.h
ext/prof_protocol.h
ext/hsa_rt_utils.hpp
)
set ( GEN_HEADERS
hip_ostream_ops.h
hsa_prof_str.h
kfd_ostream_ops.h
hsa_ostream_ops.h
kfd_prof_str.h
ext/prof_protocol.h
ext/hsa_rt_utils.hpp
kfd_ostream_ops.h
)

if ( ${LIBRARY_TYPE} STREQUAL SHARED )
Expand Down Expand Up @@ -137,6 +140,11 @@ foreach ( header ${PUBLIC_HEADERS} )
install ( FILES ${CMAKE_CURRENT_SOURCE_DIR}/inc/${header} DESTINATION ${DEST_NAME}/include/${header_subdir} )
install ( FILES ${CMAKE_CURRENT_SOURCE_DIR}/inc/${header} DESTINATION include/${DEST_NAME}/${header_subdir} )
endforeach ()
foreach ( header ${GEN_HEADERS} )
get_filename_component ( header_subdir ${header} DIRECTORY )
install ( FILES ${PROJECT_BINARY_DIR}/inc/${header} DESTINATION ${DEST_NAME}/include/${header_subdir} )
install ( FILES ${PROJECT_BINARY_DIR}/inc/${header} DESTINATION include/${DEST_NAME}/${header_subdir} )
endforeach ()
#install ( FILES ${PROJECT_BINARY_DIR}/inc-link DESTINATION include RENAME ${DEST_NAME} )
install ( FILES ${PROJECT_BINARY_DIR}/so-link DESTINATION lib RENAME ${ROCTRACER_LIBRARY}.so )
install ( FILES ${PROJECT_BINARY_DIR}/so-major-link DESTINATION lib RENAME ${ROCTRACER_LIBRARY}.so.${LIB_VERSION_MAJOR} )
Expand Down Expand Up @@ -169,18 +177,49 @@ install ( TARGETS "kfdwrapper64" LIBRARY DESTINATION ${DEST_NAME}/lib )
## Packaging directives
set ( CPACK_GENERATOR "DEB" "RPM" "TGZ" )
set ( CPACK_PACKAGE_NAME "${ROCTRACER_NAME}-dev" )
set ( CPACK_PACKAGE_VENDOR "AMD" )
set ( CPACK_PACKAGE_VENDOR "Advanced Micro Devices, Inc." )
set ( CPACK_PACKAGE_VERSION_MAJOR ${BUILD_VERSION_MAJOR} )
set ( CPACK_PACKAGE_VERSION_MINOR ${BUILD_VERSION_MINOR} )
set ( CPACK_PACKAGE_VERSION_PATCH ${BUILD_VERSION_PATCH} )
set ( CPACK_PACKAGE_CONTACT "Advanced Micro Devices Inc." )
set ( CPACK_PACKAGE_VERSION "${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH}" )
if ( DEFINED ENV{ROCM_LIBPATCH_VERSION} )
set ( CPACK_PACKAGE_VERSION "${CPACK_PACKAGE_VERSION}.$ENV{ROCM_LIBPATCH_VERSION}" )
endif()
message ( "-- CPACK_PACKAGE_VERSION: ${CPACK_PACKAGE_VERSION}" )
set ( CPACK_PACKAGE_CONTACT "TODO <Add a valid email id>" )
set ( CPACK_PACKAGE_DESCRIPTION_SUMMARY "AMD ROCTRACER library" )
set ( CPACK_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_SOURCE_DIR}/LICENSE" )

## Debian package specific variables
if ( DEFINED ENV{CPACK_DEBIAN_PACKAGE_RELEASE} )
set ( CPACK_DEBIAN_PACKAGE_RELEASE $ENV{CPACK_DEBIAN_PACKAGE_RELEASE} )
else()
set ( CPACK_DEBIAN_PACKAGE_RELEASE "local" )
endif()
message ( "Using CPACK_DEBIAN_PACKAGE_RELEASE ${CPACK_DEBIAN_PACKAGE_RELEASE}" )
set ( CPACK_DEBIAN_FILE_NAME "DEB-DEFAULT" )
set ( CPACK_DEBIAN_PACKAGE_CONTROL_EXTRA "${CMAKE_CURRENT_SOURCE_DIR}/DEBIAN/postinst;${CMAKE_CURRENT_SOURCE_DIR}/DEBIAN/prerm" )

## RPM package specific variables
if ( DEFINED ENV{CPACK_RPM_PACKAGE_RELEASE} )
set ( CPACK_RPM_PACKAGE_RELEASE $ENV{CPACK_RPM_PACKAGE_RELEASE} )
else()
set ( CPACK_RPM_PACKAGE_RELEASE "local" )
endif()
message ( "Using CPACK_RPM_PACKAGE_RELEASE ${CPACK_RPM_PACKAGE_RELEASE}" )

## 'dist' breaks manual builds on debian systems due to empty Provides
execute_process( COMMAND rpm --eval %{?dist}
RESULT_VARIABLE PROC_RESULT
OUTPUT_VARIABLE EVAL_RESULT
OUTPUT_STRIP_TRAILING_WHITESPACE )
message("RESULT_VARIABLE ${PROC_RESULT} OUTPUT_VARIABLE: ${EVAL_RESULT}")

if ( PROC_RESULT EQUAL "0" AND NOT EVAL_RESULT STREQUAL "" )
string ( APPEND CPACK_RPM_PACKAGE_RELEASE "%{?dist}" )
endif()
set ( CPACK_RPM_FILE_NAME "RPM-DEFAULT" )
message("CPACK_RPM_PACKAGE_RELEASE: ${CPACK_RPM_PACKAGE_RELEASE}")
set ( CPACK_RPM_POST_INSTALL_SCRIPT_FILE "${CMAKE_CURRENT_SOURCE_DIR}/RPM/rpm_post" )
set ( CPACK_RPM_POST_UNINSTALL_SCRIPT_FILE "${CMAKE_CURRENT_SOURCE_DIR}/RPM/rpm_postun" )

Expand Down
8 changes: 6 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,8 @@ rocTX API:

- Set environment:
export CMAKE_PREFIX_PATH=/opt/rocm
- To use custom HIP/HCC versions:
- To use custom HIP version:
export HIP_PATH=/opt/rocm/hip
export HCC_HOME=/opt/rocm/hcc

- To build roctracer library:
export CMAKE_BUILD_TYPE=<debug|release> # release by default
Expand All @@ -74,3 +73,8 @@ rocTX API:
or
make package && dpkg -i *.deb
```

## Known Issues:
- For workloads where the hip application might make more than 10 million HIP API calls, the application might crash with the error - "Profiling data corrupted"
- Suggested Workaround - Instead of profiling for the complete run, it is suggested to run profiling in parts by using the --trace-period option.
- OpenMP applications are not fully supported by the roctracer.
3 changes: 1 addition & 2 deletions build.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash -x
#!/bin/bash -e
SRC_DIR=`dirname $0`
COMPONENT="roctracer"
ROCM_PATH="${ROCM_PATH:=/opt/rocm}"
Expand All @@ -17,7 +17,6 @@ if [ -e "$DEFAULTS" ] ; then source "$DEFAULTS"; fi
if [ -z "$ROCTRACER_ROOT" ]; then ROCTRACER_ROOT=$SRC_DIR; fi
if [ -z "$BUILD_DIR" ] ; then BUILD_DIR=$PWD; fi
if [ -z "$HIP_PATH" ] ; then export HIP_PATH="$ROCM_PATH/hip"; fi
if [ -z "$HCC_HOME" ] ; then export HCC_HOME="$ROCM_PATH/hcc"; fi
if [ -z "$BUILD_TYPE" ] ; then BUILD_TYPE="release"; fi
if [ -z "$PACKAGE_ROOT" ] ; then PACKAGE_ROOT=$ROCM_PATH; fi
if [ -z "$PACKAGE_PREFIX" ] ; then PACKAGE_PREFIX="$ROCM_PATH/$COMPONENT"; fi
Expand Down
1 change: 0 additions & 1 deletion build_static.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ if [ -e "$DEFAULTS" ] ; then source "$DEFAULTS"; fi
if [ -z "$ROCTRACER_ROOT" ]; then ROCTRACER_ROOT=$SRC_DIR; fi
if [ -z "$BUILD_DIR" ] ; then BUILD_DIR=$PWD; fi
if [ -z "$HIP_PATH" ] ; then export HIP_PATH="$ROCM_PATH/hip"; fi
if [ -z "$HCC_HOME" ] ; then export HCC_HOME="$ROCM_PATH/hcc"; fi
if [ -z "$BUILD_TYPE" ] ; then BUILD_TYPE="release"; fi
if [ -z "$PACKAGE_ROOT" ] ; then PACKAGE_ROOT=$ROCM_PATH; fi
if [ -z "$PACKAGE_PREFIX" ] ; then PACKAGE_PREFIX="$ROCM_PATH/$COMPONENT"; fi
Expand Down
25 changes: 14 additions & 11 deletions cmake_modules/env.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,11 @@ set ( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC" )

set ( CMAKE_SHARED_LINKER_FLAGS "-Wl,-Bdynamic -Wl,-z,noexecstack" )

## Set RUNPATH if ROCM_RPATH is defined and passed by the environment
if ( DEFINED ROCM_RPATH )
set ( CMAKE_SHARED_LINKER_FLAGS " -Wl,--enable-new-dtags -Wl,--rpath,${ROCM_RPATH} ${CMAKE_SHARED_LINKER_FLAGS}" )
endif ()

set ( CMAKE_SKIP_BUILD_RPATH TRUE )

## CLANG options
Expand All @@ -61,8 +66,11 @@ if ( "$ENV{CXX}" STREQUAL "/usr/bin/clang++" )
endif()

## Enable debug trace
if ( DEFINED CMAKE_DEBUG_TRACE )
add_definitions ( -DDEBUG_TRACE_ON=1 )
endif()
if ( DEFINED ENV{CMAKE_DEBUG_TRACE} )
add_definitions ( -DDEBUG_TRACE=1 )
add_definitions ( -DDEBUG_TRACE_ON=1 )
endif()

if ( NOT DEFINED LIBRARY_TYPE )
Expand All @@ -89,7 +97,7 @@ else()
set ( HIP_DEFINES "-D__HIP_PLATFORM_HCC__=1")
endif()

## Enable HIP/HCC local build
## Enable HIP local build
if ( DEFINED LOCAL_BUILD )
add_definitions ( -DLOCAL_BUILD=${LOCAL_BUILD} )
else()
Expand All @@ -114,15 +122,10 @@ if ( NOT DEFINED CMAKE_PREFIX_PATH AND DEFINED ENV{CMAKE_PREFIX_PATH} )
endif()
set ( ENV{CMAKE_PREFIX_PATH} ${CMAKE_PREFIX_PATH} )

set ( HCC_HOME "/opt/rocm/hcc" )
set ( HIP_PATH "/opt/rocm/hip" )
if ( DEFINED ENV{HCC_HOME} )
set ( HCC_HOME $ENV{HCC_HOME} )
endif()
if ( DEFINED ENV{HIP_PATH} )
set ( HIP_PATH $ENV{HIP_PATH} )
endif()
set ( HCC_INC_DIR "${HCC_HOME}/include" )
set ( HIP_INC_DIR "${HIP_PATH}/include" )

## Extend Compiler flags based on build type
Expand Down Expand Up @@ -153,10 +156,10 @@ get_filename_component ( HSA_RUNTIME_LIB_PATH "${HSA_RUNTIME_LIB}" DIRECTORY )

find_library ( HSA_KMT_LIB "libhsakmt.so" )
get_filename_component ( HSA_KMT_LIB_PATH "${HSA_KMT_LIB}" DIRECTORY )
get_filename_component ( ROCM_ROOT_DIR "${HSA_KMT_LIB_PATH}" DIRECTORY )

set ( HSA_KMT_INC_PATH "${HSA_KMT_LIB_PATH}/../include" )
set ( ROCM_INC_PATH "${HSA_KMT_INC_PATH}" )

get_filename_component ( ROCM_ROOT_DIR "${HSA_KMT_LIB_PATH}" DIRECTORY )
set ( ROCM_INC_PATH "${ROCM_ROOT_DIR}/include" )

## Basic Tool Chain Information
message ( "----------------NBit: ${NBIT}" )
Expand All @@ -169,8 +172,8 @@ message ( "-----HSA-Runtime-Inc: ${HSA_RUNTIME_INC_PATH}" )
message ( "-----HSA-Runtime-Lib: ${HSA_RUNTIME_LIB_PATH}" )
message ( "----HSA_KMT_LIB_PATH: ${HSA_KMT_LIB_PATH}" )
message ( "-------ROCM_ROOT_DIR: ${ROCM_ROOT_DIR}" )
message ( "-------ROCM_INC_PATH: ${ROCM_INC_PATH}" )
message ( "-------------KFD-Inc: ${HSA_KMT_INC_PATH}" )
message ( "-------------HCC-Inc: ${HCC_INC_DIR}" )
message ( "-------------HIP-Inc: ${HIP_INC_DIR}" )
message ( "-------------HIP-VDI: ${HIP_VDI}" )
message ( "-----CMAKE_CXX_FLAGS: ${CMAKE_CXX_FLAGS}" )
Expand Down
Loading