diff --git a/cuda_core/tests/test_binaries/build_test_binaries.sh b/cuda_core/tests/test_binaries/build_test_binaries.sh index 8d2231bd90a..eca6d8bbd6d 100755 --- a/cuda_core/tests/test_binaries/build_test_binaries.sh +++ b/cuda_core/tests/test_binaries/build_test_binaries.sh @@ -14,7 +14,9 @@ if [[ "${OS:-}" == "Windows_NT" ]]; then NVCC_EXTRA_FLAGS+=(-Xcompiler /Zc:preprocessor) fi -nvcc -dc "${NVCC_EXTRA_FLAGS[@]}" -arch=all-major \ +NVCC="${NVCC:-nvcc}" + +"${NVCC}" -dc "${NVCC_EXTRA_FLAGS[@]}" -arch=all-major \ -o "${SCRIPTPATH}/saxpy.o" "${SCRIPTPATH}/saxpy.cu" ls -lah "${SCRIPTPATH}/saxpy.o" diff --git a/cuda_core/tests/test_module.py b/cuda_core/tests/test_module.py index 524dd471345..047afe0e299 100644 --- a/cuda_core/tests/test_module.py +++ b/cuda_core/tests/test_module.py @@ -189,15 +189,18 @@ def get_saxpy_object(): obj_path = binaries_dir / "saxpy.o" if not obj_path.is_file(): - if find_nvidia_binary_utility("nvcc") is None: + nvcc_path = find_nvidia_binary_utility("nvcc") + if nvcc_path is None: pytest.skip( f"saxpy.o not found at {obj_path} and nvcc is unavailable. " "In CI this is downloaded from the build stage." ) + env = os.environ.copy() + env["NVCC"] = nvcc_path subprocess.run( # noqa: S603 ["bash", str(binaries_dir / "build_test_binaries.sh")], # noqa: S607 check=True, - env=os.environ, + env=env, ) return obj_path.read_bytes()