diff --git a/.gitmodules b/.gitmodules index a1a418af1..49a79fff3 100644 --- a/.gitmodules +++ b/.gitmodules @@ -42,6 +42,6 @@ url = https://github.com/ROCm/SPIRV-LLVM-Translator.git branch = amd-mainline [submodule "amdsmi"] - path = base/amdsmi + path = core/amdsmi url = https://github.com/ROCm/amdsmi.git branch = amd-staging diff --git a/base/CMakeLists.txt b/base/CMakeLists.txt index 010a6e8d2..679327076 100644 --- a/base/CMakeLists.txt +++ b/base/CMakeLists.txt @@ -52,33 +52,6 @@ therock_cmake_subproject_provide_package(rocm-core rocm-core lib/cmake/rocm-core therock_cmake_subproject_activate(rocm-core) -################################################################################ -# amdsmi -################################################################################ - -if(NOT WIN32) # TODO(#36): Enable on Windows and/or make subproject inclusion generally optional - -therock_cmake_subproject_declare(amdsmi - EXTERNAL_SOURCE_DIR "amdsmi" - USE_DIST_AMDGPU_TARGETS - BACKGROUND_BUILD - CMAKE_ARGS - # TODO: Enable tests - # -DBUILD_TESTS=${THEROCK_BUILD_TESTING} - "-DCMAKE_VERBOSE_MAKEFILE=OFF" - BUILD_DEPS - therock-googletest - RUNTIME_DEPS - rocm-core - ${THEROCK_BUNDLED_LIBDRM} -) -therock_cmake_subproject_provide_package(amdsmi - amd_smi lib/cmake) -therock_cmake_subproject_activate(amdsmi) - -endif() - - ################################################################################ # rocm_smi_lib ################################################################################ @@ -172,7 +145,6 @@ therock_cmake_subproject_activate(rocm-half) set(_optional_subproject_deps) if(NOT WIN32) # TODO(#36): Enable on Windows and/or make subproject inclusion generally optional - list(APPEND _optional_subproject_deps amdsmi) list(APPEND _optional_subproject_deps rocm_smi_lib) list(APPEND _optional_subproject_deps rocprofiler-register) endif() diff --git a/base/artifact.toml b/base/artifact.toml index 290630797..d6a74f4cf 100644 --- a/base/artifact.toml +++ b/base/artifact.toml @@ -2,22 +2,6 @@ [components.dev."base/half/stage"] [components.doc."base/half/stage"] -# amdsmi -[components.dbg."base/amdsmi/stage"] -optional = "windows" -[components.dev."base/amdsmi/stage"] -optional = "windows" -[components.doc."base/amdsmi/stage"] -optional = "windows" -[components.lib."base/amdsmi/stage"] -optional = "windows" -[components.run."base/amdsmi/stage"] -optional = "windows" -include = [ - "bin/**", - "libexec/**", - "share/amd_smi/**", -] # rocm_smi_lib [components.dbg."base/rocm_smi_lib/stage"] diff --git a/core/CMakeLists.txt b/core/CMakeLists.txt index 2fcd2e8df..9be80b2f3 100644 --- a/core/CMakeLists.txt +++ b/core/CMakeLists.txt @@ -10,6 +10,36 @@ if(THEROCK_ENABLE_CORE_RUNTIME) set(_system_toolchain "") endif() + + ################################################################################ + # amdsmi + ################################################################################ + + if(NOT WIN32) # TODO(#36): Enable on Windows and/or make subproject inclusion generally optional + + therock_cmake_subproject_declare(amdsmi + EXTERNAL_SOURCE_DIR "amdsmi" + USE_DIST_AMDGPU_TARGETS + BACKGROUND_BUILD + COMPILER_TOOLCHAIN + "${_system_toolchain}" + CMAKE_ARGS + # TODO: Enable tests + # -DBUILD_TESTS=${THEROCK_BUILD_TESTING} + "-DCMAKE_VERBOSE_MAKEFILE=OFF" + BUILD_DEPS + therock-googletest + RUNTIME_DEPS + rocm-core + ${THEROCK_BUNDLED_LIBDRM} + ) + therock_cmake_subproject_provide_package(amdsmi + amd_smi lib/cmake) + therock_cmake_subproject_activate(amdsmi) + + endif() + + ############################################################################## # ROCR-Runtime ############################################################################## @@ -81,6 +111,19 @@ if(THEROCK_ENABLE_CORE_RUNTIME) rocminfo ) + therock_provide_artifact(amdsmi + TARGET_NEUTRAL + DESCRIPTOR artifact-amdsmi.toml + COMPONENTS + dbg + dev + doc + lib + run + SUBPROJECT_DEPS + amdsmi + ) + endif(THEROCK_ENABLE_CORE_RUNTIME) if(THEROCK_ENABLE_HIP_RUNTIME) diff --git a/base/amdsmi b/core/amdsmi similarity index 100% rename from base/amdsmi rename to core/amdsmi diff --git a/core/artifact-amdsmi.toml b/core/artifact-amdsmi.toml new file mode 100644 index 000000000..3dfe8cfc0 --- /dev/null +++ b/core/artifact-amdsmi.toml @@ -0,0 +1,21 @@ +# amdsmi core artifact + +[components.dbg."core/amdsmi/stage"] +optional = "windows" + +[components.dev."core/amdsmi/stage"] +optional = "windows" + +[components.doc."core/amdsmi/stage"] +optional = "windows" + +[components.lib."core/amdsmi/stage"] +optional = "windows" + +[components.run."core/amdsmi/stage"] +optional = "windows" +include = [ + "bin/**", + "libexec/**", + "share/amd_smi/**", +] diff --git a/docs/development/artifacts.md b/docs/development/artifacts.md index a107f6bad..c83021f1a 100644 --- a/docs/development/artifacts.md +++ b/docs/development/artifacts.md @@ -207,6 +207,7 @@ These artifacts are built if any project features requiring them are enabled: ### Core Artifacts +- `amdsmi`: AMD System Management Interface library, packaged as a standalone core artifact. - `base`: Base ROCM tools and structural components. ROCM sub-projects that do not depend on anything outside of this set are included here so that everything can depend on them. - `core-runtime`: Low level runtime components used for interfacing with kernel drivers. - `core-hip`: HIP runtime, compiler interface, and build tools. diff --git a/docs/development/windows_support.md b/docs/development/windows_support.md index ab4f8b521..48005973f 100644 --- a/docs/development/windows_support.md +++ b/docs/development/windows_support.md @@ -26,7 +26,6 @@ mainline, in open source, using MSVC, etc.). | Component subset | Subproject | Supported | Notes | | ------------------- | ------------------------------------------------------------------------------------------------------------------------ | --------- | --------------------------------------------- | | base | aux-overlay | ✅ | | -| base | [amdsmi](https://github.com/ROCm/amdsmi) | ❌ | Unsupported | | base | [rocm-cmake](https://github.com/ROCm/rocm-cmake) | ✅ | | | base | [rocm-core](https://github.com/ROCm/rocm-core) | ✅ | | | base | [rocm_smi_lib](https://github.com/ROCm/rocm_smi_lib) | ❌ | Unsupported | @@ -38,6 +37,7 @@ mainline, in open source, using MSVC, etc.). | compiler | [hipcc](https://github.com/ROCm/llvm-project/tree/amd-staging/amd/hipcc) | ✅ | | | compiler | [hipify](https://github.com/ROCm/HIPIFY) | ✅ | | | | | | | +| core | [amdsmi](https://github.com/ROCm/amdsmi) | ❌ | Unsupported | | core | [ROCR-Runtime](https://github.com/ROCm/ROCR-Runtime) | ❌ | Unsupported | | core | [rocminfo](https://github.com/ROCm/rocminfo) | ❌ | Unsupported | | core | [hipInfo from hip-tests](https://github.com/ROCm/hip-tests) | ✅ | |