Skip to content

Commit fd2de8c

Browse files
committed
Fix issue causing segfault
1 parent d178a08 commit fd2de8c

File tree

3 files changed

+21
-4
lines changed

3 files changed

+21
-4
lines changed

ci/build_multi_cuda_wheel.sh

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,14 +123,24 @@ cd wheelhouse_merged
123123
$PYTHON -m wheel unpack "$cu12_wheel"
124124
base_dir=$(find . -maxdepth 1 -type d -name "pynvbench-*" | head -1)
125125

126+
# Rename libnvbench.so to libnvbench_cu12.so in the base (CUDA 12) wheel
127+
mv "$base_dir/cuda/bench/libnvbench.so" "$base_dir/cuda/bench/libnvbench_cu12.so"
128+
129+
# Update _nvbench_cu12.so to link to libnvbench_cu12.so instead of libnvbench.so
130+
patchelf --replace-needed libnvbench.so libnvbench_cu12.so "$base_dir"/cuda/bench/_nvbench_cu12*.so
131+
126132
# Unpack CUDA 13 wheel into a temporary subdirectory
127133
mkdir cu13_tmp
128134
cd cu13_tmp
129135
$PYTHON -m wheel unpack "$cu13_wheel"
130136
cu13_dir=$(find . -maxdepth 1 -type d -name "pynvbench-*" | head -1)
131137

132-
# Copy the CUDA 13 extension into the base wheel
138+
# Copy the CUDA 13 extension AND library into the base wheel
133139
cp "$cu13_dir"/cuda/bench/_nvbench_cu13*.so "../$base_dir/cuda/bench/"
140+
cp "$cu13_dir"/cuda/bench/libnvbench.so "../$base_dir/cuda/bench/libnvbench_cu13.so"
141+
142+
# Update _nvbench_cu13.so to link to libnvbench_cu13.so instead of libnvbench.so
143+
patchelf --replace-needed libnvbench.so libnvbench_cu13.so "../$base_dir"/cuda/bench/_nvbench_cu13*.so
134144

135145
# Go back and clean up
136146
cd ..

ci/test_pynvbench_inner.sh

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,9 +40,10 @@ fi
4040

4141
# Determine which CUDA extra to install (defaults to cu12 if not specified)
4242
CUDA_EXTRA="${cuda_extra:-cu${cuda_version}}"
43+
TEST_EXTRA="test-cu${cuda_version}"
4344

44-
echo "Installing wheel: $PYNVBENCH_WHEEL_PATH with extras: ${CUDA_EXTRA},test"
45-
python -m pip install "${PYNVBENCH_WHEEL_PATH}[${CUDA_EXTRA},test]"
45+
echo "Installing wheel: $PYNVBENCH_WHEEL_PATH with extras: ${CUDA_EXTRA},${TEST_EXTRA}"
46+
python -m pip install "${PYNVBENCH_WHEEL_PATH}[${CUDA_EXTRA},${TEST_EXTRA}]"
4647

4748
# Run tests
4849
cd "/workspace/python/test/"

python/pyproject.toml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,13 @@ cu12 = ["cuda-bindings>=12.0.0,<13.0.0", "nvidia-cuda-cupti-cu12"]
3535
# CUDA 13.x dependencies
3636
cu13 = ["cuda-bindings>=13.0.0,<14.0.0", "nvidia-cuda-cupti>=13.0"]
3737

38-
# Test dependencies (using CUDA 12 by default)
38+
# Test dependencies for CUDA 12
39+
test-cu12 = ["pynvbench[cu12]", "pytest", "cupy-cuda12x", "numba"]
40+
41+
# Test dependencies for CUDA 13
42+
test-cu13 = ["pynvbench[cu13]", "pytest", "cupy-cuda13x", "numba"]
43+
44+
# Generic test dependencies (defaults to CUDA 12)
3945
test = ["pytest", "cupy-cuda12x", "numba"]
4046

4147
[project.urls]

0 commit comments

Comments
 (0)