Skip to content

Commit 9746aa1

Browse files
committed
Maybe fix to test script
1 parent d1efef0 commit 9746aa1

File tree

1 file changed

+25
-4
lines changed

1 file changed

+25
-4
lines changed

ci/test_pynvbench.sh

Lines changed: 25 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
#!/bin/bash
22

33
set -euo pipefail
4+
5+
# Enable verbose output for debugging
6+
set -x
47
ci_dir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
58

69
source "$ci_dir/pyenv_helper.sh"
@@ -39,17 +42,35 @@ fi
3942
# Determine CUDA major version from environment
4043
cuda_major_version=$(nvcc --version | grep release | awk '{print $6}' | tr -d ',' | cut -d '.' -f 1 | cut -d 'V' -f 2)
4144

42-
# Setup Python environment
43-
setup_python_env "${py_version}"
45+
# Setup Python environment (skip if we're already in ci-wheel container with correct Python)
46+
echo "Checking for Python ${py_version}..."
47+
if command -v python &> /dev/null; then
48+
actual_py_version=$(python --version 2>&1 | awk '{print $2}' | cut -d. -f1,2)
49+
echo "Found Python version: ${actual_py_version}"
50+
if [[ "${actual_py_version}" == "${py_version}" ]]; then
51+
echo "Python ${py_version} already available, skipping pyenv setup"
52+
python -m pip install --upgrade pip
53+
else
54+
echo "Python version mismatch (found ${actual_py_version}, need ${py_version})"
55+
echo "Setting up Python ${py_version} with pyenv"
56+
setup_python_env "${py_version}"
57+
fi
58+
else
59+
echo "Python not found, setting up with pyenv"
60+
setup_python_env "${py_version}"
61+
fi
62+
63+
echo "Python setup complete, version: $(python --version)"
4464

4565
# Wheel should be in /workspace/wheelhouse (downloaded by workflow or built locally)
4666
WHEELHOUSE_DIR="/workspace/wheelhouse"
4767

4868
# Find and install pynvbench wheel
49-
PYNVBENCH_WHEEL_PATH="$(ls ${WHEELHOUSE_DIR}/pynvbench-*+cu${cuda_version}*.whl 2>/dev/null | head -1)"
69+
# Look for .cu${cuda_version} in the version string (e.g., pynvbench-0.0.1.dev1+g123.cu12-...)
70+
PYNVBENCH_WHEEL_PATH="$(ls ${WHEELHOUSE_DIR}/pynvbench-*.cu${cuda_version}-*.whl 2>/dev/null | head -1)"
5071
if [[ -z "$PYNVBENCH_WHEEL_PATH" ]]; then
5172
echo "Error: No pynvbench wheel found in ${WHEELHOUSE_DIR}"
52-
echo "Looking for: pynvbench-*+cu${cuda_version}*.whl"
73+
echo "Looking for: pynvbench-*.cu${cuda_version}-*.whl"
5374
echo "Contents of ${WHEELHOUSE_DIR}:"
5475
ls -la ${WHEELHOUSE_DIR}/ || true
5576
exit 1

0 commit comments

Comments
 (0)