esmi: Clone open-source esmi repo as part of build
1. Remove esmi (internal gerrit) repo as git submodule 2. Clone esmi (open-source) repo during cmake using "git clone" 3. Download amd_hsmp.h header file during cmake build TODO: We can update the amd_hsmp.h to mainline linux kernel repo after next Linux kernel release. Change-Id: I763b5e287e24337c8e9e25f4e421cdb8698b9322
Цей коміт міститься в:
зафіксовано
Dmitrii Galantsev
джерело
2468a6039c
коміт
597fb00bef
@@ -31,3 +31,6 @@ docBin/
|
||||
|
||||
# Simulated SYSFS - for early development or debug
|
||||
device/
|
||||
|
||||
# misc
|
||||
esmi_ib_library/
|
||||
|
||||
@@ -1,4 +0,0 @@
|
||||
[submodule "e_smi_library"]
|
||||
path = e_smi_library
|
||||
url = ssh://gerritgit/SYS-MGMT/er/HPC/e_smi_library
|
||||
branch = amd-dev
|
||||
|
||||
+16
-11
@@ -60,7 +60,7 @@ option(BUILD_WRAPPER "Rebuild AMDSMI-wrapper" OFF)
|
||||
option(BUILD_CLI "Build AMDSMI-CLI and install" ON)
|
||||
option(ENABLE_LDCONFIG "Set library links and caches using ldconfig." ON)
|
||||
option(ENABLE_ASAN_PACKAGING "" OFF)
|
||||
option(ENABLE_ESMI_LIB "" OFF)
|
||||
option(ENABLE_ESMI_LIB "" ON)
|
||||
|
||||
# Set share path here because project name != amd_smi
|
||||
set(SHARE_INSTALL_PREFIX "share/${AMD_SMI}" CACHE STRING "Tests and Example install directory")
|
||||
@@ -95,16 +95,21 @@ set(AMDSMI_INC_DIR "${PROJECT_SOURCE_DIR}/include/amd_smi")
|
||||
set(ROCM_INC_DIR "${PROJECT_SOURCE_DIR}/rocm_smi/include/rocm_smi")
|
||||
set(SHR_MUTEX_DIR "${PROJECT_SOURCE_DIR}/third_party/shared_mutex")
|
||||
if(ENABLE_ESMI_LIB)
|
||||
if((EXISTS ${PROJECT_SOURCE_DIR}/e_smi_library/src) AND (EXISTS ${PROJECT_SOURCE_DIR}/e_smi_library/src/e_smi_plat.c))
|
||||
set(ESMI_AVAILABLE TRUE)
|
||||
if(NOT EXISTS ${PROJECT_SOURCE_DIR}/esmi_ib_library/src)
|
||||
# TODO: use ExternalProject_Add instead or a submodule
|
||||
# as of 2023.10.16 CI builds are broken with an updated submodule
|
||||
execute_process(COMMAND git clone --depth=1 -b esmi_so_ver-3.0 https://github.com/amd/esmi_ib_library.git ${PROJECT_SOURCE_DIR}/esmi_ib_library)
|
||||
endif()
|
||||
if(NOT EXISTS ${PROJECT_SOURCE_DIR}/esmi_ib_library/include/asm/amd_hsmp.h)
|
||||
file(DOWNLOAD
|
||||
https://git.kernel.org/pub/scm/linux/kernel/git/pdx86/platform-drivers-x86.git/plain/arch/x86/include/uapi/asm/amd_hsmp.h?h=review-ilpo
|
||||
${PROJECT_SOURCE_DIR}/esmi_ib_library/include/asm/amd_hsmp.h)
|
||||
endif()
|
||||
add_definitions("-DENABLE_ESMI_LIB=1")
|
||||
else()
|
||||
message("E-smi source not found. Errors will be encountered during compilation!!!")
|
||||
endif()
|
||||
if(ESMI_AVAILABLE)
|
||||
set(ESMI_INC_DIR "${PROJECT_SOURCE_DIR}/e_smi_library/include")
|
||||
set(ESMI_SRC_DIR "${PROJECT_SOURCE_DIR}/e_smi_library/src")
|
||||
endif()
|
||||
set(ESMI_INC_DIR "${PROJECT_SOURCE_DIR}/esmi_ib_library/include")
|
||||
set(ESMI_SRC_DIR "${PROJECT_SOURCE_DIR}/esmi_ib_library/src")
|
||||
# esmi has a lot of write-strings warnings - silence them
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-write-strings")
|
||||
endif()
|
||||
|
||||
pkg_check_modules(DRM REQUIRED libdrm)
|
||||
@@ -127,7 +132,7 @@ set(CMN_SRC_LIST
|
||||
"${ROCM_SRC_DIR}/rocm_smi_logger.cc"
|
||||
"${SHR_MUTEX_DIR}/shared_mutex.cc")
|
||||
|
||||
if(ESMI_AVAILABLE)
|
||||
if(ENABLE_ESMI_LIB)
|
||||
list(APPEND CMN_SRC_LIST ${ESMI_SRC_DIR}/e_smi.c)
|
||||
list(APPEND CMN_SRC_LIST ${ESMI_SRC_DIR}/e_smi_monitor.c)
|
||||
list(APPEND CMN_SRC_LIST ${ESMI_SRC_DIR}/e_smi_plat.c)
|
||||
|
||||
Підмодуль e_smi_library видалено з 1b2de9f700
@@ -50,7 +50,7 @@ set(INC_LIST
|
||||
"${PROJECT_SOURCE_DIR}/rocm_smi/include/rocm_smi/rocm_smi.h"
|
||||
"${PROJECT_SOURCE_DIR}/rocm_smi/include/rocm_smi/rocm_smi_utils.h")
|
||||
|
||||
if(ESMI_AVAILABLE)
|
||||
if(ENABLE_ESMI_LIB)
|
||||
list(APPEND INC_LIST ${ESMI_INC_DIR}/e_smi/e_smi.h)
|
||||
list(APPEND INC_LIST ${ESMI_INC_DIR}/e_smi/e_smi_monitor.h)
|
||||
list(APPEND INC_LIST ${ESMI_INC_DIR}/e_smi/e_smi_utils.h)
|
||||
|
||||
Посилання в новій задачі
Заблокувати користувача