General fixes for CI
Change-Id: I16e4d1fbc71a378eba6738c6953760e8e4de525e
[ROCm/rocprofiler commit: db82c5ef62]
Этот коммит содержится в:
@@ -38,8 +38,14 @@ PROF_BIN_DIR=$ROOT_DIR/libexec/rocprofiler
|
||||
|
||||
# check if rocprof is supportd on this gpu arch
|
||||
V1_SUPPORTED_GPU_ARCHS=("gfx80x","gfx90x","gfx94x")
|
||||
CURRENT_AGENTS_LIST=$($BIN_DIR/rocm_agent_enumerator)
|
||||
IS_SUPPORTED="false"
|
||||
if [ -f $BIN_DIR/rocm_agent_enumerator ]; then
|
||||
CURRENT_AGENTS_LIST=$($BIN_DIR/rocm_agent_enumerator)
|
||||
else
|
||||
IS_SUPPORTED="false"
|
||||
echo -e "Warning: Missing rocm_agent_enumerator binary"
|
||||
exit 0
|
||||
fi
|
||||
|
||||
if [ -z "$ROCP_PYTHON_VERSION" ] ; then
|
||||
ROCP_PYTHON_VERSION=python3
|
||||
|
||||
@@ -46,12 +46,10 @@ target_compile_definitions(
|
||||
CTF_PLUGIN_METADATA_FILE_PATH="${METADATA_STREAM_FILE_DIR}/metadata"
|
||||
CTF_PLUGIN_INSTALL_PREFIX="${CMAKE_INSTALL_PREFIX}")
|
||||
|
||||
# Add definitions for getROCmInstallPath() API
|
||||
if(USE_GET_ROCM_PATH_API)
|
||||
target_compile_definitions(
|
||||
ctf_plugin
|
||||
PRIVATE USE_GET_ROCM_PATH_API=1)
|
||||
endif()
|
||||
# Disabling this as it causes CI to fail, we need to make sure rocm-core is installed
|
||||
# before rocprofiler Add definitions for getROCmInstallPath() API
|
||||
# if(USE_GET_ROCM_PATH_API) target_compile_definitions( ctf_plugin PRIVATE
|
||||
# USE_GET_ROCM_PATH_API=1) endif()
|
||||
|
||||
target_include_directories(
|
||||
ctf_plugin PRIVATE "${PROJECT_SOURCE_DIR}" "${CMAKE_BINARY_DIR}/src/api"
|
||||
@@ -62,21 +60,22 @@ target_link_options(
|
||||
target_link_libraries(ctf_plugin PRIVATE rocprofiler-v2 hsa-runtime64::hsa-runtime64
|
||||
stdc++fs dl)
|
||||
|
||||
# Add link dependencies for getROCmInstallPath() API
|
||||
if(USE_GET_ROCM_PATH_API)
|
||||
find_library(ROCM_CORE_LIB rocm-core HINTS ${ROCM_PATH}/lib)
|
||||
target_link_libraries(ctf_plugin PRIVATE ${ROCM_CORE_LIB})
|
||||
endif()
|
||||
# Disabling this as it causes CI to fail, we need to make sure rocm-core is installed
|
||||
# before rocprofiler Add link dependencies for getROCmInstallPath() API
|
||||
# if(USE_GET_ROCM_PATH_API) find_library(ROCM_CORE_LIB rocm-core HINTS ${ROCM_PATH}/lib)
|
||||
# target_link_libraries(ctf_plugin PRIVATE ${ROCM_CORE_LIB}) endif()
|
||||
|
||||
install(TARGETS ctf_plugin LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}/${PROJECT_NAME}"
|
||||
COMPONENT plugins)
|
||||
|
||||
# `gen_api_files.py` and `gen_env_yaml.py` require Python 3, CppHeaderParser, PyYAML, and
|
||||
# barectf.
|
||||
find_package(
|
||||
Python3
|
||||
COMPONENTS Interpreter
|
||||
REQUIRED)
|
||||
if(NOT Python3_EXECUTABLE)
|
||||
find_package(
|
||||
Python3
|
||||
COMPONENTS Interpreter
|
||||
REQUIRED)
|
||||
endif()
|
||||
|
||||
message("Python: ${Python3_EXECUTABLE})")
|
||||
|
||||
@@ -143,13 +142,16 @@ find_file(
|
||||
list(TRANSFORM HIP_INCLUDE_DIRS PREPEND -I)
|
||||
add_custom_command(
|
||||
OUTPUT hip_erts.yaml hip_begin.cpp.i hip_end.cpp.i
|
||||
COMMAND ${CMAKE_C_COMPILER} ${HIP_INCLUDE_DIRS} -E "${PROJECT_SOURCE_DIR}/src/core/session/tracer/src/hip_full_api.h"
|
||||
-D__HIP_PLATFORM_AMD__=1 -D__HIP_ROCclr__=1 -o hip_runtime_api.h.i
|
||||
COMMAND
|
||||
${CMAKE_C_COMPILER} ${HIP_INCLUDE_DIRS} -E
|
||||
"${PROJECT_SOURCE_DIR}/src/core/session/tracer/src/hip_full_api.h"
|
||||
-D__HIP_PLATFORM_AMD__=1 -D__HIP_ROCclr__=1 -o hip_runtime_api.h.i
|
||||
COMMAND cat hip_runtime_api.h.i "${HIP_PROF_STR_H}" > hip_input.h
|
||||
BYPRODUCTS hip_runtime_api.h.i hip_input.h
|
||||
COMMAND "${Python3_EXECUTABLE}" "${CMAKE_CURRENT_SOURCE_DIR}/gen_api_files.py" hip
|
||||
hip_input.h
|
||||
DEPENDS "${CMAKE_CURRENT_SOURCE_DIR}/gen_api_files.py" "${PROJECT_SOURCE_DIR}/src/core/session/tracer/src/hip_full_api.h"
|
||||
DEPENDS "${CMAKE_CURRENT_SOURCE_DIR}/gen_api_files.py"
|
||||
"${PROJECT_SOURCE_DIR}/src/core/session/tracer/src/hip_full_api.h"
|
||||
"${HIP_PROF_STR_H}"
|
||||
COMMENT "Generating HIP API files for the `ctf` plugin...")
|
||||
|
||||
|
||||
@@ -1,36 +1,43 @@
|
||||
# Set the HIP language runtime link flags as FindHIP does not set them.
|
||||
set(CMAKE_INSTALL_TESTDIR test/${PROJECT_NAME})
|
||||
set(CMAKE_EXECUTABLE_RUNTIME_HIP_FLAG ${CMAKE_SHARED_LIBRARY_RUNTIME_CXX_FLAG})
|
||||
set(CMAKE_EXECUTABLE_RUNTIME_HIP_FLAG_SEP ${CMAKE_SHARED_LIBRARY_RUNTIME_CXX_FLAG_SEP})
|
||||
set(CMAKE_EXECUTABLE_RPATH_LINK_HIP_FLAG ${CMAKE_SHARED_LIBRARY_RPATH_LINK_CXX_FLAG})
|
||||
find_library(ROCM_SMI_LIB rocm_smi64 HINTS ${ROCM_PATH}/lib)
|
||||
|
||||
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${ROCM_PATH}/lib/cmake/hip")
|
||||
set(CMAKE_HIP_ARCHITECTURES OFF)
|
||||
if(DEFINED ROCM_PATH)
|
||||
set(HIP_ROOT_DIR "${ROCM_PATH}/bin")
|
||||
endif()
|
||||
find_package(HIP REQUIRED MODULE)
|
||||
if(ROCM_SMI_LIB)
|
||||
# Set the HIP language runtime link flags as FindHIP does not set them.
|
||||
set(CMAKE_INSTALL_TESTDIR test/${PROJECT_NAME})
|
||||
set(CMAKE_EXECUTABLE_RUNTIME_HIP_FLAG ${CMAKE_SHARED_LIBRARY_RUNTIME_CXX_FLAG})
|
||||
set(CMAKE_EXECUTABLE_RUNTIME_HIP_FLAG_SEP
|
||||
${CMAKE_SHARED_LIBRARY_RUNTIME_CXX_FLAG_SEP})
|
||||
set(CMAKE_EXECUTABLE_RPATH_LINK_HIP_FLAG ${CMAKE_SHARED_LIBRARY_RPATH_LINK_CXX_FLAG})
|
||||
|
||||
set(TEST_DIR ${PROJECT_SOURCE_DIR}/tests-v2/microbenchmarks)
|
||||
file(GLOB TEST_SRC_FILE ${TEST_DIR}/*.cpp)
|
||||
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${ROCM_PATH}/lib/cmake/hip")
|
||||
set(CMAKE_HIP_ARCHITECTURES OFF)
|
||||
if(DEFINED ROCM_PATH)
|
||||
set(HIP_ROOT_DIR "${ROCM_PATH}/bin")
|
||||
endif()
|
||||
find_package(HIP REQUIRED MODULE)
|
||||
|
||||
set_source_files_properties(${TEST_SRC_FILE} PROPERTIES HIP_SOURCE_PROPERTY_FORMAT 1)
|
||||
hip_add_executable(pcie_bw_test ${TEST_SRC_FILE})
|
||||
add_test(
|
||||
NAME pcie_bw_test
|
||||
COMMAND $<TARGET_FILE:pcie_bw_test>
|
||||
WORKING_DIRECTORY "${PROJECT_BINARY_DIR}")
|
||||
set_tests_properties(
|
||||
pcie_bw_test
|
||||
PROPERTIES LABELS "v2;benchmarks" ENVIRONMENT "${ROCPROFILER_MEMCHECK_PRELOAD_ENV}"
|
||||
SKIP_REGULAR_EXPRESSION "SIGBUS error. Aborting test" DISABLED TRUE)
|
||||
set(TEST_DIR ${PROJECT_SOURCE_DIR}/tests-v2/microbenchmarks)
|
||||
file(GLOB TEST_SRC_FILE ${TEST_DIR}/*.cpp)
|
||||
|
||||
target_link_libraries(pcie_bw_test PRIVATE rocm_smi64)
|
||||
target_link_options(pcie_bw_test PRIVATE "-Wl,--build-id=md5")
|
||||
set_target_properties(
|
||||
pcie_bw_test PROPERTIES RUNTIME_OUTPUT_DIRECTORY
|
||||
"${PROJECT_BINARY_DIR}/tests-v2/microbenchmarks")
|
||||
install(
|
||||
TARGETS pcie_bw_test
|
||||
RUNTIME DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/${PROJECT_NAME}/tests/microbenchmarks
|
||||
set_source_files_properties(${TEST_SRC_FILE} PROPERTIES HIP_SOURCE_PROPERTY_FORMAT 1)
|
||||
hip_add_executable(pcie_bw_test ${TEST_SRC_FILE})
|
||||
add_test(
|
||||
NAME pcie_bw_test
|
||||
COMMAND $<TARGET_FILE:pcie_bw_test>
|
||||
WORKING_DIRECTORY "${PROJECT_BINARY_DIR}")
|
||||
set_tests_properties(
|
||||
pcie_bw_test
|
||||
PROPERTIES LABELS "v2;benchmarks" ENVIRONMENT
|
||||
"${ROCPROFILER_MEMCHECK_PRELOAD_ENV}" SKIP_REGULAR_EXPRESSION
|
||||
"SIGBUS error. Aborting test" DISABLED TRUE)
|
||||
|
||||
target_link_libraries(pcie_bw_test PRIVATE ${ROCM_SMI_LIB})
|
||||
target_link_options(pcie_bw_test PRIVATE "-Wl,--build-id=md5")
|
||||
set_target_properties(
|
||||
pcie_bw_test PROPERTIES RUNTIME_OUTPUT_DIRECTORY
|
||||
"${PROJECT_BINARY_DIR}/tests-v2/microbenchmarks")
|
||||
install(
|
||||
TARGETS pcie_bw_test
|
||||
RUNTIME
|
||||
DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/${PROJECT_NAME}/tests/microbenchmarks
|
||||
COMPONENT tests)
|
||||
endif()
|
||||
|
||||
@@ -27,8 +27,6 @@ find_library(PCIACCESS_LIBRARIES pciaccess REQUIRED)
|
||||
enable_testing()
|
||||
find_package(GTest REQUIRED)
|
||||
|
||||
find_library(GDB rocm-dbgapi PATHS ${ROCM_PATH} REQUIRED)
|
||||
|
||||
# Getting Source files for ROCProfiler, Hardware, HSA, Memory, Session, Counters, Utils
|
||||
set(CORE_MEMORY_DIR ${PROJECT_SOURCE_DIR}/src/core/memory)
|
||||
file(GLOB CORE_MEMORY_SRC_FILES ${CORE_MEMORY_DIR}/*.cpp)
|
||||
@@ -123,7 +121,7 @@ target_compile_definitions(
|
||||
|
||||
target_link_libraries(
|
||||
runUnitTests PRIVATE rocprofiler-v2 ${AQLPROFILE_LIB} hsa-runtime64::hsa-runtime64
|
||||
GTest::gtest GTest::gtest_main stdc++fs ${PCIACCESS_LIBRARIES} ${GDB} dw elf c dl)
|
||||
GTest::gtest GTest::gtest_main stdc++fs ${PCIACCESS_LIBRARIES} dw elf c dl)
|
||||
|
||||
add_dependencies(tests runUnitTests)
|
||||
install(TARGETS runUnitTests
|
||||
|
||||
Ссылка в новой задаче
Block a user