From 4882f9aef5d83297c2a2992d09083a0615602b5a Mon Sep 17 00:00:00 2001 From: Ian Trowbridge Date: Wed, 28 May 2025 11:14:35 -0500 Subject: [PATCH 1/9] Increase rocDecode code coverage and add version check --- .../tests/bin/rocdecode/rocdecode.cpp | 103 +++++++++++++++--- .../tests/rocdecode/validate.py | 10 ++ .../rocprofv3/rocdecode-trace/validate.py | 10 ++ 3 files changed, 109 insertions(+), 14 deletions(-) diff --git a/projects/rocprofiler-sdk/tests/bin/rocdecode/rocdecode.cpp b/projects/rocprofiler-sdk/tests/bin/rocdecode/rocdecode.cpp index 8ef8fa1ffb0..d4218d92bfb 100644 --- a/projects/rocprofiler-sdk/tests/bin/rocdecode/rocdecode.cpp +++ b/projects/rocprofiler-sdk/tests/bin/rocdecode/rocdecode.cpp @@ -26,28 +26,72 @@ THE SOFTWARE. #include #include +// Call rocDecode API with nullptrs to test rocDecode trace +// Eventually should replace with functional calls, but this requires +// finding and linking several FFmpeg and AV.. libraries (AVUTIL, AVCODEC, AVFORMAT) +// Additionally, some rocdecode/share files like ffmpeg_video_dec.cpp would need +// to be updated to resolve compiler warnings to compile with rocprofiler-sdk int -main(int argc, char** argv) +test_rocdecode_decoder() { - // Get input file - std::string input_file_path{}; - for(int i = 1; i < argc; i++) + rocDecStatus rocdecode_status = rocDecCreateDecoder(nullptr, nullptr); + if(rocdecode_status != ROCDEC_INVALID_PARAMETER) { - if(!strcmp(argv[i], "-i")) - { - if(++i == argc) - { - std::cerr << "Provide path to input file" << std::endl; - } - input_file_path = argv[i]; - continue; - } + std::cerr << "Expected ROCDEC_INVALID_PARAMETER\n"; + return 1; + } + rocDecGetErrorName(rocdecode_status); + if(rocDecCreateVideoParser(nullptr, nullptr) != ROCDEC_INVALID_PARAMETER) + { + std::cerr << "Expected ROCDEC_INVALID_PARAMETER\n"; + return 1; } + if(rocDecParseVideoData(nullptr, nullptr) != ROCDEC_INVALID_PARAMETER) + { + std::cerr << "Expected ROCDEC_INVALID_PARAMETER\n"; + return 1; + } + if(rocDecDestroyVideoParser(nullptr) != ROCDEC_INVALID_PARAMETER) + { + std::cerr << "Expected ROCDEC_INVALID_PARAMETER\n"; + return 1; + } + if(rocDecDestroyDecoder(nullptr) != ROCDEC_INVALID_PARAMETER) + { + std::cerr << "Expected ROCDEC_INVALID_PARAMETER\n"; + return 1; + } + if(rocDecGetDecoderCaps(nullptr) != ROCDEC_INVALID_PARAMETER) + { + std::cerr << "Expected ROCDEC_INVALID_PARAMETER\n"; + return 1; + } + if(rocDecGetDecodeStatus(nullptr, 0, nullptr) != ROCDEC_INVALID_PARAMETER) + { + std::cerr << "Expected ROCDEC_INVALID_PARAMETER\n"; + return 1; + } + if(rocDecReconfigureDecoder(nullptr, nullptr) != ROCDEC_INVALID_PARAMETER) + { + std::cerr << "Expected ROCDEC_INVALID_PARAMETER\n"; + return 1; + } + if(rocDecGetVideoFrame(nullptr, 0, nullptr, nullptr, nullptr) != ROCDEC_INVALID_PARAMETER) + { + std::cerr << "Expected ROCDEC_INVALID_PARAMETER\n"; + return 1; + } + return 0; +} + +int +test_rocdecode_bitstream_reader(const std::string& input_file) +{ // Set up bitstreamreader RocdecBitstreamReader bs_reader = nullptr; rocDecVideoCodec rocdec_codec_id{}; int bit_depth{}; - if(rocDecCreateBitstreamReader(&bs_reader, input_file_path.c_str()) != ROCDEC_SUCCESS) + if(rocDecCreateBitstreamReader(&bs_reader, input_file.c_str()) != ROCDEC_SUCCESS) { std::cerr << "Failed to create the bitstream reader." << std::endl; return 1; @@ -131,4 +175,35 @@ main(int argc, char** argv) { rocDecDestroyBitstreamReader(bs_reader); } + return 0; +} + +int +main(int argc, char** argv) +{ + // Get input file + std::string input_file_path{}; + for(int i = 1; i < argc; i++) + { + if(!strcmp(argv[i], "-i")) + { + if(++i == argc) + { + std::cerr << "Provide path to input file" << std::endl; + } + input_file_path = argv[i]; + continue; + } + } + if(test_rocdecode_bitstream_reader(input_file_path) != 0) + { + std::cerr << "rocDecode bitsream reader test failed\n"; + return 1; + } + if(test_rocdecode_decoder() != 0) + { + std::cerr << "rocDecode decoder test failed\n"; + return 1; + } + return 0; } diff --git a/projects/rocprofiler-sdk/tests/rocdecode/validate.py b/projects/rocprofiler-sdk/tests/rocdecode/validate.py index 04ffbaa87f9..c65a23840b9 100644 --- a/projects/rocprofiler-sdk/tests/rocdecode/validate.py +++ b/projects/rocprofiler-sdk/tests/rocdecode/validate.py @@ -177,6 +177,16 @@ def test_rocdecode_traces(input_data): "rocDecGetVideoFrame", "rocDecGetDecodeStatus", "rocDecDestroyBitstreamReader", + "rocDecCreateDecoder", + "rocDecGetErrorName", + "rocDecCreateVideoParser", + "rocDecParseVideoData", + "rocDecDestroyVideoParser", + "rocDecDestroyDecoder", + "rocDecGetDecoderCaps", + "rocDecGetDecodeStatus", + "rocDecReconfigureDecoder", + "rocDecGetVideoFrame", ]: assert call in api_calls diff --git a/projects/rocprofiler-sdk/tests/rocprofv3/rocdecode-trace/validate.py b/projects/rocprofiler-sdk/tests/rocprofv3/rocdecode-trace/validate.py index 76b94b4b26f..30198f320e5 100755 --- a/projects/rocprofiler-sdk/tests/rocprofv3/rocdecode-trace/validate.py +++ b/projects/rocprofiler-sdk/tests/rocprofv3/rocdecode-trace/validate.py @@ -123,6 +123,16 @@ def test_csv_data(csv_data): "rocDecGetVideoFrame", "rocDecGetDecodeStatus", "rocDecDestroyBitstreamReader", + "rocDecCreateDecoder", + "rocDecGetErrorName", + "rocDecCreateVideoParser", + "rocDecParseVideoData", + "rocDecDestroyVideoParser", + "rocDecDestroyDecoder", + "rocDecGetDecoderCaps", + "rocDecGetDecodeStatus", + "rocDecReconfigureDecoder", + "rocDecGetVideoFrame", ]: assert call in api_calls From e4d1b6764fd8d355eed98448fa2d4c70647ba686 Mon Sep 17 00:00:00 2001 From: Ian Trowbridge Date: Wed, 28 May 2025 15:15:36 -0500 Subject: [PATCH 2/9] Update rocJPEG tests --- .../rocprofiler-sdk/tests/rocjpeg/validate.py | 9 ++------- .../rocprofv3/rocjpeg-trace/CMakeLists.txt | 8 ++++---- .../tests/rocprofv3/rocjpeg-trace/conftest.py | 20 ++++--------------- .../tests/rocprofv3/rocjpeg-trace/validate.py | 20 ------------------- 4 files changed, 10 insertions(+), 47 deletions(-) diff --git a/projects/rocprofiler-sdk/tests/rocjpeg/validate.py b/projects/rocprofiler-sdk/tests/rocjpeg/validate.py index dbf6a3bd655..5b26984f078 100644 --- a/projects/rocprofiler-sdk/tests/rocjpeg/validate.py +++ b/projects/rocprofiler-sdk/tests/rocjpeg/validate.py @@ -53,12 +53,10 @@ def test_data_structure(input_data): node_exists("buffer_records", sdk_data) node_exists("names", sdk_data["callback_records"]) - # Uncomment once mainline rocprofiler register supports rocJPEG - # node_exists("rocjpeg_api_traces", sdk_data["callback_records"]) + node_exists("rocjpeg_api_traces", sdk_data["callback_records"]) node_exists("names", sdk_data["buffer_records"]) - # Uncomment once mainline rocprofiler register supports rocJPEG - # node_exists("rocjpeg_api_traces", sdk_data["buffer_records"]) + node_exists("rocjpeg_api_traces", sdk_data["buffer_records"]) def test_size_entries(input_data): @@ -186,9 +184,6 @@ def test_rocjpeg_traces(input_data): rocjpeg_cb_traces = sdk_data["callback_records"]["rocjpeg_api_traces"] rocjpeg_api_cb_ops = get_operation(callback_records, "ROCJPEG_API") - # If rocJPEG tracing is not supported, end early - if len(rocjpeg_bf_traces) <= 2: - return pytest.skip("rocdecode tracing unavailable") assert ( rocjpeg_api_bf_ops[1] == rocjpeg_api_cb_ops[1] and len(rocjpeg_api_cb_ops[1]) == 9 ) diff --git a/projects/rocprofiler-sdk/tests/rocprofv3/rocjpeg-trace/CMakeLists.txt b/projects/rocprofiler-sdk/tests/rocprofv3/rocjpeg-trace/CMakeLists.txt index f81a4f8a22e..fbc555354d6 100644 --- a/projects/rocprofiler-sdk/tests/rocprofv3/rocjpeg-trace/CMakeLists.txt +++ b/projects/rocprofiler-sdk/tests/rocprofv3/rocjpeg-trace/CMakeLists.txt @@ -77,10 +77,10 @@ add_test( NAME rocprofv3-test-rocjpeg-tracing-validate COMMAND ${Python3_EXECUTABLE} ${CMAKE_CURRENT_BINARY_DIR}/validate.py --json-input - ${CMAKE_CURRENT_BINARY_DIR}/rocjpeg-trace/out_results.json --otf2-input - ${CMAKE_CURRENT_BINARY_DIR}/rocjpeg-trace/out_results.otf2 --pftrace-input - ${CMAKE_CURRENT_BINARY_DIR}/rocjpeg-trace/out_results.pftrace --csv-input - ${CMAKE_CURRENT_BINARY_DIR}/rocjpeg-trace/out_rocjpeg_api_trace.csv) + ${CMAKE_CURRENT_BINARY_DIR}/rocjpeg-demo-trace/out_results.json --otf2-input + ${CMAKE_CURRENT_BINARY_DIR}/rocjpeg-demo-trace/out_results.otf2 --pftrace-input + ${CMAKE_CURRENT_BINARY_DIR}/rocjpeg-demo-trace/out_results.pftrace --csv-input + ${CMAKE_CURRENT_BINARY_DIR}/rocjpeg-demo-trace/out_rocjpeg_api_trace.csv) set_tests_properties( rocprofv3-test-rocjpeg-tracing-validate diff --git a/projects/rocprofiler-sdk/tests/rocprofv3/rocjpeg-trace/conftest.py b/projects/rocprofiler-sdk/tests/rocprofv3/rocjpeg-trace/conftest.py index 090ba671fcd..b4c72f7dfdc 100644 --- a/projects/rocprofiler-sdk/tests/rocprofv3/rocjpeg-trace/conftest.py +++ b/projects/rocprofiler-sdk/tests/rocprofv3/rocjpeg-trace/conftest.py @@ -63,8 +63,6 @@ def pytest_addoption(parser): @pytest.fixture def json_data(request): filename = request.config.getoption("--json-input") - if not os.path.isfile(filename): - return pytest.skip("rocjpeg tracing unavailable") with open(filename, "r") as inp: return dotdict(collapse_dict_list(json.load(inp))) @@ -73,30 +71,20 @@ def json_data(request): def csv_data(request): filename = request.config.getoption("--csv-input") data = [] - if not os.path.isfile(filename): - # The CSV file is not generated, because the dependency test - # responsible to generate this file was skipped or failed. - # Thus emit the message to skip this test as well. - return pytest.skip("rocjpeg tracing unavailable") - else: - with open(filename, "r") as inp: - reader = csv.DictReader(inp) - for row in reader: - data.append(row) + with open(filename, "r") as inp: + reader = csv.DictReader(inp) + for row in reader: + data.append(row) return data @pytest.fixture def otf2_data(request): filename = request.config.getoption("--otf2-input") - if not os.path.isfile(filename): - return pytest.skip("rocjpeg tracing unavailable") return OTF2Reader(filename).read()[0] @pytest.fixture def pftrace_data(request): filename = request.config.getoption("--pftrace-input") - if not os.path.isfile(filename): - return pytest.skip("rocjpeg tracing unavailable") return PerfettoReader(filename).read()[0] diff --git a/projects/rocprofiler-sdk/tests/rocprofv3/rocjpeg-trace/validate.py b/projects/rocprofiler-sdk/tests/rocprofv3/rocjpeg-trace/validate.py index 16659056a3c..63ce7be9b43 100755 --- a/projects/rocprofiler-sdk/tests/rocprofv3/rocjpeg-trace/validate.py +++ b/projects/rocprofiler-sdk/tests/rocprofv3/rocjpeg-trace/validate.py @@ -54,9 +54,6 @@ def test_rocjpeg(json_data): buffer_records = data["buffer_records"] rocjpeg_data = buffer_records["rocjpeg_api"] - # If rocJPEG tracing is not supported, end early - if len(rocjpeg_data) == 0: - return pytest.skip("rocjpeg tracing unavailable") _, bf_op_names = get_operation(data, "ROCJPEG_API") @@ -87,9 +84,6 @@ def test_rocjpeg(json_data): def test_csv_data(csv_data): - # If rocJPEG tracing is not supported, end early - if len(csv_data) <= 2: - return pytest.skip("rocjpeg tracing unavailable") assert len(csv_data) > 0, "Expected non-empty csv data" api_calls = [] @@ -139,13 +133,6 @@ def test_csv_data(csv_data): def test_perfetto_data(pftrace_data, json_data): import rocprofiler_sdk.tests.rocprofv3 as rocprofv3 - # If rocJPEG tracing is not supported, end early - if ( - pftrace_data == None - or len(json_data["rocprofiler-sdk-tool"]["buffer_records"]["rocjpeg_api"]) == 0 - ): - return pytest.skip("rocjpeg tracing unavailable") - rocprofv3.test_perfetto_data( pftrace_data, json_data, @@ -156,13 +143,6 @@ def test_perfetto_data(pftrace_data, json_data): def test_otf2_data(otf2_data, json_data): import rocprofiler_sdk.tests.rocprofv3 as rocprofv3 - # If rocJPEG tracing is not supported, end early - if ( - otf2_data == None - or len(json_data["rocprofiler-sdk-tool"]["buffer_records"]["rocjpeg_api"]) == 0 - ): - return pytest.skip("rocjpeg tracing unavailable") - rocprofv3.test_otf2_data( otf2_data, json_data, From 6ea33b82dcc0aa2aec6737b4345cdd6e5f449aab Mon Sep 17 00:00:00 2001 From: Ian Trowbridge Date: Thu, 29 May 2025 09:46:22 -0500 Subject: [PATCH 3/9] Fix rocJPEG tests --- .../tests/rocprofv3/rocjpeg-trace/conftest.py | 20 +++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/projects/rocprofiler-sdk/tests/rocprofv3/rocjpeg-trace/conftest.py b/projects/rocprofiler-sdk/tests/rocprofv3/rocjpeg-trace/conftest.py index b4c72f7dfdc..090ba671fcd 100644 --- a/projects/rocprofiler-sdk/tests/rocprofv3/rocjpeg-trace/conftest.py +++ b/projects/rocprofiler-sdk/tests/rocprofv3/rocjpeg-trace/conftest.py @@ -63,6 +63,8 @@ def pytest_addoption(parser): @pytest.fixture def json_data(request): filename = request.config.getoption("--json-input") + if not os.path.isfile(filename): + return pytest.skip("rocjpeg tracing unavailable") with open(filename, "r") as inp: return dotdict(collapse_dict_list(json.load(inp))) @@ -71,20 +73,30 @@ def json_data(request): def csv_data(request): filename = request.config.getoption("--csv-input") data = [] - with open(filename, "r") as inp: - reader = csv.DictReader(inp) - for row in reader: - data.append(row) + if not os.path.isfile(filename): + # The CSV file is not generated, because the dependency test + # responsible to generate this file was skipped or failed. + # Thus emit the message to skip this test as well. + return pytest.skip("rocjpeg tracing unavailable") + else: + with open(filename, "r") as inp: + reader = csv.DictReader(inp) + for row in reader: + data.append(row) return data @pytest.fixture def otf2_data(request): filename = request.config.getoption("--otf2-input") + if not os.path.isfile(filename): + return pytest.skip("rocjpeg tracing unavailable") return OTF2Reader(filename).read()[0] @pytest.fixture def pftrace_data(request): filename = request.config.getoption("--pftrace-input") + if not os.path.isfile(filename): + return pytest.skip("rocjpeg tracing unavailable") return PerfettoReader(filename).read()[0] From 06713ad15ae5e0384cd9f3e5b5d97a6aaa474423 Mon Sep 17 00:00:00 2001 From: "Jonathan R. Madsen" Date: Thu, 29 May 2025 17:35:18 -0500 Subject: [PATCH 4/9] Enable building tests/samples in rocm release compat workflow --- .../workflows/rocprofiler-sdk-rocm_release_compatibility.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/rocprofiler-sdk-rocm_release_compatibility.yml b/.github/workflows/rocprofiler-sdk-rocm_release_compatibility.yml index d6f30de089b..fc3ddb1c9fd 100644 --- a/.github/workflows/rocprofiler-sdk-rocm_release_compatibility.yml +++ b/.github/workflows/rocprofiler-sdk-rocm_release_compatibility.yml @@ -109,7 +109,8 @@ jobs: --disable-cdash -- -DROCPROFILER_DEP_ROCMCORE=ON - -DROCPROFILER_BUILD_{TESTS,SAMPLES,DOCS}=OFF + -DROCPROFILER_BUILD_DOCS=OFF + -DROCPROFILER_BUILD_{TESTS,SAMPLES}=ON -DCMAKE_BUILD_TYPE=${{ matrix.build-type }} -DCMAKE_INSTALL_PREFIX="$(realpath /opt/rocm)" -DPython3_EXECUTABLE=$(which python3) From ab267275aa286d67d1e6b24365d7f448e5a09fd9 Mon Sep 17 00:00:00 2001 From: Ian Trowbridge Date: Tue, 3 Jun 2025 15:34:08 -0500 Subject: [PATCH 5/9] Readded rocJPEG test skips --- ...cprofiler-sdk-rocm_release_compatibility.yml | 3 +-- .../rocprofiler-sdk/tests/rocjpeg/validate.py | 3 +++ .../tests/rocprofv3/rocjpeg-trace/validate.py | 17 ++++++++++++++++- 3 files changed, 20 insertions(+), 3 deletions(-) diff --git a/.github/workflows/rocprofiler-sdk-rocm_release_compatibility.yml b/.github/workflows/rocprofiler-sdk-rocm_release_compatibility.yml index fc3ddb1c9fd..d6f30de089b 100644 --- a/.github/workflows/rocprofiler-sdk-rocm_release_compatibility.yml +++ b/.github/workflows/rocprofiler-sdk-rocm_release_compatibility.yml @@ -109,8 +109,7 @@ jobs: --disable-cdash -- -DROCPROFILER_DEP_ROCMCORE=ON - -DROCPROFILER_BUILD_DOCS=OFF - -DROCPROFILER_BUILD_{TESTS,SAMPLES}=ON + -DROCPROFILER_BUILD_{TESTS,SAMPLES,DOCS}=OFF -DCMAKE_BUILD_TYPE=${{ matrix.build-type }} -DCMAKE_INSTALL_PREFIX="$(realpath /opt/rocm)" -DPython3_EXECUTABLE=$(which python3) diff --git a/projects/rocprofiler-sdk/tests/rocjpeg/validate.py b/projects/rocprofiler-sdk/tests/rocjpeg/validate.py index 5b26984f078..b06e465a898 100644 --- a/projects/rocprofiler-sdk/tests/rocjpeg/validate.py +++ b/projects/rocprofiler-sdk/tests/rocjpeg/validate.py @@ -184,6 +184,9 @@ def test_rocjpeg_traces(input_data): rocjpeg_cb_traces = sdk_data["callback_records"]["rocjpeg_api_traces"] rocjpeg_api_cb_ops = get_operation(callback_records, "ROCJPEG_API") + # If rocJPEG tracing is not supported, end early + if len(rocjpeg_bf_traces) <= 2: + return pytest.skip("rocdecode tracing unavailable") assert ( rocjpeg_api_bf_ops[1] == rocjpeg_api_cb_ops[1] and len(rocjpeg_api_cb_ops[1]) == 9 ) diff --git a/projects/rocprofiler-sdk/tests/rocprofv3/rocjpeg-trace/validate.py b/projects/rocprofiler-sdk/tests/rocprofv3/rocjpeg-trace/validate.py index 63ce7be9b43..2f14cb4ba2b 100755 --- a/projects/rocprofiler-sdk/tests/rocprofv3/rocjpeg-trace/validate.py +++ b/projects/rocprofiler-sdk/tests/rocprofv3/rocjpeg-trace/validate.py @@ -54,6 +54,9 @@ def test_rocjpeg(json_data): buffer_records = data["buffer_records"] rocjpeg_data = buffer_records["rocjpeg_api"] + # If rocJPEG tracing is not supported, end early + if len(rocjpeg_data) == 0: + return pytest.skip("rocjpeg tracing unavailable") _, bf_op_names = get_operation(data, "ROCJPEG_API") @@ -84,7 +87,9 @@ def test_rocjpeg(json_data): def test_csv_data(csv_data): - assert len(csv_data) > 0, "Expected non-empty csv data" + # If rocJPEG tracing is not supported, end early + if len(csv_data) <= 2: + return pytest.skip("rocjpeg tracing unavailable") api_calls = [] @@ -132,6 +137,11 @@ def test_csv_data(csv_data): def test_perfetto_data(pftrace_data, json_data): import rocprofiler_sdk.tests.rocprofv3 as rocprofv3 + # If rocJPEG tracing is not supported, end early + if ( + len(json_data["rocprofiler-sdk-tool"]["buffer_records"]["rocjpeg_api"]) == 0 + ): + return pytest.skip("rocjpeg tracing unavailable") rocprofv3.test_perfetto_data( pftrace_data, @@ -142,6 +152,11 @@ def test_perfetto_data(pftrace_data, json_data): def test_otf2_data(otf2_data, json_data): import rocprofiler_sdk.tests.rocprofv3 as rocprofv3 + # If rocJPEG tracing is not supported, end early + if ( + len(json_data["rocprofiler-sdk-tool"]["buffer_records"]["rocjpeg_api"]) == 0 + ): + return pytest.skip("rocjpeg tracing unavailable") rocprofv3.test_otf2_data( otf2_data, From 94d98c62c2a003448c3b39084dc43a7595b10cdd Mon Sep 17 00:00:00 2001 From: Ian Trowbridge Date: Tue, 3 Jun 2025 15:35:44 -0500 Subject: [PATCH 6/9] formatting --- .../tests/rocprofv3/rocjpeg-trace/validate.py | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/projects/rocprofiler-sdk/tests/rocprofv3/rocjpeg-trace/validate.py b/projects/rocprofiler-sdk/tests/rocprofv3/rocjpeg-trace/validate.py index 2f14cb4ba2b..b6fcdea4da4 100755 --- a/projects/rocprofiler-sdk/tests/rocprofv3/rocjpeg-trace/validate.py +++ b/projects/rocprofiler-sdk/tests/rocprofv3/rocjpeg-trace/validate.py @@ -87,7 +87,7 @@ def test_rocjpeg(json_data): def test_csv_data(csv_data): - # If rocJPEG tracing is not supported, end early + # If rocJPEG tracing is not supported, end early if len(csv_data) <= 2: return pytest.skip("rocjpeg tracing unavailable") @@ -137,10 +137,9 @@ def test_csv_data(csv_data): def test_perfetto_data(pftrace_data, json_data): import rocprofiler_sdk.tests.rocprofv3 as rocprofv3 + # If rocJPEG tracing is not supported, end early - if ( - len(json_data["rocprofiler-sdk-tool"]["buffer_records"]["rocjpeg_api"]) == 0 - ): + if len(json_data["rocprofiler-sdk-tool"]["buffer_records"]["rocjpeg_api"]) == 0: return pytest.skip("rocjpeg tracing unavailable") rocprofv3.test_perfetto_data( @@ -152,10 +151,9 @@ def test_perfetto_data(pftrace_data, json_data): def test_otf2_data(otf2_data, json_data): import rocprofiler_sdk.tests.rocprofv3 as rocprofv3 + # If rocJPEG tracing is not supported, end early - if ( - len(json_data["rocprofiler-sdk-tool"]["buffer_records"]["rocjpeg_api"]) == 0 - ): + if len(json_data["rocprofiler-sdk-tool"]["buffer_records"]["rocjpeg_api"]) == 0: return pytest.skip("rocjpeg tracing unavailable") rocprofv3.test_otf2_data( From 3e3ba6a93d14aa7ef75e6aea364caeedcb4089ba Mon Sep 17 00:00:00 2001 From: "Jonathan R. Madsen" Date: Mon, 30 Jun 2025 16:52:35 -0500 Subject: [PATCH 7/9] Adding ROCm libraries for the code-coverage job --- .github/workflows/rocprofiler-sdk-code_coverage.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/rocprofiler-sdk-code_coverage.yml b/.github/workflows/rocprofiler-sdk-code_coverage.yml index 79560757473..35451648c0c 100644 --- a/.github/workflows/rocprofiler-sdk-code_coverage.yml +++ b/.github/workflows/rocprofiler-sdk-code_coverage.yml @@ -107,6 +107,7 @@ jobs: git config --global --add safe.directory '*' apt-get update apt-get install -y build-essential cmake python3-pip gcovr wkhtmltopdf xvfb xfonts-base xfonts-75dpi xfonts-100dpi xfonts-utils xfonts-encodings libfontconfig libdw-dev libsqlite3-dev + apt-get install -y rccl-dev rccl-unittests rocjpeg-dev rocjpeg-test rocdecode-dev rocdecode-test python3 -m pip install -U --user -r requirements.txt rm -rf /opt/rocm/lib/*rocprofiler-sdk* /opt/rocm/lib/cmake/*rocprofiler-sdk* /opt/rocm/share/*rocprofiler-sdk* /opt/rocm/libexec/*rocprofiler-sdk* From 4649762eb23fbef1bdc5c4f107002ea78f211931 Mon Sep 17 00:00:00 2001 From: Ian Trowbridge Date: Wed, 2 Jul 2025 19:03:04 +0000 Subject: [PATCH 8/9] Added return value check for error message and updated compatability to enable tests --- .../rocprofiler-sdk-rocm_release_compatibility.yml | 2 +- projects/rocprofiler-sdk/tests/bin/rocdecode/rocdecode.cpp | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/.github/workflows/rocprofiler-sdk-rocm_release_compatibility.yml b/.github/workflows/rocprofiler-sdk-rocm_release_compatibility.yml index d6f30de089b..26ed55da433 100644 --- a/.github/workflows/rocprofiler-sdk-rocm_release_compatibility.yml +++ b/.github/workflows/rocprofiler-sdk-rocm_release_compatibility.yml @@ -109,7 +109,7 @@ jobs: --disable-cdash -- -DROCPROFILER_DEP_ROCMCORE=ON - -DROCPROFILER_BUILD_{TESTS,SAMPLES,DOCS}=OFF + -DROCPROFILER_BUILD_{TESTS,SAMPLES,DOCS}=ON -DCMAKE_BUILD_TYPE=${{ matrix.build-type }} -DCMAKE_INSTALL_PREFIX="$(realpath /opt/rocm)" -DPython3_EXECUTABLE=$(which python3) diff --git a/projects/rocprofiler-sdk/tests/bin/rocdecode/rocdecode.cpp b/projects/rocprofiler-sdk/tests/bin/rocdecode/rocdecode.cpp index d4218d92bfb..99d6318e92d 100644 --- a/projects/rocprofiler-sdk/tests/bin/rocdecode/rocdecode.cpp +++ b/projects/rocprofiler-sdk/tests/bin/rocdecode/rocdecode.cpp @@ -40,7 +40,11 @@ test_rocdecode_decoder() std::cerr << "Expected ROCDEC_INVALID_PARAMETER\n"; return 1; } - rocDecGetErrorName(rocdecode_status); + if(rocDecGetErrorName(rocdecode_status) == nullptr) + { + std::cerr << "Expected error name to not be null\n"; + return 1; + } if(rocDecCreateVideoParser(nullptr, nullptr) != ROCDEC_INVALID_PARAMETER) { std::cerr << "Expected ROCDEC_INVALID_PARAMETER\n"; From fd6484e166159cb03ac7dbcd4c581b9d18599383 Mon Sep 17 00:00:00 2001 From: Ian Trowbridge Date: Wed, 2 Jul 2025 20:52:47 +0000 Subject: [PATCH 9/9] Disable rocm_release_compatibility samples and tests until openmp issue is resolved --- .../workflows/rocprofiler-sdk-rocm_release_compatibility.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/rocprofiler-sdk-rocm_release_compatibility.yml b/.github/workflows/rocprofiler-sdk-rocm_release_compatibility.yml index 26ed55da433..d6f30de089b 100644 --- a/.github/workflows/rocprofiler-sdk-rocm_release_compatibility.yml +++ b/.github/workflows/rocprofiler-sdk-rocm_release_compatibility.yml @@ -109,7 +109,7 @@ jobs: --disable-cdash -- -DROCPROFILER_DEP_ROCMCORE=ON - -DROCPROFILER_BUILD_{TESTS,SAMPLES,DOCS}=ON + -DROCPROFILER_BUILD_{TESTS,SAMPLES,DOCS}=OFF -DCMAKE_BUILD_TYPE=${{ matrix.build-type }} -DCMAKE_INSTALL_PREFIX="$(realpath /opt/rocm)" -DPython3_EXECUTABLE=$(which python3)