pub enum CudaError {
Show 96 variants
InvalidValue,
OutOfMemory,
NotInitialized,
Deinitialized,
ProfilerDisabled,
ProfilerNotInitialized,
ProfilerAlreadyStarted,
ProfilerAlreadyStopped,
StubLibrary,
DeviceUnavailable,
NoDevice,
InvalidDevice,
DeviceNotLicensed,
InvalidImage,
InvalidContext,
ContextAlreadyCurrent,
MapFailed,
UnmapFailed,
ArrayIsMapped,
AlreadyMapped,
NoBinaryForGpu,
AlreadyAcquired,
NotMapped,
NotMappedAsArray,
NotMappedAsPointer,
EccUncorrectable,
UnsupportedLimit,
ContextAlreadyInUse,
PeerAccessUnsupported,
InvalidPtx,
InvalidGraphicsContext,
NvlinkUncorrectable,
JitCompilerNotFound,
UnsupportedPtxVersion,
JitCompilationDisabled,
UnsupportedExecAffinity,
UnsupportedDevsideSync,
InvalidSource,
FileNotFound,
SharedObjectSymbolNotFound,
SharedObjectInitFailed,
OperatingSystem,
InvalidHandle,
IllegalState,
LossyQuery,
NotFound,
NotReady,
IllegalAddress,
LaunchOutOfResources,
LaunchTimeout,
LaunchIncompatibleTexturing,
PeerAccessAlreadyEnabled,
PeerAccessNotEnabled,
PrimaryContextActive,
ContextIsDestroyed,
Assert,
TooManyPeers,
HostMemoryAlreadyRegistered,
HostMemoryNotRegistered,
HardwareStackError,
IllegalInstruction,
MisalignedAddress,
InvalidAddressSpace,
InvalidPc,
LaunchFailed,
CooperativeLaunchTooLarge,
NotPermitted,
NotSupported,
SystemNotReady,
SystemDriverMismatch,
CompatNotSupportedOnDevice,
MpsConnectionFailed,
MpsRpcFailure,
MpsServerNotReady,
MpsMaxClientsReached,
MpsMaxConnectionsReached,
MpsClientTerminated,
CdpNotSupported,
CdpVersionMismatch,
StreamCaptureUnsupported,
StreamCaptureInvalidated,
StreamCaptureMerge,
StreamCaptureUnmatched,
StreamCaptureUnjoined,
StreamCaptureIsolation,
StreamCaptureImplicit,
CapturedEvent,
StreamCaptureWrongThread,
Timeout,
GraphExecUpdateFailure,
ExternalDevice,
InvalidClusterSize,
FunctionNotLoaded,
InvalidResourceType,
InvalidResourceConfiguration,
Unknown(u32),
}Expand description
Primary error type for CUDA driver API calls.
Each variant maps to a specific CUresult code from the CUDA Driver API.
The Unknown variant is the catch-all for codes not
explicitly listed.
Variants§
InvalidValue
CUDA_ERROR_INVALID_VALUE (1)
OutOfMemory
CUDA_ERROR_OUT_OF_MEMORY (2)
NotInitialized
CUDA_ERROR_NOT_INITIALIZED (3)
Deinitialized
CUDA_ERROR_DEINITIALIZED (4)
ProfilerDisabled
CUDA_ERROR_PROFILER_DISABLED (5)
ProfilerNotInitialized
CUDA_ERROR_PROFILER_NOT_INITIALIZED (6)
ProfilerAlreadyStarted
CUDA_ERROR_PROFILER_ALREADY_STARTED (7)
ProfilerAlreadyStopped
CUDA_ERROR_PROFILER_ALREADY_STOPPED (8)
StubLibrary
CUDA_ERROR_STUB_LIBRARY (34)
CUDA_ERROR_DEVICE_UNAVAILABLE (46)
NoDevice
CUDA_ERROR_NO_DEVICE (100)
InvalidDevice
CUDA_ERROR_INVALID_DEVICE (101)
DeviceNotLicensed
CUDA_ERROR_DEVICE_NOT_LICENSED (102)
InvalidImage
CUDA_ERROR_INVALID_IMAGE (200)
InvalidContext
CUDA_ERROR_INVALID_CONTEXT (201)
ContextAlreadyCurrent
CUDA_ERROR_CONTEXT_ALREADY_CURRENT (202)
MapFailed
CUDA_ERROR_MAP_FAILED (205)
UnmapFailed
CUDA_ERROR_UNMAP_FAILED (206)
ArrayIsMapped
CUDA_ERROR_ARRAY_IS_MAPPED (207)
AlreadyMapped
CUDA_ERROR_ALREADY_MAPPED (208)
NoBinaryForGpu
CUDA_ERROR_NO_BINARY_FOR_GPU (209)
AlreadyAcquired
CUDA_ERROR_ALREADY_ACQUIRED (210)
NotMapped
CUDA_ERROR_NOT_MAPPED (211)
NotMappedAsArray
CUDA_ERROR_NOT_MAPPED_AS_ARRAY (212)
NotMappedAsPointer
CUDA_ERROR_NOT_MAPPED_AS_POINTER (213)
EccUncorrectable
CUDA_ERROR_ECC_UNCORRECTABLE (214)
UnsupportedLimit
CUDA_ERROR_UNSUPPORTED_LIMIT (215)
ContextAlreadyInUse
CUDA_ERROR_CONTEXT_ALREADY_IN_USE (216)
PeerAccessUnsupported
CUDA_ERROR_PEER_ACCESS_UNSUPPORTED (217)
InvalidPtx
CUDA_ERROR_INVALID_PTX (218)
InvalidGraphicsContext
CUDA_ERROR_INVALID_GRAPHICS_CONTEXT (219)
NvlinkUncorrectable
CUDA_ERROR_NVLINK_UNCORRECTABLE (220)
JitCompilerNotFound
CUDA_ERROR_JIT_COMPILER_NOT_FOUND (221)
UnsupportedPtxVersion
CUDA_ERROR_UNSUPPORTED_PTX_VERSION (222)
JitCompilationDisabled
CUDA_ERROR_JIT_COMPILATION_DISABLED (223)
UnsupportedExecAffinity
CUDA_ERROR_UNSUPPORTED_EXEC_AFFINITY (224)
UnsupportedDevsideSync
CUDA_ERROR_UNSUPPORTED_DEVSIDE_SYNC (225)
InvalidSource
CUDA_ERROR_INVALID_SOURCE (300)
FileNotFound
CUDA_ERROR_FILE_NOT_FOUND (301)
CUDA_ERROR_SHARED_OBJECT_SYMBOL_NOT_FOUND (302)
CUDA_ERROR_SHARED_OBJECT_INIT_FAILED (303)
OperatingSystem
CUDA_ERROR_OPERATING_SYSTEM (304)
InvalidHandle
CUDA_ERROR_INVALID_HANDLE (400)
IllegalState
CUDA_ERROR_ILLEGAL_STATE (401)
LossyQuery
CUDA_ERROR_LOSSY_QUERY (402)
NotFound
CUDA_ERROR_NOT_FOUND (500)
NotReady
CUDA_ERROR_NOT_READY (600)
IllegalAddress
CUDA_ERROR_ILLEGAL_ADDRESS (700)
LaunchOutOfResources
CUDA_ERROR_LAUNCH_OUT_OF_RESOURCES (701)
LaunchTimeout
CUDA_ERROR_LAUNCH_TIMEOUT (702)
LaunchIncompatibleTexturing
CUDA_ERROR_LAUNCH_INCOMPATIBLE_TEXTURING (703)
PeerAccessAlreadyEnabled
CUDA_ERROR_PEER_ACCESS_ALREADY_ENABLED (704)
PeerAccessNotEnabled
CUDA_ERROR_PEER_ACCESS_NOT_ENABLED (705)
PrimaryContextActive
CUDA_ERROR_PRIMARY_CONTEXT_ACTIVE (708)
ContextIsDestroyed
CUDA_ERROR_CONTEXT_IS_DESTROYED (709)
Assert
CUDA_ERROR_ASSERT (710)
TooManyPeers
CUDA_ERROR_TOO_MANY_PEERS (711)
HostMemoryAlreadyRegistered
CUDA_ERROR_HOST_MEMORY_ALREADY_REGISTERED (712)
HostMemoryNotRegistered
CUDA_ERROR_HOST_MEMORY_NOT_REGISTERED (713)
HardwareStackError
CUDA_ERROR_HARDWARE_STACK_ERROR (714)
IllegalInstruction
CUDA_ERROR_ILLEGAL_INSTRUCTION (715)
MisalignedAddress
CUDA_ERROR_MISALIGNED_ADDRESS (716)
InvalidAddressSpace
CUDA_ERROR_INVALID_ADDRESS_SPACE (717)
InvalidPc
CUDA_ERROR_INVALID_PC (718)
LaunchFailed
CUDA_ERROR_LAUNCH_FAILED (719)
CooperativeLaunchTooLarge
CUDA_ERROR_COOPERATIVE_LAUNCH_TOO_LARGE (720)
NotPermitted
CUDA_ERROR_NOT_PERMITTED (800)
NotSupported
CUDA_ERROR_NOT_SUPPORTED (801)
SystemNotReady
CUDA_ERROR_SYSTEM_NOT_READY (802)
SystemDriverMismatch
CUDA_ERROR_SYSTEM_DRIVER_MISMATCH (803)
CompatNotSupportedOnDevice
CUDA_ERROR_COMPAT_NOT_SUPPORTED_ON_DEVICE (804)
MpsConnectionFailed
CUDA_ERROR_MPS_CONNECTION_FAILED (805)
MpsRpcFailure
CUDA_ERROR_MPS_RPC_FAILURE (806)
MpsServerNotReady
CUDA_ERROR_MPS_SERVER_NOT_READY (807)
MpsMaxClientsReached
CUDA_ERROR_MPS_MAX_CLIENTS_REACHED (808)
MpsMaxConnectionsReached
CUDA_ERROR_MPS_MAX_CONNECTIONS_REACHED (809)
MpsClientTerminated
CUDA_ERROR_MPS_CLIENT_TERMINATED (810)
CdpNotSupported
CUDA_ERROR_CDP_NOT_SUPPORTED (811)
CdpVersionMismatch
CUDA_ERROR_CDP_VERSION_MISMATCH (812)
StreamCaptureUnsupported
CUDA_ERROR_STREAM_CAPTURE_UNSUPPORTED (900)
StreamCaptureInvalidated
CUDA_ERROR_STREAM_CAPTURE_INVALIDATED (901)
StreamCaptureMerge
CUDA_ERROR_STREAM_CAPTURE_MERGE (902)
StreamCaptureUnmatched
CUDA_ERROR_STREAM_CAPTURE_UNMATCHED (903)
StreamCaptureUnjoined
CUDA_ERROR_STREAM_CAPTURE_UNJOINED (904)
StreamCaptureIsolation
CUDA_ERROR_STREAM_CAPTURE_ISOLATION (905)
StreamCaptureImplicit
CUDA_ERROR_STREAM_CAPTURE_IMPLICIT (906)
CapturedEvent
CUDA_ERROR_CAPTURED_EVENT (907)
StreamCaptureWrongThread
CUDA_ERROR_STREAM_CAPTURE_WRONG_THREAD (908)
Timeout
CUDA_ERROR_TIMEOUT (909)
GraphExecUpdateFailure
CUDA_ERROR_GRAPH_EXEC_UPDATE_FAILURE (910)
ExternalDevice
CUDA_ERROR_EXTERNAL_DEVICE (911)
InvalidClusterSize
CUDA_ERROR_INVALID_CLUSTER_SIZE (912)
FunctionNotLoaded
CUDA_ERROR_FUNCTION_NOT_LOADED (913)
InvalidResourceType
CUDA_ERROR_INVALID_RESOURCE_TYPE (914)
InvalidResourceConfiguration
CUDA_ERROR_INVALID_RESOURCE_CONFIGURATION (915)
Unknown(u32)
Unknown error code not covered by any other variant.
Implementations§
Source§impl CudaError
impl CudaError
Sourcepub fn is_fatal(&self) -> bool
pub fn is_fatal(&self) -> bool
Returns true for errors that indicate a fatal, non-recoverable
GPU state — meaning the current CUDA context is likely corrupted and
should be destroyed before attempting further GPU work.
§Rationale
Most CUDA errors are caused by incorrect API usage (e.g. bad argument, unsupported feature) and do not invalidate the GPU context. A small subset — hardware faults, illegal instructions, or illegal memory accesses — leave the device in an indeterminate state.
§Examples
use oxicuda_driver::CudaError;
// Hardware fault — fatal
assert!(CudaError::IllegalAddress.is_fatal());
assert!(CudaError::LaunchFailed.is_fatal());
assert!(CudaError::HardwareStackError.is_fatal());
// Bad argument — recoverable
assert!(!CudaError::InvalidValue.is_fatal());
assert!(!CudaError::OutOfMemory.is_fatal());
assert!(!CudaError::NotReady.is_fatal());Sourcepub fn is_usage_error(&self) -> bool
pub fn is_usage_error(&self) -> bool
Returns true for errors that are clearly caused by incorrect API
usage rather than hardware faults or resource exhaustion.
These errors indicate the caller passed bad arguments and the GPU state is intact.
use oxicuda_driver::CudaError;
assert!(CudaError::InvalidValue.is_usage_error());
assert!(CudaError::InvalidDevice.is_usage_error());
assert!(!CudaError::OutOfMemory.is_usage_error());Trait Implementations§
Source§impl Error for CudaError
impl Error for CudaError
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()