Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
15 changes: 15 additions & 0 deletions BUILD_TOPOLOGY.toml
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,7 @@ artifact_groups = [
"hip-runtime",
"opencl-runtime",
"profiler-core",
"kfdtest",

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Make it sorted alphabetically as the other entries seem to be.

"rocjitsu"
]

Expand Down Expand Up @@ -270,6 +271,12 @@ type = "generic"
artifact_group_deps = ["hip-runtime", "opencl-runtime", "core-runtime"]
source_sets = ["rocm-systems"]

[artifact_groups.kfdtest]
description = "KFD kernel driver tests"
type = "generic"
artifact_group_deps = ["core-runtime"]
source_sets = ["rocm-systems"]

[artifact_groups.math-libs]
description = "Math libraries (BLAS, FFT, RAND, etc.)"
type = "per-arch" # Built per GPU architecture
Expand Down Expand Up @@ -566,6 +573,14 @@ feature_name = "CORE_RUNTIME_TESTS"
feature_group = "CORE"
disable_platforms = ["windows"]

[artifacts.kfdtest]
artifact_group = "kfdtest"
type = "target-neutral"
artifact_deps = ["core-runtime", "amd-llvm", "sysdeps"]
feature_name = "CORE_KFDTESTS"
feature_group = "CORE"
disable_platforms = ["windows"]

[artifacts.core-hipinfo]
artifact_group = "hip-runtime"
type = "target-neutral"
Expand Down
14 changes: 14 additions & 0 deletions build_tools/install_rocm_from_artifacts.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@
[--rocprofiler-systems-examples | --no-rocprofiler-systems-examples]
[--rocrtst | --no-rocrtst]
[--rocalution | --no-rocalution]
[--kfdtest | --no-kfdtest]
[--rocwmma | --no-rocwmma]
[--libhipcxx | --no-libhipcxx]
[--tests | --no-tests]
Expand Down Expand Up @@ -386,6 +387,7 @@ def retrieve_artifacts_by_run_id(args):
args.rocprofiler_systems_examples,
args.rocrtst,
args.rocalution,
args.kfdtest,
args.rocwmma,
args.libhipcxx,
]
Expand Down Expand Up @@ -497,6 +499,11 @@ def retrieve_artifacts_by_run_id(args):
if args.rocalution:
extra_artifacts.append("rocalution")
argv.append("rocalution_dev")
if args.kfdtest:
extra_artifacts.append("kfdtest")
# kfdtest depends on llvm-dev
argv.append("amd-llvm_dev")
argv.append("amd-llvm_lib")
if args.rocwmma:
extra_artifacts.append("rocwmma")
argv.append("rocwmma_dev")
Expand Down Expand Up @@ -870,6 +877,13 @@ def main(argv):
action=argparse.BooleanOptionalAction,
)

artifacts_group.add_argument(
"--kfdtest",
default=False,
help="Include 'kfdtest' artifacts",
action=argparse.BooleanOptionalAction,
)

artifacts_group.add_argument(
"--rocwmma",
default=False,
Expand Down
11 changes: 11 additions & 0 deletions build_tools/packaging/linux/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -404,6 +404,17 @@
]
}
]
},
{
"Artifact": "kfdtest",
"Artifact_Subdir": [
{
"Name": "kfdtest",
"Components": [
"test"
]
}
]
}
],
"Gfxarch": "False",
Expand Down
60 changes: 60 additions & 0 deletions core/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -632,3 +632,63 @@ if(THEROCK_BUILD_TESTING AND THEROCK_ENABLE_CORE_RUNTIME_TESTS)
rocrtst
)
endif(THEROCK_BUILD_TESTING AND THEROCK_ENABLE_CORE_RUNTIME_TESTS)

if(THEROCK_BUILD_TESTING AND THEROCK_ENABLE_CORE_KFDTESTS)

# kfdtest statically links libhsakmt and LLVM (AMDGPUAsmParser, Core, Support).
# It needs LLVM headers at build time and libhsakmt.a for linking.
set(_kfdtest_build_deps
amd-llvm

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why include amd-llvm in both BUILD_DEPS and RUNTIME_DEPS?

ROCR-Runtime
therock-yaml-cpp
)

# Get the ROCR-Runtime binary directory to locate libhsakmt
get_target_property(_rocr_binary_dir ROCR-Runtime THEROCK_BINARY_DIR)

therock_cmake_subproject_declare(kfdtest
USE_TEST_AMDGPU_TARGETS
EXTERNAL_SOURCE_DIR "${THEROCK_ROCM_SYSTEMS_SOURCE_DIR}/projects/rocr-runtime/libhsakmt/tests/kfdtest"
BINARY_DIR "${CMAKE_CURRENT_BINARY_DIR}/kfdtest"
BACKGROUND_BUILD
CMAKE_ARGS
"-DCMAKE_PREFIX_PATH="
"-DLLVM_DIR="
"-DROCM_DIR="
"-DLIBHSAKMT_PATH=${_rocr_binary_dir}/libhsakmt"
"-DCMAKE_EXE_LINKER_FLAGS=-ldl"
"-DCMAKE_BUILD_WITH_INSTALL_RPATH=ON"
Comment on lines +655 to +660

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The fact we need to pass some of these flags seems to point towards kfdtest's build system having to be reworked prior to integrating into TheRock.

We should really not be passing things like CMAKE_EXE_LINKER_FLAGS, LIBHSAKMT_PATH, LLVM_DIR, ROCM_DIR and CMAKE_PREFIX_PATH. KFDtest's build system should be able to figure all of these out on its own instead of having this fragile mechanism of passing CMAKE_ARGS.

COMPILER_TOOLCHAIN
"${_system_toolchain}"
BUILD_DEPS
${_kfdtest_build_deps}
RUNTIME_DEPS
amd-llvm
${THEROCK_BUNDLED_LIBDRM}
${THEROCK_BUNDLED_NUMACTL}
${THEROCK_BUNDLED_ZLIB}
${THEROCK_BUNDLED_ZSTD}
INTERFACE_LINK_DIRS
"lib"
"lib/rocm_sysdeps/lib"
INTERFACE_INSTALL_RPATH_DIRS
"lib"
"lib/rocm_sysdeps/lib"
)
therock_cmake_subproject_glob_c_sources(kfdtest SUBDIRS .)
therock_cmake_subproject_activate(kfdtest)

therock_provide_artifact(kfdtest
TARGET_NEUTRAL
DESCRIPTOR artifact-core-kfdtest.toml
COMPONENTS
dbg
dev
doc
lib
run
test
SUBPROJECT_DEPS
kfdtest

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Doesn't this depend on anything else other than itself?

)
endif(THEROCK_BUILD_TESTING AND THEROCK_ENABLE_CORE_KFDTESTS)
10 changes: 10 additions & 0 deletions core/artifact-core-kfdtest.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# kfdtest
[components.run."core/kfdtest/stage"]
exclude = [
"bin/**",
"share/kfdtest/**",
]
[components.dbg."core/kfdtest/stage"]
[components.dev."core/kfdtest/stage"]
[components.doc."core/kfdtest/stage"]
[components.test."core/kfdtest/stage"]
Comment on lines +7 to +10

@lumachad lumachad Jul 6, 2026

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are these artifact categories being used at all?

Loading