Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
f645865
remove hardcoded makefiles and add workflow testing
sshi-amd Mar 2, 2026
70cfced
Disable MIVisionX OpenCV example
zichguan-amd Feb 3, 2026
4a471ca
Fix Makefile build step: correct GPU arch flag and add cancelled guard
claude Mar 6, 2026
36dc947
Use ROCM_PATH env variable for Makefile ROCm install directory
sshi-amd Mar 10, 2026
8992939
Merge branch 'ROCm:amd-staging' into makefile-testing-v2
sshi-amd Mar 11, 2026
d27b742
fix make command
sshi-amd Mar 17, 2026
4325882
Skip optional libraries in Makefile build when headers are missing
sshi-amd Mar 17, 2026
48b5c3b
Merge branch 'ROCm:amd-staging' into makefile-testing-v2
sshi-amd Mar 17, 2026
ca513dd
Move Makefile build step before CMake in CI workflow
sshi-amd Mar 17, 2026
c74de5c
Fix additional Makefile build failures: RPP and openmp_target
sshi-amd Mar 17, 2026
c66e072
Fix Makefile CI: target correct GPU arch and guard openmp_target
sshi-amd Mar 18, 2026
b1fdafc
Merge branch 'ROCm:amd-staging' into makefile-testing-v2
sshi-amd Mar 18, 2026
eb08d6d
Guard optional Makefile examples behind dependency checks
sshi-amd Mar 18, 2026
0dcca68
Fix Makefile CI: replace pkg-config checks with wildcard header checks
sshi-amd Mar 19, 2026
00f7862
Merge branch 'ROCm:amd-staging' into makefile-testing-v2
sshi-amd Mar 19, 2026
7ca427c
Fix Makefile CI: guard rocDecode behind FFmpeg check, fix pthread link
sshi-amd Mar 19, 2026
ef25293
Add configure phase and Makefile test runner to CI
sshi-amd Mar 19, 2026
b8f2454
Gate code_object_isa_decode behind libdw and amd_comgr checks
sshi-amd Mar 19, 2026
26d6e6d
Improve Makefile test runner output with progress counter
sshi-amd Mar 20, 2026
6c03dc7
Fix Makefile test runner: cd into example dir, add test args support
sshi-amd Mar 20, 2026
94ade5e
Run Makefile tests after ctest, using ctest test list as allow filter
sshi-amd Mar 20, 2026
88c30be
Skip rocdec_decode in Makefile tests (needs CMake test data)
sshi-amd Mar 20, 2026
df9d410
Fix FFmpeg/Vulkan detection: check libraries exist, not just headers
sshi-amd Mar 20, 2026
ca3bc40
Remove header-only fallback for FFmpeg/Vulkan detection
sshi-amd Mar 20, 2026
66e13e6
Fix rocdec_decode build on SLES: use config.mk for FFmpeg detection, …
sshi-amd Mar 20, 2026
3c54d77
Add link-test to configure.sh and require_deps.mk to catch missing -d…
sshi-amd Mar 20, 2026
3baedb6
Improve can_link compiler fallback chain (cc, gcc, clang, ROCm clang)
sshi-amd Mar 20, 2026
82eadf0
Use $(FFMPEG_LIBS) from config.mk instead of hardcoded -lavcodec/-lav…
sshi-amd Mar 20, 2026
1fac6e3
Use ctest JUnit XML results for Makefile test allow list
sshi-amd Mar 23, 2026
d258066
Skip rocprof-systems-basic (too slow) and rocprof-systems-advanced (f…
sshi-amd Mar 23, 2026
f75213c
Fix ctest JUnit XML path: use absolute GITHUB_WORKSPACE path
sshi-amd Mar 23, 2026
2084f9f
Match ctest output format in Makefile test runner
sshi-amd Mar 23, 2026
9638493
Skip hip_calling_global_functions on AlmaLinux 8 (glibc 2.28 too old)
sshi-amd Mar 23, 2026
5344913
Only run Makefile tests for tests that passed in ctest
sshi-amd Mar 23, 2026
c21f235
Update README: document configure.sh and Makefile test runner
sshi-amd Mar 23, 2026
15dd987
Move test summary to end, add Makefile test log uploads
sshi-amd Mar 24, 2026
dabc5d0
Add Makefile build artifact upload
sshi-amd Mar 24, 2026
85b25b3
Add if: !cancelled() guard to Makefile build step
sshi-amd Mar 24, 2026
c88873d
Group build artifact uploads together after both builds complete
sshi-amd Mar 24, 2026
f49e54e
Remove ALWAYS_SKIP_TESTS entries for clean CI validation
sshi-amd Mar 24, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
28 changes: 25 additions & 3 deletions .github/build_tools/generate_skip_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,17 @@
import argparse
import os

# Tests to always skip in Makefile runs. These require test data or arguments
# that are only set up by the CMake build system (e.g. ROCDECODE_TEST_FRAMES_DIR).
# ctest handles them via add_test() COMMAND args; the Makefile runner cannot.
MAKEFILE_SKIP_TESTS = [
"rocdecode_rocdec_decode",
]

# Tests to always skip (all targets, all distros).
ALWAYS_SKIP_TESTS = [
]

# Tests to skip per GPU target (one list per target that has skips)
SKIP_TESTS = {
"gfx1151": [
Expand All @@ -29,8 +40,6 @@
# Tests to skip for a specific GPU target + distro combination.
# Keys are "<gpu_target>:<distro_key>", e.g. "gfx1151:sles-15.7".
DISTRO_SKIP_TESTS = {
# Example:
# "gfx1151:sles-15.7": ["some_test"],
}


Expand All @@ -53,9 +62,22 @@ def main():
default="",
help="Distro key for distro-specific skips (e.g. sles-15.7)",
)
parser.add_argument(
"--makefile",
action="store_true",
help="Include Makefile-only skips (tests needing CMake test data)",
)
args = parser.parse_args()

lines = list(SKIP_TESTS.get(args.target, []))
lines = list(ALWAYS_SKIP_TESTS)
for test in SKIP_TESTS.get(args.target, []):
if test not in lines:
lines.append(test)

if args.makefile:
for test in MAKEFILE_SKIP_TESTS:
if test not in lines:
lines.append(test)

if args.distro:
combo_key = f"{args.target}:{args.distro}"
Expand Down
59 changes: 59 additions & 0 deletions .github/build_tools/parse_ctest_results.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
#!/usr/bin/env python3
"""Parse ctest JUnit XML results and extract test names that actually ran.

Used by the Makefile test step to only run tests that ctest executed,
ensuring parity between CMake and Makefile test sets.
"""

import argparse
import sys
import xml.etree.ElementTree as ET


def main():
parser = argparse.ArgumentParser(
description="Extract test names from ctest JUnit XML results."
)
parser.add_argument(
"--junit", required=True, help="Path to ctest JUnit XML file"
)
parser.add_argument(
"--output", required=True, help="Output file (one test name per line)"
)
args = parser.parse_args()

try:
tree = ET.parse(args.junit)
except FileNotFoundError:
print(f"Warning: {args.junit} not found (ctest may not have run)")
print("Creating empty allow list — no Makefile tests will run")
with open(args.output, "w") as f:
pass
return
except ET.ParseError as e:
print(f"Error parsing {args.junit}: {e}", file=sys.stderr)
sys.exit(1)

root = tree.getroot()
passed = []
failed = []
for testcase in root.iter("testcase"):
name = testcase.get("name")
if not name:
continue
# In JUnit XML, failed tests have a <failure> child element
if testcase.find("failure") is not None:
failed.append(name)
else:
passed.append(name)

with open(args.output, "w") as f:
for name in passed:
f.write(name + "\n")

total = len(passed) + len(failed)
print(f"Extracted {len(passed)} passed tests from {total} ctest results ({len(failed)} failed, excluded)")


if __name__ == "__main__":
main()
158 changes: 122 additions & 36 deletions .github/workflows/build-rocm-examples-reusable.yml
Original file line number Diff line number Diff line change
Expand Up @@ -68,12 +68,14 @@ jobs:
run: |
ROCM_PATH=$(rocm-sdk path --root)
echo "ROCM_PATH=${ROCM_PATH}" >> $GITHUB_ENV
echo "ROCM_INSTALL_DIR=${ROCM_PATH}" >> $GITHUB_ENV
echo "HIP_PATH=${ROCM_PATH}" >> $GITHUB_ENV
echo "HIP_PLATFORM=amd" >> $GITHUB_ENV
echo "HIP_DEVICE_LIB_PATH=${ROCM_PATH}/lib/llvm/amdgcn/bitcode" >> $GITHUB_ENV
echo "PATH=${ROCM_PATH}/bin:${ROCM_PATH}/llvm/bin:${PATH}" >> $GITHUB_ENV
echo "LD_LIBRARY_PATH=${ROCM_PATH}/lib:${ROCM_PATH}/llvm/lib:${ROCM_PATH}/lib/rocprofiler-systems" >> $GITHUB_ENV
echo "ENABLE_OPENMP=OFF" >> $GITHUB_ENV
echo "HIPCC_COMPILE_FLAGS_APPEND=--offload-arch=${{ matrix.gpu_config.gpu_target }}" >> $GITHUB_ENV

- name: Install TheRock tarball
if: ${{ matrix.install_method == 'tarball' }}
Expand All @@ -98,14 +100,23 @@ jobs:
run: |
ROCM_PATH=/therock-tarball/install
echo "ROCM_PATH=${ROCM_PATH}" >> $GITHUB_ENV
echo "ROCM_INSTALL_DIR=${ROCM_PATH}" >> $GITHUB_ENV
echo "HIP_PATH=${ROCM_PATH}" >> $GITHUB_ENV
echo "HIP_PLATFORM=amd" >> $GITHUB_ENV
echo "HIP_DEVICE_LIB_PATH=${ROCM_PATH}/lib/llvm/amdgcn/bitcode" >> $GITHUB_ENV
echo "PATH=${ROCM_PATH}/bin:${ROCM_PATH}/llvm/bin:${PATH}" >> $GITHUB_ENV
echo "LD_LIBRARY_PATH=${ROCM_PATH}/lib:${ROCM_PATH}/llvm/lib:${ROCM_PATH}/lib/rocprofiler-systems" >> $GITHUB_ENV
echo "ENABLE_OPENMP=ON" >> $GITHUB_ENV
echo "HIPCC_COMPILE_FLAGS_APPEND=--offload-arch=${{ matrix.gpu_config.gpu_target }}" >> $GITHUB_ENV

- name: Makefile build
if: ${{ !cancelled() }}
run: |
./configure.sh --rocm-path="${ROCM_PATH}"
make -j ROCM_INSTALL_DIR="${ROCM_PATH}" HIP_ARCHITECTURES="${{ matrix.gpu_config.gpu_target }}"

- name: CMake configure
if: ${{ !cancelled() }}
run: |
cmake -S . -B build -DCMAKE_HIP_ARCHITECTURES="${{ matrix.gpu_config.gpu_target }}" -DROCM_ROOT="${ROCM_PATH}" -DCMAKE_BUILD_RPATH="${ROCM_PATH}/lib" -DROCM_EXAMPLES_ENABLE_OPENMP="${ENABLE_OPENMP}" 2> >(tee cmake_error.log >&2)

Expand Down Expand Up @@ -141,82 +152,157 @@ jobs:
fi

- name: CMake build
if: ${{ !cancelled() }}
run: |
cmake --build build -j

- name: Upload build artifacts
if: success()
- name: Collect Makefile build artifacts
if: ${{ !cancelled() }}
run: |
mkdir -p /tmp/makefile_build
find . -name Makefile -not -path './build/*' | while IFS= read -r makefile; do
dir=$(dirname "$makefile")
example_name=$(grep '^EXAMPLE := ' "$makefile" 2>/dev/null | head -1 | sed 's/^EXAMPLE := //')
if [ -n "${example_name}" ] && [ -x "${dir}/${example_name}" ]; then
mkdir -p "/tmp/makefile_build/${dir}"
cp "${dir}/${example_name}" "/tmp/makefile_build/${dir}/"
fi
done

- name: Upload CMake build artifacts
if: ${{ !cancelled() }}
uses: actions/upload-artifact@v4
with:
name: rocm-examples-build-${{ inputs.distro }}-${{ matrix.gpu_config.gpu_target }}-${{ steps.sanity-check.outputs.rocm_version || steps.install-tarball.outputs.rocm_version }}-${{ matrix.install_method }}
path: build/

- name: Upload Makefile build artifacts
if: ${{ !cancelled() }}
uses: actions/upload-artifact@v4
with:
name: makefile-build-${{ inputs.distro }}-${{ matrix.gpu_config.gpu_target }}-${{ steps.sanity-check.outputs.rocm_version || steps.install-tarball.outputs.rocm_version }}-${{ matrix.install_method }}
path: /tmp/makefile_build/

- name: Run tests
if: ${{ !cancelled() }}
run: |
python3 .github/build_tools/generate_skip_tests.py --target ${{ matrix.gpu_config.gpu_target }} --distro ${{ inputs.distro }}

SKIP_FILE="${GITHUB_WORKSPACE}/.github/build_tools/skip_tests.txt"
if [ -s "${SKIP_FILE}" ]; then
echo "## Skipped tests" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo '```' >> $GITHUB_STEP_SUMMARY
cat "${SKIP_FILE}" >> $GITHUB_STEP_SUMMARY
echo '```' >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
else
echo "No tests skipped." >> $GITHUB_STEP_SUMMARY
fi
ctest --test-dir build --output-on-failure --exclude-from-file "${SKIP_FILE}" --output-junit "${GITHUB_WORKSPACE}/ctest_results.xml" 2>&1 | tee ctest_output.log

- name: Makefile tests
if: ${{ !cancelled() }}
run: |
# Extract test names that ctest actually ran from JUnit XML results
python3 .github/build_tools/parse_ctest_results.py \
--junit "${GITHUB_WORKSPACE}/ctest_results.xml" \
--output /tmp/ctest_ran_tests.txt

# Generate skip list with --makefile to include tests that need CMake test data
python3 .github/build_tools/generate_skip_tests.py \
--target ${{ matrix.gpu_config.gpu_target }} \
--distro ${{ inputs.distro }} \
--makefile
SKIP_FILE="${GITHUB_WORKSPACE}/.github/build_tools/skip_tests.txt"

ctest --test-dir build --output-on-failure --exclude-from-file "${SKIP_FILE}" 2>&1 | tee ctest_output.log
./run_makefile_tests.sh \
--allow-file=/tmp/ctest_ran_tests.txt \
--skip-file="${SKIP_FILE}" \
--timeout=120 2>&1 | tee makefile_test_output.log

- name: Test summary
if: ${{ !cancelled() }}
run: |
LAST_TEST_LOG="build/Testing/Temporary/LastTest.log"
if [ ! -f ctest_output.log ] || [ ! -f "${LAST_TEST_LOG}" ]; then
echo "No test logs found." >> $GITHUB_STEP_SUMMARY
exit 0
fi

echo "## Test summary" >> $GITHUB_STEP_SUMMARY
# --- CMake test summary ---
echo "## CMake Test Summary" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY

SUMMARY=$(grep "tests passed" ctest_output.log)
echo "**${SUMMARY}**" >> $GITHUB_STEP_SUMMARY
if [ -f ctest_output.log ]; then
SUMMARY=$(grep "tests passed" ctest_output.log || echo "No ctest results found")
echo "**${SUMMARY}**" >> $GITHUB_STEP_SUMMARY
else
echo "No ctest output log found." >> $GITHUB_STEP_SUMMARY
fi

FAILED_LOG="build/Testing/Temporary/LastTestsFailed.log"
if [ -s "${FAILED_LOG}" ]; then
echo "## Failed tests" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "### Failed CMake tests" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo '```' >> $GITHUB_STEP_SUMMARY
cat "${FAILED_LOG}" >> $GITHUB_STEP_SUMMARY
echo '```' >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY

echo "<details><summary>Failed tests output</summary>" >> $GITHUB_STEP_SUMMARY
LAST_TEST_LOG="build/Testing/Temporary/LastTest.log"
if [ -f "${LAST_TEST_LOG}" ]; then
echo "<details><summary>Failed tests output</summary>" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo '```' >> $GITHUB_STEP_SUMMARY

awk '
/^[0-9]+\/[0-9]+ Testing: / { if (inblock && failed) print block; block = $0; inblock = 1; failed = 0; seen_result = 0; next }
inblock { block = block "\n" $0 }
/^Test Failed\.$/ { failed = 1; seen_result = 1 }
/^Test Passed\.$/ { seen_result = 1 }
/^-+$/ { if (inblock && seen_result) { if (failed) print block; inblock = 0 } }
END { if (inblock && failed) print block }
' "${LAST_TEST_LOG}" >> $GITHUB_STEP_SUMMARY

echo '```' >> $GITHUB_STEP_SUMMARY
echo "</details>" >> $GITHUB_STEP_SUMMARY
fi
fi

# --- Makefile test summary ---
echo "" >> $GITHUB_STEP_SUMMARY
echo "## Makefile Test Summary" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY

if [ -f makefile_test_output.log ]; then
MAKEFILE_SUMMARY=$(grep "tests passed\|tests failed" makefile_test_output.log | tail -1 || echo "No Makefile test results found")
echo "**${MAKEFILE_SUMMARY}**" >> $GITHUB_STEP_SUMMARY

# Show any failed Makefile tests
MAKEFILE_FAILURES=$(grep "Failed" makefile_test_output.log | grep -v "^[[:space:]]*$" || true)
if [ -n "${MAKEFILE_FAILURES}" ]; then
echo "" >> $GITHUB_STEP_SUMMARY
echo "### Failed Makefile tests" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo '```' >> $GITHUB_STEP_SUMMARY
echo "${MAKEFILE_FAILURES}" >> $GITHUB_STEP_SUMMARY
echo '```' >> $GITHUB_STEP_SUMMARY
fi
else
echo "No Makefile test output found." >> $GITHUB_STEP_SUMMARY
fi

# --- Skipped tests ---
SKIP_FILE="${GITHUB_WORKSPACE}/.github/build_tools/skip_tests.txt"
if [ -s "${SKIP_FILE}" ]; then
echo "" >> $GITHUB_STEP_SUMMARY
echo "## Skipped tests" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo '```' >> $GITHUB_STEP_SUMMARY

awk '
/^[0-9]+\/[0-9]+ Testing: / { if (inblock && failed) print block; block = $0; inblock = 1; failed = 0; seen_result = 0; next }
inblock { block = block "\n" $0 }
/^Test Failed\.$/ { failed = 1; seen_result = 1 }
/^Test Passed\.$/ { seen_result = 1 }
/^-+$/ { if (inblock && seen_result) { if (failed) print block; inblock = 0 } }
END { if (inblock && failed) print block }
' "${LAST_TEST_LOG}" >> $GITHUB_STEP_SUMMARY

cat "${SKIP_FILE}" >> $GITHUB_STEP_SUMMARY
echo '```' >> $GITHUB_STEP_SUMMARY
echo "</details>" >> $GITHUB_STEP_SUMMARY
fi

- name: Upload test logs
- name: Upload CMake test logs
if: ${{ !cancelled() }}
uses: actions/upload-artifact@v4
with:
name: ctest-logs-${{ inputs.distro }}-${{ matrix.gpu_config.gpu_target }}-${{ steps.sanity-check.outputs.rocm_version || steps.install-tarball.outputs.rocm_version }}-${{ matrix.install_method }}
path: build/Testing/Temporary/

- name: Upload Makefile test logs
if: ${{ !cancelled() }}
uses: actions/upload-artifact@v4
with:
name: makefile-test-logs-${{ inputs.distro }}-${{ matrix.gpu_config.gpu_target }}-${{ steps.sanity-check.outputs.rocm_version || steps.install-tarball.outputs.rocm_version }}-${{ matrix.install_method }}
path: makefile_test_output.log

- name: Clean the workspace
if: always()
run: find "$GITHUB_WORKSPACE" -mindepth 1 -delete
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,4 @@
*.pdb
CMakeUserPresets.json
.cline_storage
config.mk
7 changes: 5 additions & 2 deletions Applications/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,11 @@ EXAMPLES := \
fdtd \
floyd_warshall \
histogram \
prefix_sum \
sobel_filter
prefix_sum

ifneq ($(wildcard /usr/include/GLFW/glfw3.h),)
EXAMPLES += sobel_filter
endif

ifneq ($(GPU_RUNTIME), CUDA)
EXAMPLES += \
Expand Down
2 changes: 1 addition & 1 deletion Applications/bitonic_sort/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ EXTERNAL_DIR := ../../External
GPU_RUNTIME ?= HIP

# HIP variables
ROCM_INSTALL_DIR ?= /opt/rocm
ROCM_INSTALL_DIR := $(or $(ROCM_PATH),/opt/rocm)
HIP_INCLUDE_DIR := $(ROCM_INSTALL_DIR)/include

HIPCXX ?= $(ROCM_INSTALL_DIR)/bin/hipcc
Expand Down
2 changes: 1 addition & 1 deletion Applications/convolution/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ EXTERNAL_DIR := ../../External
GPU_RUNTIME ?= HIP

# HIP variables
ROCM_INSTALL_DIR ?= /opt/rocm
ROCM_INSTALL_DIR := $(or $(ROCM_PATH),/opt/rocm)
HIP_INCLUDE_DIR := $(ROCM_INSTALL_DIR)/include

HIPCXX ?= $(ROCM_INSTALL_DIR)/bin/hipcc
Expand Down
2 changes: 1 addition & 1 deletion Applications/fdtd/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ EXTERNAL_DIR := ../../External
GPU_RUNTIME ?= HIP

# HIP variables
ROCM_INSTALL_DIR ?= /opt/rocm
ROCM_INSTALL_DIR := $(or $(ROCM_PATH),/opt/rocm)
HIP_INCLUDE_DIR := $(ROCM_INSTALL_DIR)/include

HIPCXX ?= $(ROCM_INSTALL_DIR)/bin/hipcc
Expand Down
2 changes: 1 addition & 1 deletion Applications/floyd_warshall/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ EXTERNAL_DIR := ../../External
GPU_RUNTIME ?= HIP

# HIP variables
ROCM_INSTALL_DIR ?= /opt/rocm
ROCM_INSTALL_DIR := $(or $(ROCM_PATH),/opt/rocm)
HIP_INCLUDE_DIR := $(ROCM_INSTALL_DIR)/include

HIPCXX ?= $(ROCM_INSTALL_DIR)/bin/hipcc
Expand Down
Loading
Loading