cuda.core.CUDAWarning#

exception cuda.core.CUDAWarning#

Warning issued when cuda.core hits a CUDA error it cannot raise.

cuda.core raises exceptions for failures in ordinary calls. Some failures happen where no exception can propagate: while a resource is released by the garbage collector or by a CUDA callback, or while a context switch is undone after the requested operation already succeeded. Those failures are reported as this warning instead, and the affected resource may have leaked.

Filter on this category to make such failures fatal in tests:

warnings.filterwarnings("error", category=cuda.core.CUDAWarning)

Because the report comes from a destructor, an escalated warning cannot be raised into user code; it is delivered through sys.unraisablehook() (which pytest surfaces as PytestUnraisableExceptionWarning).

Added in version 1.3.0.