cuda
CUDA Runtime API Error Codes
Codes returned by NVIDIA's CUDA Runtime API as the cudaError_t enum, surfaced by cudaGetLastError() and by every major GPU framework (PyTorch, TensorFlow, JAX) that wraps CUDA calls.
18 codes
· All codes 18 codes
- cudaErrorAssert Device-Side Assert Triggered An assert() triggered in device code during kernel execution, corrupting the CUDA context. A very common cause is an out-of-bounds index (e.g. an embedding or indexing op) inside a GPU-accelerated ML framework.
- cudaErrorDeviceAlreadyInUse Device Already In Use The device is already in use, in exclusive-process mode, by another process and cannot be selected.
- cudaErrorDevicesUnavailable Devices Unavailable All CUDA-capable devices are busy or unavailable, usually because they are already in exclusive-process mode and in use by another process.
- cudaErrorIllegalAddress Illegal Address The device encountered a load or store instruction on an invalid memory address, corrupting the CUDA context. Any subsequent calls in that context will fail; the process must be terminated and relaunched.
- cudaErrorInitializationError Initialization Error The CUDA driver and runtime could not be initialized, typically because no compatible NVIDIA driver is loaded or the driver and runtime versions are incompatible.
- cudaErrorInsufficientDriver Insufficient Driver The installed NVIDIA CUDA driver is older than the CUDA runtime library the application was built against. The user should upgrade to a newer driver version.
- cudaErrorInvalidDevice Invalid Device The device ordinal supplied does not correspond to a valid CUDA device, or the action requested is invalid for the specified device.
- cudaErrorInvalidResourceHandle Invalid Resource Handle A resource handle passed to the API call (e.g. a stream or event) was not valid.
- cudaErrorInvalidValue Invalid Value One or more of the parameters passed to the API call is not within an acceptable range of values.
- cudaErrorLaunchFailure Unspecified Launch Failure An unspecified launch failure occurred in device code, corrupting the CUDA context. The process must be terminated and relaunched; the underlying cause is often an illegal memory access reported without further detail.
- cudaErrorLaunchOutOfResources Launch Out Of Resources A kernel launch failed because it used too many resources, such as registers or shared memory, for the specified execution configuration.
- cudaErrorLaunchTimeout Launch Timeout The device kernel took too long to execute, most often because a display-attached GPU's watchdog timer killed a long-running kernel.
- cudaErrorMemoryAllocation Out of Memory The API call failed because it was unable to allocate enough memory to perform the requested operation. Commonly surfaced by ML frameworks as "CUDA out of memory" when a model or batch exceeds available GPU memory.
- cudaErrorNoDevice No Device No CUDA-capable device was detected on the host, either because none is present or because the driver cannot see it.
- cudaErrorNoKernelImageForDevice No Kernel Image For Device No binary for the GPU's compute capability was found in the application, typically because a library (e.g. PyTorch) was built without support for the installed GPU's architecture.
- cudaErrorNotReady Not Ready Returned by an asynchronous operation query (e.g. cudaStreamQuery or cudaEventQuery) when the work being queried has not yet completed.
- cudaErrorUnknown Unknown Error The API call returned an error that the CUDA runtime could not further categorize. This code exists purely for backward compatibility and typically indicates an internal or driver-level fault.
- cudaSuccess Success The API call returned with no errors. In the case of query calls, this also means that the operation being queried is complete.