From c0327b66008ffe16e40a9503c4aff418914ac10d Mon Sep 17 00:00:00 2001 From: stijn Date: Wed, 4 Mar 2026 20:52:44 +0100 Subject: [PATCH] Handle special case where error is a tuple in `cuda_error_check` --- kernel_tuner/utils/nvcuda.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/kernel_tuner/utils/nvcuda.py b/kernel_tuner/utils/nvcuda.py index 5bbd7b5e..03453c4b 100644 --- a/kernel_tuner/utils/nvcuda.py +++ b/kernel_tuner/utils/nvcuda.py @@ -56,6 +56,10 @@ def cuda_error_check(error): if error != nvrtc.nvrtcResult.NVRTC_SUCCESS: _, desc = nvrtc.nvrtcGetErrorString(error) raise RuntimeError(f"NVRTC error: {desc.decode()}") + elif isinstance(error, tuple) and len(error) > 0: + cuda_error_check(error[0]) + else: + raise RuntimeError(f"unknown error type returned by CUDA: {error!r} (type: {type(error).__name__})") def to_valid_nvrtc_gpu_arch_cc(compute_capability: str) -> str: