This is an automated email from the ASF dual-hosted git repository.
ryankert01 pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/mahout.git
The following commit(s) were added to refs/heads/main by this push:
new bd965e1df fix(build): gate test_rust on nvcc presence, not just
nvidia-smi (#1322)
bd965e1df is described below
commit bd965e1df0d5cc7457f279fc9f7f608630521522
Author: Andrew Musselman <[email protected]>
AuthorDate: Mon May 18 04:49:18 2026 -0700
fix(build): gate test_rust on nvcc presence, not just nvidia-smi (#1322)
---
Makefile | 20 ++++++++++++++++++--
1 file changed, 18 insertions(+), 2 deletions(-)
diff --git a/Makefile b/Makefile
index bad52e28c..d7816276e 100644
--- a/Makefile
+++ b/Makefile
@@ -16,9 +16,17 @@
.PHONY: test_rust test_python tests pre-commit setup-test-python
install-llvm-cov setup-benchmark
-# Detect NVIDIA GPU
+# Detect NVIDIA driver. Sufficient for `test_python` because `qdp-core` can
+# build against its CUDA-stub fallback when the toolkit is absent (the
+# Rust extension just won't be GPU-functional at runtime).
HAS_NVIDIA := $(shell command -v nvidia-smi >/dev/null 2>&1 && nvidia-smi -L
>/dev/null 2>&1 && echo yes || echo no)
+# Detect CUDA Toolkit. Required for `test_rust` because the qdp-core
+# integration tests link against libcudart from the toolkit. PyTorch's
+# bundled cudart inside its wheel does *not* satisfy this; the toolkit
+# (apt: nvidia-cuda-toolkit, or NVIDIA's installer) must be on PATH.
+HAS_NVCC := $(shell command -v nvcc >/dev/null 2>&1 && echo yes || echo no)
+
setup-test-python:
uv sync --group dev
@@ -26,12 +34,20 @@ install-llvm-cov:
@cargo llvm-cov --version >/dev/null 2>&1 || (echo "[INFO] Installing
cargo-llvm-cov..." && cargo install cargo-llvm-cov)
test_rust: install-llvm-cov
-ifeq ($(HAS_NVIDIA),yes)
+ifeq ($(HAS_NVCC),yes)
cd qdp && cargo llvm-cov test --workspace --exclude qdp-python --html
--output-dir target/llvm-cov/html
cd qdp && cargo llvm-cov report --summary-only
+else
+ifeq ($(HAS_NVIDIA),yes)
+ @echo "[SKIP] NVIDIA driver detected but CUDA Toolkit (nvcc) is not on
PATH."
+ @echo " qdp-core integration tests link against libcudart and
require"
+ @echo " the toolkit. PyTorch's bundled cudart is not sufficient."
+ @echo " Install via: apt install nvidia-cuda-toolkit"
+ @echo " or from: https://developer.nvidia.com/cuda-downloads"
else
@echo "[SKIP] No NVIDIA GPU detected, skipping test_rust"
endif
+endif
test_python: setup-test-python
ifeq ($(HAS_NVIDIA),yes)