-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathrun_tests.sh
More file actions
41 lines (31 loc) · 1.3 KB
/
run_tests.sh
File metadata and controls
41 lines (31 loc) · 1.3 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
#!/bin/bash
# Test runner script for nvshmem-triton
# This script sets up the NVSHMEM environment and runs pytest
set -e
echo "Setting up NVSHMEM environment for testing..."
# Function to find NVSHMEM_HOME using the same logic as get_nvshmem_home_path()
function set_nvshmem_home() {
# Use the same logic as get_nvshmem_home_path() from nvshmem_triton.api
if [ -n "$NVSHMEM_HOME" ]; then
echo "Found NVSHMEM_HOME from environment variable: $NVSHMEM_HOME"
else
# Try to find from Python nvidia-nvshmem-cu12 package
export NVSHMEM_HOME=$(python3 -c "import nvidia.nvshmem, pathlib; print(pathlib.Path(nvidia.nvshmem.__path__[0]))" 2>/dev/null)
if [ -n "$NVSHMEM_HOME" ]; then
echo "Found NVSHMEM_HOME from Python nvidia-nvshmem-cu12: $NVSHMEM_HOME"
else
echo "warning: NVSHMEM_HOME could not be determined."
echo "Please set NVSHMEM_HOME environment variable manually."
exit 1
fi
fi
}
# Set up NVSHMEM environment
set_nvshmem_home
# Set up LD_LIBRARY_PATH
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:${NVSHMEM_HOME}/lib
echo "NVSHMEM_HOME: ${NVSHMEM_HOME}"
echo "LD_LIBRARY_PATH: ${LD_LIBRARY_PATH}"
# Run pytest with any additional arguments passed to this script
echo "Running pytest..."
pytest --ignore=3rdparty "$@"