9a2806ac95
RAS plugin loaded rocm-smi which is in conflict with amd-smi library
Main source of grief was the map 'devInfoTypesStrings' that is defined
in both rocm-smi and amd-smi
We assume that rocm-smi would get lazy-loaded by RAS library and
overwrite symbols defined in amd-smi. devInfoTypesStrings in rocm-smi
contains different number of elements, the enums are also different.
RDC relies on amd-smi's enums.
One such enum is kDevGpuMetrics:
rocm-smi: kDevGpuMetrics = 68
amd-smi: kDevGpuMetrics = 75
Example of overlapping map definitions:
$ objdump --dynamic-syms /opt/rocm/lib/libamd_smi.so | grep devInfoTypesStrings
00000000003c4980 g DO .data.rel.ro0000000000000008 Base devInfoTypesStrings
00000000003db830 g DO .bss0000000000000030 Base _ZN3amd3smi6Device19devInfoTypesStringsE
$ objdump --dynamic-syms /opt/rocm/lib/librocm_smi64.so | grep devInfoTypesStrings
00000000003dc590 g DO .bss0000000000000030 Base _ZN3amd3smi6Device19devInfoTypesStringsE
00000000003c9c68 g DO .data.rel.ro0000000000000008 Base devInfoTypesStrings
Change-Id: Ib2f2db32b6abd7ebe84e7807c25581461eb86bae
Signed-off-by: Galantsev, Dmitrii <dmitrii.galantsev@amd.com>
[ROCm/rdc commit: d85657e5f2]
91 строка
2.6 KiB
CMake
Исполняемый файл
91 строка
2.6 KiB
CMake
Исполняемый файл
message("&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&")
|
|
message(" Cmake RDC test ")
|
|
message("&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&")
|
|
|
|
if(WIN32)
|
|
message("rdc library test suite is not supported on Windows platform")
|
|
return()
|
|
endif()
|
|
|
|
# Required Defines first:
|
|
option(INSTALL_GTEST "Install GTest (only useful if GTest is not already installed)" OFF)
|
|
|
|
# Hack to find libraries after installation
|
|
# /opt/rocm/share/rdc/rdctst_tests/../../../ = /opt/rocm
|
|
set(RDCTST_RPATH
|
|
"\$ORIGIN"
|
|
"\$ORIGIN/../../../lib"
|
|
"\$ORIGIN/../../../lib/rdc")
|
|
# combine lists
|
|
set(CMAKE_INSTALL_RPATH
|
|
${CMAKE_INSTALL_RPATH}
|
|
${RDCTST_RPATH})
|
|
|
|
#
|
|
# Print out the build configuration being used:
|
|
#
|
|
# Build Src directory
|
|
# Build Binary directory
|
|
# Build Type: Debug Vs Release, 32 Vs 64
|
|
# Compiler Version, etc
|
|
#
|
|
message("")
|
|
message("Build Configuration:")
|
|
message("-----------BuildType: " ${BUILD_TYPE})
|
|
message("------------Compiler: " ${CMAKE_CXX_COMPILER})
|
|
message("-------------Version: " ${CMAKE_CXX_COMPILER_VERSION})
|
|
message("------------ROCM_DIR: " ${ROCM_DIR})
|
|
message("--------Proj Src Dir: " ${PROJECT_SOURCE_DIR})
|
|
message("--------Proj Bld Dir: " ${PROJECT_BINARY_DIR})
|
|
message("--------Proj Lib Dir: " ${PROJECT_BINARY_DIR}/lib)
|
|
message("--------Proj Exe Dir: " ${PROJECT_BINARY_DIR}/bin)
|
|
message("--------SMI Lib Dir: " ${SMI_LIB_DIR})
|
|
message("--------SMI Inc Dir: " ${SMI_INC_DIR})
|
|
message("")
|
|
|
|
set(SRC_DIR ${CMAKE_CURRENT_SOURCE_DIR})
|
|
|
|
set(RDCTST "rdctst")
|
|
|
|
# Download and compile googletest
|
|
include(FetchContent)
|
|
FetchContent_Declare(
|
|
googletest
|
|
GIT_REPOSITORY https://github.com/google/googletest.git
|
|
GIT_TAG v1.14.0)
|
|
FetchContent_MakeAvailable(googletest)
|
|
|
|
# Source files
|
|
aux_source_directory(${SRC_DIR} rdctstSources)
|
|
|
|
# Other source directories
|
|
aux_source_directory(${SRC_DIR}/functional functionalSources)
|
|
|
|
link_directories(${ROCM_INSTALL_DIR} ${SMI_LIB_DIR})
|
|
|
|
# Build rules
|
|
add_executable(${RDCTST} ${rdctstSources} ${functionalSources})
|
|
|
|
# Header file include path
|
|
target_include_directories(
|
|
${RDCTST}
|
|
PUBLIC ${PROJECT_SOURCE_DIR}/include
|
|
PUBLIC ${SMI_INC_DIR}
|
|
PUBLIC ${SRC_DIR}/..)
|
|
|
|
target_link_libraries(${RDCTST}
|
|
PUBLIC rdc_bootstrap
|
|
PUBLIC rdc
|
|
PUBLIC GTest::gtest_main
|
|
PUBLIC c
|
|
PUBLIC stdc++
|
|
PUBLIC pthread)
|
|
|
|
install(TARGETS ${RDCTST} gtest gtest_main
|
|
DESTINATION ${RDC_SHARE_INSTALL_PREFIX}/rdctst_tests
|
|
COMPONENT ${TESTS_COMPONENT})
|
|
|
|
install(FILES ${RDCTST}.exclude
|
|
DESTINATION ${RDC_SHARE_INSTALL_PREFIX}/rdctst_tests
|
|
COMPONENT ${TESTS_COMPONENT})
|