Skip to content

Fix silently ignored CUDA errors in nvcuda backend - #409

Open
stijnh wants to merge 1 commit into
masterfrom
fix-nvcuda-error-check
Open

stijnh wants to merge 1 commit into
masterfrom
fix-nvcuda-error-check

Conversation

@stijnh

@stijnh stijnh commented Oct 2, 2026

Copy link
Copy Markdown
Member

Kernels that fail to launch are silently ignored by the nvcuda backend instead of raising an exception.

cuda-python returns a tuple from every call, even for calls that only return a status, e.g. cuLaunchKernel returns a tuple of length 1 (CUresult,). cuda_error_check assumes that its input is the error code, not a tuple. As a result, kernels that failed to launch were just ignored.

This PR changes cuda_error_check to unwrap tuples before checking the status. It is also raises a TypeError when given anything that is not a CUDA driver, runtime or NVRTC status.

@sonarqubecloud

sonarqubecloud Bot commented Oct 2, 2026

Copy link
Copy Markdown

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant