CodeQL / Analyze (actions) (push) Canceled after 0s
CodeQL / Analyze (python) (push) Canceled after 0s
pre-commit / pre-commit (push) Canceled after 0s
Multi-Arch CI / setup (push) Canceled after 0s
Publish build_manylinux_x86_64 images / publish_build_manylinux_x86_64 (push) Canceled after 0s
Setup (Multi-Arch) / setup (push) Canceled after 0s
Multi-Arch CI / Linux::${{ fromJSON(needs.setup.outputs.linux_build_config || '{}').build_variant_label || 'skip' }} (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish no_rocm_image_ubi10 image / publish_no_rocm_image_ubi10 (push) Canceled after 0s
Multi-Arch CI / Windows::${{ fromJSON(needs.setup.outputs.windows_build_config || '{}').build_variant_label || 'skip' }} (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Multi-Arch CI / Manifest Diff (push) Canceled after 0s
TheRock Manifest Diff Report / Generate Manifest Diff Report (push) Canceled after 0s
Multi-Arch CI / CI Summary (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04 (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04_ocl_rt images / publish_no_rocm_image_ubuntu24_04_ocl_rt (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_rocgdb (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04_rocgdb images / publish_no_rocm_image_ubuntu24_04_rocgdb (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_ocl_rt (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Unit Tests / Unit Tests :: ubuntu-24.04 (push) Canceled after 0s
Unit Tests / Unit Tests :: windows-2022 (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_media (push) Canceled after 0s
Unit Tests / Unit Tests Summary (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_openmpi (push) Canceled after 0s
75 lines
2.4 KiB
Python
75 lines
2.4 KiB
Python
# Copyright (c) Advanced Micro Devices, Inc.
|
|
# SPDX-License-Identifier: MIT
|
|
|
|
"""
|
|
Tests for SDMA (System DMA) usage metrics.
|
|
|
|
Validates that running sdma-test with ROCPROFSYS_AMD_SMI_METRICS=sdma_usage
|
|
produces expected SDMA usage tracks and values in Perfetto and ROCPD output,
|
|
as implemented in the amd_smi component.
|
|
|
|
SDMA usage requires an Instinct GPU, AMD-SMI >= 26.3
|
|
(see source/lib/core/sdma_feature.hpp), and amdgpu driver >= 6.19.14;
|
|
tests are skipped otherwise.
|
|
"""
|
|
|
|
from __future__ import annotations
|
|
|
|
import pytest
|
|
from pathlib import Path
|
|
|
|
from conftest import RocprofsysTest
|
|
|
|
pytestmark = [pytest.mark.gpu]
|
|
|
|
|
|
@pytest.fixture
|
|
def sdma_env() -> dict[str, str]:
|
|
"""Environment variables for SDMA tests (sdma_usage metric only)."""
|
|
return {
|
|
"ROCPROFSYS_ROCM_DOMAINS": "hip_runtime_api",
|
|
"ROCPROFSYS_AMD_SMI_METRICS": "sdma_usage",
|
|
}
|
|
|
|
|
|
@pytest.fixture
|
|
def sdma_rules(validation_rules_dir: Path) -> list[Path]:
|
|
"""Validation rules for SDMA ROCPD (device_sdma_usage in rocpd_info_pmc / rocpd_pmc_event)."""
|
|
rules_dir = validation_rules_dir / "sdma"
|
|
return [
|
|
rules_dir / "validation-rules.json",
|
|
rules_dir / "amd-smi-sdma-rules.json",
|
|
]
|
|
|
|
|
|
@pytest.mark.run_if_gpu_category("instinct")
|
|
@pytest.mark.amdsmi_min_version("26.3")
|
|
@pytest.mark.amdgpu_min_version("6.19.14")
|
|
class TestSDMA(RocprofsysTest):
|
|
"""Tests for SDMA usage metrics (Perfetto and ROCPD)."""
|
|
|
|
@pytest.mark.timeout(120)
|
|
@pytest.mark.parametrize(
|
|
"mode", [pytest.param("sys_run", marks=pytest.mark.rocpd("sdma_env"))]
|
|
)
|
|
def test_usage(self, mode, sdma_env, sdma_rules):
|
|
"""Run sdma-test with sdma_usage and validate Perfetto + ROCPD for SDMA tracks/values."""
|
|
# sdma-test is a host-side hipMemcpy benchmark with no device kernels,
|
|
# so the binary embeds no gfx offload bundle; skip the target-arch check
|
|
# (it would always report no supported architectures).
|
|
result = self.run_test(
|
|
mode,
|
|
"sdma-test",
|
|
env=sdma_env,
|
|
run_args=["-n", "2", "-s", "64"],
|
|
)
|
|
self.assert_regex(result)
|
|
|
|
if mode == "sys_run":
|
|
self.assert_rocpd(result, rules_files=sdma_rules)
|
|
self.assert_perfetto(
|
|
result,
|
|
counter_names=["SDMA Usage"],
|
|
subtest_name="Perfetto SDMA Usage counter validation",
|
|
)
|