Skip to content
Draft
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
43 changes: 43 additions & 0 deletions .github/workflows/test-runners.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: Test runners

on:
push:
pull_request:

permissions: read-all

jobs:
run-test:
strategy:
fail-fast: false
matrix:
runner:
- test1
- test2
- test3
- test4
- test5
- test6
- test7
- test8
- test9
- test10
- test11
- test12
- test13
- test14
- test15
- test16
name: ${{ matrix.runner }}
runs-on: ["${{ matrix.runner }}"]
steps:
- name: Checkout
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false
sparse-checkout: |
test.py
sparse-checkout-cone-mode: false

- name: Run test.py
run: python3 test.py
3 changes: 3 additions & 0 deletions .github/workflows/ur-precommit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,9 @@ jobs:
runner: UR_L0
other_adapter: NATIVE_CPU
image_options: -u 1001 --device=/dev/dri -v /dev/dri/by-path:/dev/dri/by-path --privileged --cap-add SYS_ADMIN
- name: L0_V2
runner: UR_L0_BMG
image_options: -u 1001 --device=/dev/dri -v /dev/dri/by-path:/dev/dri/by-path --privileged --cap-add SYS_ADMIN
- name: CUDA
runner: UR_CUDA
image_options: -u 1001 --privileged --cap-add SYS_ADMIN --gpus all
Expand Down
225 changes: 225 additions & 0 deletions test.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,225 @@
#!/usr/bin/env python3

# SPDX-License-Identifier: Apache-2.0
# Copyright 2026, Intel Corporation


import re
import socket
import subprocess

Check notice

Code scanning / Bandit

Consider possible security implications associated with the subprocess module. Note test

Consider possible security implications associated with the subprocess module.


def run(cmd, timeout=15):
"""Run a local shell command and return (stdout, stderr) as decoded strings."""
try:
proc = subprocess.run(
cmd,
shell=True,
capture_output=True,
timeout=timeout,
check=False,
)
return (
proc.stdout.decode(errors='replace'),
proc.stderr.decode(errors='replace'),
)
except subprocess.TimeoutExpired as e:
return "", f"timeout after {timeout}s: {e}"
except Exception as e:
return "", f"exec error: {e}"


def section(title):
print(f"\n--- {title} ---")


def check_gpu():
section("GPU")

# Try NVIDIA first
out, _ = run("command -v nvidia-smi >/dev/null 2>&1 && "
"nvidia-smi --query-gpu=name,memory.total --format=csv,noheader")
if out.strip():
gpus = [line.strip() for line in out.strip().splitlines() if line.strip()]
print(f"[NVIDIA GPU count: {len(gpus)}]")
for i, g in enumerate(gpus):
print(f" GPU {i}: {g}")
return

# Try Intel PVC / Data Center GPU via xpu-smi
out, _ = run("command -v xpu-smi >/dev/null 2>&1 && xpu-smi discovery")
if out.strip():
print("[Intel xpu-smi discovery:]")
print(out.strip())
dev_count = len(re.findall(r"^\s*Device ID\s*:", out, flags=re.MULTILINE))
if dev_count:
print(f"[Intel GPU count: {dev_count}]")
return

# Fallback: use lspci to list any VGA / 3D / Display controllers
out, _ = run("lspci -nn 2>/dev/null | grep -Ei 'vga|3d|display' || true")
if out.strip():
lines = [l.strip() for l in out.strip().splitlines() if l.strip()]
print(f"[GPU devices via lspci ({len(lines)} total):]")
for l in lines:
print(f" {l}")

joined = out.lower()
detected = []
if "pvc" in joined or "data center gpu max" in joined or "ponte vecchio" in joined:
detected.append("Intel PVC (Data Center GPU Max)")
if "h100" in joined:
detected.append("NVIDIA H100")
if "a100" in joined:
detected.append("NVIDIA A100")
if detected:
print(f"[Detected: {', '.join(detected)}]")
return

print("[No GPU detected]")


def check_hostnamectl():
section("hostnamectl")
out, err = run("hostnamectl")
if out.strip():
print(out.strip())
elif err.strip():
print(f"[error] {err.strip()}")
else:
print("[no output]")


def check_storage():
section("Storage")

out, err = run("lsblk -d -b -o NAME,SIZE,MODEL,TYPE")
if out.strip():
lines = out.strip().splitlines()
header, data = lines[0], lines[1:]
disks = [l for l in data if l.strip().endswith("disk")]
print(f"[disks ({len(disks)} total):]")
print(header)
total_bytes = 0
for l in disks:
print(l)
parts = l.split()
if len(parts) >= 2 and parts[1].isdigit():
total_bytes += int(parts[1])
if total_bytes:
total_tb = total_bytes / (1024 ** 4)
total_gb = total_bytes / (1024 ** 3)
if total_tb >= 1:
print(f"[total disk capacity: {total_tb:.2f} TiB ({total_gb:.0f} GiB)]")
else:
print(f"[total disk capacity: {total_gb:.2f} GiB]")
elif err.strip():
print(f"[lsblk error] {err.strip()}")

out, _ = run("df -hT --total -x tmpfs -x devtmpfs -x squashfs -x overlay 2>/dev/null | tail -n +1")
if out.strip():
print("\n[df -hT (filesystems):]")
print(out.strip())


def check_nic():
section("NIC / NIC speed")

ip_a_out, ip_a_err = run("ip a")
if ip_a_out.strip():
print("[ip a:]")
print(ip_a_out.strip())
elif ip_a_err.strip():
print(f"[ip a error] {ip_a_err.strip()}")

ip_br_out, _ = run("ip -4 -br addr show 2>/dev/null | awk '$1 != \"lo\"'")
if ip_br_out.strip():
print("\n[IPv4 addresses:]")
print(ip_br_out.strip())

print()

out, err = run("ip -br link show 2>/dev/null | awk '$1 != \"lo\"'")
if not out.strip():
if err.strip():
print(f"[ip link error] {err.strip()}")
return

ifaces = []
print("[interfaces:]")
print(out.strip())
for line in out.strip().splitlines():
parts = line.split()
if parts:
ifaces.append(parts[0].split('@')[0])

print("\n[speed / model per interface:]")
for iface in ifaces:
speed_out, _ = run(
f"( command -v ethtool >/dev/null 2>&1 && ethtool {iface} 2>/dev/null "
f"| grep -E 'Speed:|Link detected:' ) || true")
speed_line = ""
if speed_out.strip():
speed_line = " | ".join(l.strip() for l in speed_out.strip().splitlines())

if not speed_line:
sys_out, _ = run(f"cat /sys/class/net/{iface}/speed 2>/dev/null || true")
if sys_out.strip():
speed_line = f"Speed (sysfs): {sys_out.strip()} Mb/s"

drv_out, _ = run(
f"( command -v ethtool >/dev/null 2>&1 && ethtool -i {iface} 2>/dev/null "
f"| grep -E '^(driver|bus-info):' ) || true")
drv = ""
bus_info = ""
for line in drv_out.strip().splitlines():
if line.startswith("driver:"):
drv = line.split(":", 1)[1].strip()
elif line.startswith("bus-info:"):
bus_info = line.split(":", 1)[1].strip()

if not bus_info:
sys_bus, _ = run(
f"basename $(readlink -f /sys/class/net/{iface}/device) 2>/dev/null || true")
candidate = sys_bus.strip()
if candidate and re.match(r"^[0-9a-fA-F]{4}:", candidate):
bus_info = candidate

model = ""
if bus_info:
lspci_out, _ = run(f"lspci -s {bus_info} 2>/dev/null || true")
if lspci_out.strip():
m = re.match(r"^\S+\s+[^:]+:\s*(.*)$", lspci_out.strip().splitlines()[0])
model = m.group(1).strip() if m else lspci_out.strip().splitlines()[0]

extras = []
if drv:
extras.append(f"driver: {drv}")
if bus_info:
extras.append(f"pci: {bus_info}")
if model:
extras.append(f"model: {model}")

suffix = f" [{' | '.join(extras)}]" if extras else ""
print(f" {iface}: {speed_line or 'unknown'}{suffix}")


def main():
host = socket.gethostname()

print(f"\n{'='*80}")
print(f"Collecting info from local machine: {host}")
print(f"{'='*80}")

check_gpu()
check_hostnamectl()
check_storage()
check_nic()

print(f"\n{'='*80}")
print(f"Done ({host})")
print(f"{'='*80}")


if __name__ == "__main__":
main()
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ using urDeviceCreateWithNativeHandleTest = uur::urDeviceTest;
UUR_INSTANTIATE_DEVICE_TEST_SUITE(urDeviceCreateWithNativeHandleTest);

TEST_P(urDeviceCreateWithNativeHandleTest, Success) {
// Related issue: #22025
UUR_KNOWN_FAILURE_ON(uur::LevelZeroV2{});
ur_native_handle_t native_handle = 0;

UUR_ASSERT_SUCCESS_OR_UNSUPPORTED(
Expand All @@ -33,6 +35,8 @@ TEST_P(urDeviceCreateWithNativeHandleTest, Success) {

TEST_P(urDeviceCreateWithNativeHandleTest,
SuccessWithExplicitUnOwnedNativeHandle) {
// Related issue: #22025
UUR_KNOWN_FAILURE_ON(uur::LevelZeroV2{});
ur_native_handle_t native_handle = 0;
UUR_ASSERT_SUCCESS_OR_UNSUPPORTED(
urDeviceGetNativeHandle(device, &native_handle));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,8 @@ TEST_P(urDeviceGetSelectedTest, SuccessSelected_StarColonStar) {
}

TEST_P(urDeviceGetSelectedTest, SuccessSelected_StarColonZero) {
// Related issue: #22025
UUR_KNOWN_FAILURE_ON(uur::LevelZeroV2{});
uur::set_env("ONEAPI_DEVICE_SELECTOR", "*:0");
uint32_t count = 0;
ASSERT_SUCCESS(
Expand Down Expand Up @@ -153,6 +155,8 @@ TEST_P(urDeviceGetSelectedTest, SuccessSelected_SelectAndDiscard) {

TEST_P(urDeviceGetSelectedTest,
SuccessSelected_SelectSomethingAndDiscardSomethingElse) {
// Related issue: #22025
UUR_KNOWN_FAILURE_ON(uur::LevelZeroV2{});
uur::set_env("ONEAPI_DEVICE_SELECTOR", "*:0;!*:1");
uint32_t count = 0;
ASSERT_SUCCESS(
Expand All @@ -166,6 +170,7 @@ TEST_P(urDeviceGetSelectedTest,
}
}

//
TEST_P(urDeviceGetSelectedTest, InvalidNullHandlePlatform) {
uur::unset_env("ONEAPI_DEVICE_SELECTOR");
uint32_t count = 0;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,10 @@ UUR_INSTANTIATE_DEVICE_TEST_SUITE_MULTI_QUEUE(
// Note: Due to an issue with HIP, the subgroup test is not generated
struct urEnqueueKernelLaunchKernelSubGroupTest : uur::urKernelExecutionTest {
void SetUp() override {
// Subgroup size of 8 isn't supported on the Data Center GPU Max
UUR_KNOWN_FAILURE_ON(uur::HIP{}, uur::LevelZero{"Data Center GPU Max"},
uur::LevelZeroV2{"Data Center GPU Max"});
// Subgroup size of 8 isn't supported on the Data Center GPU Max or Battlemage Arc
UUR_KNOWN_FAILURE_ON(uur::HIP{},
uur::LevelZero{"Data Center GPU Max", "Arc(TM) B"},
uur::LevelZeroV2{"Data Center GPU Max", "Arc(TM) B"});

program_name = "subgroup";
UUR_RETURN_ON_FATAL_FAILURE(urKernelExecutionTest::SetUp());
Expand Down
Loading