Skip to content

Commit 8578410

Browse files
committed
Run cufile tests on Thor Tegra Linux, skip only on Orin
1 parent c11a267 commit 8578410

File tree

1 file changed

+22
-2
lines changed

1 file changed

+22
-2
lines changed

cuda_bindings/tests/test_cufile.py

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,14 +79,32 @@ def isSupportedFilesystem():
7979
return fs_type in ("ext4", "xfs")
8080

8181

82+
@cache
83+
def get_tegra_kind():
84+
"""Detect Tegra device kind (Orin/Thor) via nvidia-smi, or None if not Tegra."""
85+
if not pathlib.Path("/etc/nv_tegra_release").exists():
86+
return None
87+
out = subprocess.check_output(["nvidia-smi"], text=True, stderr=subprocess.STDOUT) # noqa: S607
88+
tegra_kinds_found = []
89+
for kind in ("Orin", "Thor"):
90+
if f" {kind} " in out:
91+
tegra_kinds_found.append(kind)
92+
assert len(tegra_kinds_found) == 1, f"UNEXPECTED nvidia-smi output:\n{out}"
93+
return tegra_kinds_found[0]
94+
95+
8296
# Global skip condition for all tests if cuFile library is not available
8397
pytestmark = [
8498
pytest.mark.skipif(not cufileLibraryAvailable(), reason="cuFile library not available on this system"),
8599
pytest.mark.skipif(
86100
platform.system() == "Linux" and "microsoft" in pathlib.Path("/proc/version").read_text().lower(),
87101
reason="skipping cuFile tests on WSL",
88102
),
89-
pytest.mark.skipif(pathlib.Path("/etc/nv_tegra_release").exists(), reason="skipping cuFile tests on Tegra Linux"),
103+
pytest.mark.skipif(get_tegra_kind() == "Orin", reason="skipping cuFile tests on Orin (Tegra Linux)"),
104+
pytest.mark.skipif(
105+
get_tegra_kind() == "Thor" and cufileVersionLessThan(1160),
106+
reason="skipping cuFile tests on Thor (Tegra Linux) with CTK < 13.1",
107+
),
90108
]
91109

92110
xfail_handle_register = pytest.mark.xfail(
@@ -1826,7 +1844,9 @@ def test_get_bar_size_in_kb():
18261844

18271845
# Verify BAR size is a reasonable value
18281846
assert isinstance(bar_size_kb, int), "BAR size should be an integer"
1829-
assert bar_size_kb > 0, "BAR size should be positive"
1847+
# Tegra devices may report 0 BAR size, which is acceptable
1848+
min_bar_size = 0 if get_tegra_kind() else 1
1849+
assert bar_size_kb >= min_bar_size, f"BAR size should be >= {min_bar_size}"
18301850

18311851
logging.info(f"GPU BAR size: {bar_size_kb} KB ({bar_size_kb / 1024 / 1024:.2f} GB)")
18321852

0 commit comments

Comments
 (0)