Skip to content

Commit 30e6659

Browse files
committed
test: extend CUDA test suite for PyTorch packages and CUDA_HOME
Add tests to validate the packages from #70 and env var from #69: - CUDA_HOME env var equals /usr/local/cuda - libcupti.so present (cuda-cupti package) - libcusparseLt.so present (libcusparselt0 package) - libcudss.so present (libcudss0-cuda package) Closes #74 Signed-off-by: Shanmukh Pawan <smoparth@redhat.com>
1 parent cb236bf commit 30e6659

File tree

1 file changed

+42
-0
lines changed

1 file changed

+42
-0
lines changed

tests/test_cuda_image.py

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,15 @@ def test_cuda_in_path(cuda_container):
4141
assert "/usr/local/cuda/bin" in cuda_container.get_env("PATH")
4242

4343

44+
def test_cuda_home(cuda_container):
45+
"""Verify CUDA_HOME points to the CUDA toolkit directory.
46+
47+
PyTorch source builds (torch.utils.cpp_extension) and Triton JIT kernel
48+
compilation rely on CUDA_HOME to locate the toolkit.
49+
"""
50+
assert cuda_container.get_env("CUDA_HOME") == "/usr/local/cuda"
51+
52+
4453
# --- CUDA Toolkit Tests ---
4554

4655

@@ -77,6 +86,39 @@ def test_libcudnn_present(cuda_container):
7786
assert result.returncode == 0
7887

7988

89+
# --- PyTorch CUDA Library Tests ---
90+
91+
92+
def test_libcupti_present(cuda_container):
93+
"""Verify CUPTI (CUDA Profiling Tools Interface) library is present.
94+
95+
Required by the PyTorch profiler for GPU profiling.
96+
Installed via cuda-cupti package.
97+
"""
98+
result = cuda_container.run("ldconfig -p | grep libcupti")
99+
assert result.returncode == 0, "libcupti.so not found - cuda-cupti package may be missing"
100+
101+
102+
def test_libcusparselt_present(cuda_container):
103+
"""Verify cuSPARSELt (structured sparsity) library is present.
104+
105+
Used by PyTorch sparse operations for structured sparsity support.
106+
Installed via libcusparselt0 package.
107+
"""
108+
result = cuda_container.run("ldconfig -p | grep libcusparseLt")
109+
assert result.returncode == 0, "libcusparseLt.so not found - libcusparselt0 package may be missing"
110+
111+
112+
def test_libcudss_present(cuda_container):
113+
"""Verify cuDSS (direct sparse solver) library is present.
114+
115+
Used by scientific and ML solvers for sparse direct solving.
116+
Installed via libcudss0-cuda package.
117+
"""
118+
result = cuda_container.run("ldconfig -p | grep libcudss")
119+
assert result.returncode == 0, "libcudss.so not found - libcudss0-cuda package may be missing"
120+
121+
80122
# --- CUDA Label Tests ---
81123

82124

0 commit comments

Comments
 (0)