Add support for SR-IOV GPU stats (#15796)

* Add option to treat GPU as SRIOV in order for stats to work correctly

* Add to intel docs

* fix tests
This commit is contained in:
Nicolas Mowen
2025-01-03 09:43:44 -06:00
parent d5fb957503
commit 39ecffbf92
6 changed files with 25 additions and 7 deletions

View File

@@ -255,7 +255,7 @@ def get_amd_gpu_stats() -> dict[str, str]:
return results
def get_intel_gpu_stats() -> dict[str, str]:
def get_intel_gpu_stats(sriov: bool) -> dict[str, str]:
"""Get stats using intel_gpu_top."""
def get_stats_manually(output: str) -> dict[str, str]:
@@ -302,6 +302,9 @@ def get_intel_gpu_stats() -> dict[str, str]:
"1",
]
if sriov:
intel_gpu_top_command += ["-d", "drm:/dev/dri/card0"]
p = sp.run(
intel_gpu_top_command,
encoding="ascii",