CUDBGAPI_st

struct CUDBGAPI_st

CUDA debugger API methods.

Public Members

CUDBGResult (*acknowledgeEvent30)(CUDBGEvent30 *event)

Inform the debugger API that synchronous events have been processed.

Behaves exactly like acknowledgeSyncEvents (the event parameter is ignored).

Since CUDA 3.0.

Note

DEPRECATED in CUDA 3.1: Use acknowledgeSyncEvents instead.

Param event

[in] - pointer to the event that has been processed

Return

CUDBG_SUCCESS,

Return

CUDBG_ERROR_INVALID_ARGS,

Return

CUDBG_ERROR_UNINITIALIZED,

Return

CUDBG_ERROR_INITIALIZATION_FAILURE

CUDBGResult (*acknowledgeEvents42)(void)

Inform the debugger API that synchronous events have been processed.

Behaves exactly like acknowledgeSyncEvents.

Since CUDA 3.1.

Note

DEPRECATED in CUDA 5.0: Use acknowledgeSyncEvents instead.

Return

CUDBG_SUCCESS,

Return

CUDBG_ERROR_INVALID_ARGS,

Return

CUDBG_ERROR_UNINITIALIZED,

Return

CUDBG_ERROR_INITIALIZATION_FAILURE

CUDBGResult (*acknowledgeSyncEvents)(void)

Inform the debugger API that synchronous events have been processed.

This resumes any process that was interrupted by the synchronous event (e.g. a context creation, a module load, etc.). This method always acknowledges only those SYNC events that have been read with getNextEvent (or its deprecated variants). SYNC events that haven’t been read are not acknowledged and will continue to prevent their corresponding processes from proceeding. ASYNC events do not require acknowledgement.

Since CUDA 5.0.

See also

getNextEvent

Return

CUDBG_SUCCESS,

Return

CUDBG_ERROR_INVALID_ARGS,

Return

CUDBG_ERROR_UNINITIALIZED,

Return

CUDBG_ERROR_INITIALIZATION_FAILURE

CUDBGResult (*clearAttachState)(void)

Clear attach-specific state prior to detach.

This call prepares the API for detaching. See the “Attaching and Detaching” section for more information.

Since CUDA 5.0.

Return

CUDBG_SUCCESS,

Return

CUDBG_ERROR_UNINITIALIZED,

Return

CUDBG_ERROR_INITIALIZATION_FAILURE,

Return

CUDBG_ERROR_RECURSIVE_API_CALL

CUDBGResult (*consumeCudaLogs)(CUDBGCudaLogMessage *logMessages, uint32_t numMessages, uint32_t *numConsumed)

Get CUDA error log entries.

This consumes the log entries, so they will not be available in subsequent calls. This functionality is only available if the CUDBG_DEBUGGER_CAPABILITY_ENABLE_CUDA_LOGS capability is enabled.

This function can be called from the notification callback function.

Since CUDA 13.4.

See also

setCudaLogRules

Param logMessages

[out] - client-allocated array to store log entries

Param numMessages

[in] - capacity of the logMessages array, in number of elements

Param numConsumed

[out] - returned number of entries written to logMessages

Return

CUDBG_SUCCESS,

Return

CUDBG_ERROR_INVALID_ARGS,

Return

CUDBG_ERROR_UNINITIALIZED,

Return

CUDBG_ERROR_INITIALIZATION_FAILURE,

Return

CUDBG_ERROR_NO_EVENT_AVAILABLE,

Return

CUDBG_ERROR_RECURSIVE_API_CALL

CUDBGResult (*consumeCudaLogs129)(CUDBGCudaLogMessage129 *logMessages, uint32_t numMessages, uint32_t *numConsumed)

Get CUDA error log entries.

This consumes the log entries, so they will not be available in subsequent calls. This functionality is only available if the CUDBG_DEBUGGER_CAPABILITY_ENABLE_CUDA_LOGS capability is enabled.

Since CUDA 12.9.

See also

consumeCudaLogs

Note

Since CUDA 13.4, this function can be called from the notification callback function.

Note

DEPRECATED in CUDA 13.4: Use consumeCudaLogs instead.

Param logMessages

[out] - client-allocated array to store log entries

Param numMessages

[in] - capacity of the logMessages array, in number of elements

Param numConsumed

[out] - returned number of entries written to logMessages

Return

CUDBG_SUCCESS,

Return

CUDBG_ERROR_INVALID_ARGS,

Return

CUDBG_ERROR_UNINITIALIZED,

Return

CUDBG_ERROR_INITIALIZATION_FAILURE,

Return

CUDBG_ERROR_NO_EVENT_AVAILABLE,

Return

CUDBG_ERROR_RECURSIVE_API_CALL

CUDBGResult (*disableBreakpoint)(CUDBGBreakpointHandle handle)

Disable a breakpoint specified by its handle.

Disabling/enabling a breakpoint might be faster than removing and inserting it again.

Since CUDA 13.2.

See also

enableBreakpoint

See also

insertBreakpoint

See also

removeBreakpoint

Param handle

[in] - the breakpoint handle. If it’s CUDBG_BREAKPOINT_HANDLE_ALL_USER_BREAKPOINTS, disable all breakpoints inserted by the client (except the break-on-launch breakpoint). It’s fine to use ALL_USER_BREAKPOINTS when there are no breakpoints added.

Return

CUDBG_SUCCESS,

Return

CUDBG_ERROR_INVALID_ARGS,

Return

CUDBG_ERROR_UNINITIALIZED,

Return

CUDBG_ERROR_INTERNAL,

Return

CUDBG_ERROR_INITIALIZATION_FAILURE,

Return

CUDBG_ERROR_RECURSIVE_API_CALL,

Return

CUDBG_ERROR_BREAKPOINT_STATE_CONFLICT

CUDBGResult (*disassemble)(uint32_t dev, uint64_t addr, uint32_t *instSize, char *buf, uint32_t sz)

Disassemble instruction at instruction address.

This method does not guarantee any specific output format and its result should be treated as plain text.

Since CUDA 3.0.

Param dev

[in] - device index

Param addr

[in] - instruction address

Param instSize

[out] - instruction size (32 or 64 bits)

Param buf

[out] - disassembled instruction buffer

Param sz

[in] - disassembled instruction buffer size

Return

CUDBG_SUCCESS,

Return

CUDBG_ERROR_UNKNOWN,

Return

CUDBG_ERROR_INVALID_ARGS,

Return

CUDBG_ERROR_UNINITIALIZED,

Return

CUDBG_ERROR_INTERNAL,

Return

CUDBG_ERROR_INVALID_ADDRESS,

Return

CUDBG_ERROR_INITIALIZATION_FAILURE,

Return

CUDBG_ERROR_INVALID_CONTEXT,

Return

CUDBG_ERROR_RECURSIVE_API_CALL

CUDBGResult (*enableBreakpoint)(CUDBGBreakpointHandle handle)

Enable a breakpoint specified by its handle.

Disabling/enabling a breakpoint might be faster than removing and inserting it again.

Since CUDA 13.2.

See also

insertBreakpoint

See also

removeBreakpoint

Param handle

[in] - the breakpoint handle. If it’s CUDBG_BREAKPOINT_HANDLE_ALL_USER_BREAKPOINTS, enable all breakpoints inserted by the client (except the break-on-launch breakpoint). It’s fine to use ALL_USER_BREAKPOINTS when there are no breakpoints added.

Return

CUDBG_SUCCESS,

Return

CUDBG_ERROR_INVALID_ARGS,

Return

CUDBG_ERROR_UNINITIALIZED,

Return

CUDBG_ERROR_INTERNAL,

Return

CUDBG_ERROR_INITIALIZATION_FAILURE,

Return

CUDBG_ERROR_RECURSIVE_API_CALL,

Return

CUDBG_ERROR_BREAKPOINT_STATE_CONFLICT

CUDBGResult (*executeInternalCommand)(const char *command, char *resultBuffer, uint32_t sizeInBytes)

Execute an internal command (not available in public driver builds)

Always returns CUDBG_ERROR_NOT_SUPPORTED.

Since CUDA 12.6.

Param command

[in] - the command name and arguments

Param resultBuffer

[out] - the destination buffer

Param sizeInBytes

[in] - buffer size in bytes

Return

CUDBG_ERROR_NOT_SUPPORTED

CUDBGResult (*finalize)(void)

Finalize the API, shutting down the debugging session.

Since CUDA 3.0.

See also

initialize

Return

CUDBG_SUCCESS,

Return

CUDBG_ERROR_UNINITIALIZED,

Return

CUDBG_ERROR_INITIALIZATION_FAILURE,

Return

CUDBG_ERROR_RECURSIVE_API_CALL

CUDBGResult (*generateCoredump)(const char *filename, CUDBGCoredumpGenerationFlags flags)

Generate a coredump for the current GPU state.

Since CUDA 12.3.

Param filename

[in] - target coredump file name

Param flags

[in] - coredump generation flags/options

Return

CUDBG_SUCCESS,

Return

CUDBG_ERROR_INVALID_ARGS,

Return

CUDBG_ERROR_UNINITIALIZED,

Return

CUDBG_ERROR_INTERNAL,

Return

CUDBG_ERROR_INITIALIZATION_FAILURE,

Return

CUDBG_ERROR_INVALID_CONTEXT,

Return

CUDBG_ERROR_RECURSIVE_API_CALL

CUDBGResult (*getAdjustedCodeAddress)(uint32_t dev, uint64_t address, uint64_t *adjustedAddress, CUDBGAdjAddrAction adjAction)

Get the adjusted code address for a given code address for a given device.

The client must call this function before inserting a breakpoint, or when the previous or next code address is needed for breakpoint inserting purposes.

Since CUDA 5.5.

See also

setBreakpoint

Param dev

[in] - device index

Param addr

[in] - instruction address

Param adjustedAddress

[out] - adjusted address

Param adjAction

[in] - whether the adjusted next, previous or current address is needed

Return

CUDBG_SUCCESS,

Return

CUDBG_ERROR_INVALID_ARGS,

Return

CUDBG_ERROR_UNINITIALIZED,

Return

CUDBG_ERROR_INTERNAL,

Return

CUDBG_ERROR_INVALID_ADDRESS,

Return

CUDBG_ERROR_INITIALIZATION_FAILURE,

Return

CUDBG_ERROR_RECURSIVE_API_CALL

CUDBGResult (*getBindlessConstAddress)(uint32_t dev, uint64_t header, uint64_t *address, uint32_t *size)

Get bindless constant GPU VA and size from its header.

Since CUDA 13.4.

This function does not validate the provided header. If the header is invalid, the function would still return success, but the returned address and size would be invalid.

Param dev

[in] - device index

Param header

[in] - bindless constant header

Param address

[out] - GPU VA of the start of the mapped bindless constant memory region

Param size

[out] - size of the mapped bindless constant memory region

Return

CUDBG_SUCCESS,

Return

CUDBG_ERROR_INVALID_ARGS,

Return

CUDBG_ERROR_UNINITIALIZED,

Return

CUDBG_ERROR_INTERNAL,

Return

CUDBG_ERROR_INITIALIZATION_FAILURE,

Return

CUDBG_ERROR_RECURSIVE_API_CALL

CUDBGResult (*getBlockDim)(uint32_t dev, uint32_t sm, uint32_t wp, CuDim3 *blockDim)

Get the dimensions of the given block.

Since CUDA 3.0.

See also

getClusterDim

See also

getGridDim

Param dev

[in] - device index

Param sm

[in] - SM index

Param wp

[in] - warp index

Param blockDim

[out] - the returned number of threads in the block

Return

CUDBG_SUCCESS,

Return

CUDBG_ERROR_INVALID_ARGS,

Return

CUDBG_ERROR_UNINITIALIZED,

Return

CUDBG_ERROR_INTERNAL,

Return

CUDBG_ERROR_INVALID_WARP,

Return

CUDBG_ERROR_INITIALIZATION_FAILURE,

Return

CUDBG_ERROR_INVALID_CONTEXT,

Return

CUDBG_ERROR_RECURSIVE_API_CALL

CUDBGResult (*getCbuWarpState)(uint32_t dev, uint32_t sm, uint64_t warpMask, CUDBGCbuWarpState *warpStates, uint32_t numWarpStates)

Get the CBU state of a given warp.

Since CUDA 12.9.

Param dev

[in] - device index

Param sm

[in] - SM index

Param warpMask

[in] - bitmask of the warps which states should be returned in warpStates

Param warpStates

[out] - pointer to the array of CUDBGCbuWarpState structures

Param numWarpStates

[in] - number of elements in warpStates array

Return

CUDBG_SUCCESS,

Return

CUDBG_ERROR_INVALID_ARGS,

Return

CUDBG_ERROR_UNINITIALIZED,

Return

CUDBG_ERROR_INTERNAL,

Return

CUDBG_ERROR_INVALID_WARP,

Return

CUDBG_ERROR_INITIALIZATION_FAILURE,

Return

CUDBG_ERROR_INVALID_CONTEXT,

Return

CUDBG_ERROR_RECURSIVE_API_CALL

CUDBGResult (*getClusterDim)(uint32_t dev, uint32_t sm, uint32_t wp, CuDim3 *clusterDim)

Get the number of blocks in the given cluster.

Since CUDA 12.7.

See also

getBlockDim

See also

getGridDim

Param dev

[in] - device index

Param sm

[in] - SM index

Param wp

[in] - warp index

Param clusterDim

[out] - the returned number of blocks in the cluster

Return

CUDBG_SUCCESS,

Return

CUDBG_ERROR_INVALID_ARGS,

Return

CUDBG_ERROR_UNINITIALIZED,

Return

CUDBG_ERROR_INTERNAL,

Return

CUDBG_ERROR_INVALID_WARP,

Return

CUDBG_ERROR_INITIALIZATION_FAILURE,

Return

CUDBG_ERROR_INVALID_CONTEXT,

Return

CUDBG_ERROR_RECURSIVE_API_CALL

CUDBGResult (*getClusterDim120)(uint32_t dev, uint64_t gridId64, CuDim3 *clusterDim)

Get the number of blocks in the given cluster.

Behaves like getClusterDim, but takes a grid ID instead of warp coordinates. In newer GPU architectures, it’s possible to have different warps belong to blocks of clusters of different size.

Since CUDA 12.0.

See also

getClusterDim

Note

DEPRECATED in CUDA 12.7: Use getClusterDim instead.

Param dev

[in] - device index

Param gridId64

[in] - grid ID

Param clusterDim

[out] - the returned number of blocks in the cluster

Return

CUDBG_SUCCESS,

Return

CUDBG_ERROR_INVALID_ARGS,

Return

CUDBG_ERROR_UNINITIALIZED,

Return

CUDBG_ERROR_INTERNAL,

Return

CUDBG_ERROR_INITIALIZATION_FAILURE,

Return

CUDBG_ERROR_INVALID_GRID,

Return

CUDBG_ERROR_RECURSIVE_API_CALL

CUDBGResult (*getClusterExceptionTargetBlock)(uint32_t dev, uint32_t sm, uint32_t wp, CuDim3 *blockIdx, bool *blockIdxValid)

Get the target block index and validity status for cluster exceptions.

Since CUDA 12.7.

Param dev

[in] - device index

Param sm

[in] - SM index

Param wp

[in] - warp index

Param blockIdx

[out] - pointer to a CuDim3 structure that will be populated with the target block index

Param blockIdxValid

[out] - pointer to a boolean variable that will be set to true if the target block index is valid, and false otherwise. Value will be set to false if the warp is not stopped on a cluster exception

Return

CUDBG_SUCCESS,

Return

CUDBG_ERROR_INVALID_ARGS,

Return

CUDBG_ERROR_UNINITIALIZED,

Return

CUDBG_ERROR_INTERNAL,

Return

CUDBG_ERROR_INVALID_WARP,

Return

CUDBG_ERROR_INITIALIZATION_FAILURE,

Return

CUDBG_ERROR_INVALID_CONTEXT,

Return

CUDBG_ERROR_RECURSIVE_API_CALL,

Return

CUDBG_ERROR_NOT_SUPPORTED

CUDBGResult (*getConstBankAddress)(uint32_t dev, uint64_t gridId64, uint32_t bank, uint64_t *address, uint32_t *size)

Get constant bank GPU VA and size.

Since CUDA 12.4.

Param dev

[in] - device index

Param gridId64

[in] - grid ID of the grid containing the constant bank

Param bank

[in] - constant bank number

Param address

[out] - GPU VA of the bank memory

Param size

[out] - bank size

Return

CUDBG_SUCCESS,

Return

CUDBG_ERROR_INVALID_ARGS,

Return

CUDBG_ERROR_UNINITIALIZED,

Return

CUDBG_ERROR_INTERNAL,

Return

CUDBG_ERROR_INITIALIZATION_FAILURE,

Return

CUDBG_ERROR_INVALID_GRID,

Return

CUDBG_ERROR_RECURSIVE_API_CALL,

Return

CUDBG_ERROR_MISSING_DATA

CUDBGResult (*getConstBankAddress123)(uint32_t dev, uint32_t sm, uint32_t wp, uint32_t bank, uint32_t offset, uint64_t *address)

Convert constant bank number and offset into GPU VA.

It’s more convenient to get the constbank address and then calculate the VA for any const address using that.

Since CUDA 12.3.

Note

DEPRECATED in CUDA 12.4: Use getConstBankAddress instead.

Param dev

[in] - device index

Param sm

[in] - SM index

Param wp

[in] - warp index

Param bank

[in] - constant bank number

Param offset

[in] - offset within the bank

Param address

[out] - GPU VA

Return

CUDBG_SUCCESS,

Return

CUDBG_ERROR_INVALID_ARGS,

Return

CUDBG_ERROR_UNINITIALIZED,

Return

CUDBG_ERROR_INVALID_MEMORY_ACCESS,

Return

CUDBG_ERROR_INTERNAL,

Return

CUDBG_ERROR_INITIALIZATION_FAILURE,

Return

CUDBG_ERROR_INVALID_GRID,

Return

CUDBG_ERROR_RECURSIVE_API_CALL,

Return

CUDBG_ERROR_MISSING_DATA

CUDBGResult (*getCudaExceptionString)(uint32_t dev, uint32_t sm, uint32_t wp, uint32_t ln, char *buf, uint32_t bufSz, uint32_t *msgSz)

Get the error string for CUDA Exceptions.

Since CUDA 13.0.

Param dev

[in] - device index

Param sm

[in] - SM index

Param wp

[in] - warp index

Param ln

[in] - lane index

Param buf

[out] - buffer for the error string

Param bufSz

[in] - buffer size

Param msgSz

[out] - error message size with null character, can be null

Return

CUDBG_SUCCESS,

Return

CUDBG_ERROR_BUFFER_TOO_SMALL,

Return

CUDBG_ERROR_INVALID_ARGS,

Return

CUDBG_ERROR_UNINITIALIZED,

Return

CUDBG_ERROR_INTERNAL,

Return

CUDBG_ERROR_INVALID_WARP,

Return

CUDBG_ERROR_INITIALIZATION_FAILURE,

Return

CUDBG_ERROR_INVALID_CONTEXT,

Return

CUDBG_ERROR_RECURSIVE_API_CALL

CUDBGResult (*getDeviceInfo)(uint32_t dev, CUDBGDeviceInfoQueryType_t type, void *buffer, uint32_t length, uint32_t *dataLength)

Read full device info for the device.

Information returned by this method is cheap to calculate, so it can be used after every suspend to quickly get the updated device state. For convenience, the caller can always request partial updates, the API will return a full response when returning a partial one is not possible. If the CUDBG_DEBUGGER_CAPABILITY_REPORT_EXCEPTIONS_IN_EXITED_WARPS capability is enabled, exceptions in exited warps will be reported.

Since CUDA 12.4.

Param dev

[in] - device index

Param type

[in] - query type (full or delta)

Param buffer

[out] - output buffer

Param length

[in] - output buffer length

Param dataLength

[out] - number of bytes written to the buffer

Return

CUDBG_SUCCESS,

Return

CUDBG_ERROR_INVALID_ARGS,

Return

CUDBG_ERROR_UNINITIALIZED,

Return

CUDBG_ERROR_INTERNAL,

Return

CUDBG_ERROR_INITIALIZATION_FAILURE,

Return

CUDBG_ERROR_RECURSIVE_API_CALL

CUDBGResult (*getDeviceInfoSizes)(uint32_t dev, CUDBGDeviceInfoSizes *sizes)

Return sizes for device info structs and defined attributes.

Since CUDA 12.4.

See also

getDeviceInfo

Param dev

[in] - device index

Param sizes

[out] - device info sizes

Return

CUDBG_SUCCESS,

Return

CUDBG_ERROR_INVALID_ARGS,

Return

CUDBG_ERROR_UNINITIALIZED,

Return

CUDBG_ERROR_INITIALIZATION_FAILURE,

Return

CUDBG_ERROR_RECURSIVE_API_CALL

CUDBGResult (*getDeviceName)(uint32_t dev, char *buf, uint32_t sz)

Get the device name string.

Returns CUDBG_ERROR_BUFFER_TOO_SMALL if the provided buffer is not large enough. This value is constant within a single session for a given device.

Since CUDA 6.5.

See also

getDeviceType

See also

getSMType

Param dev

[in] - device index

Param buf

[out] - the destination buffer

Param sz

[in] - buffer size in bytes

Return

CUDBG_SUCCESS,

Return

CUDBG_ERROR_BUFFER_TOO_SMALL,

Return

CUDBG_ERROR_INVALID_ARGS,

Return

CUDBG_ERROR_UNINITIALIZED,

Return

CUDBG_ERROR_INITIALIZATION_FAILURE,

Return

CUDBG_ERROR_RECURSIVE_API_CALL

CUDBGResult (*getDevicePCIBusInfo)(uint32_t dev, uint32_t *pciBusId, uint32_t *pciDevId)

Get PCI bus and device ids associated with device index.

Since CUDA 5.5.

Param dev

[in] - device index

Param pciBusId

[out] - pointer where corresponding PCI BUS ID would be stored

Param pciDevId

[out] - pointer where corresponding PCI DEVICE ID would be stored

Return

CUDBG_SUCCESS,

Return

CUDBG_ERROR_INVALID_ARGS,

Return

CUDBG_ERROR_UNINITIALIZED,

Return

CUDBG_ERROR_INITIALIZATION_FAILURE,

Return

CUDBG_ERROR_RECURSIVE_API_CALL

CUDBGResult (*getDeviceType)(uint32_t dev, char *buf, uint32_t sz)

Get the string description of the device.

Returns CUDBG_ERROR_BUFFER_TOO_SMALL if the provided buffer is not large enough. This value is constant within a single session for a given device.

Since CUDA 3.0.

See also

getDeviceName

See also

getSMType

Param dev

[in] - device index

Param buf

[out] - the destination buffer

Param sz

[in] - buffer size in bytes

Return

CUDBG_SUCCESS,

Return

CUDBG_ERROR_BUFFER_TOO_SMALL,

Return

CUDBG_ERROR_INVALID_ARGS,

Return

CUDBG_ERROR_UNINITIALIZED,

Return

CUDBG_ERROR_INITIALIZATION_FAILURE,

Return

CUDBG_ERROR_RECURSIVE_API_CALL

CUDBGResult (*getElfImage)(uint32_t dev, uint32_t sm, uint32_t wp, bool relocated, void **elfImage, uint64_t *size)

Get the relocated or non-relocated ELF image and size for the grid on the given device.

Since CUDA 4.0.

Param dev

[in] - device index

Param sm

[in] - SM index

Param wp

[in] - warp index

Param relocated

[in] - set to true to specify the relocated ELF image, false otherwise

Param elfImage

[out] - pointer to the ELF image

Param size

[out] - size of the ELF image (64 bits)

Return

CUDBG_SUCCESS,

Return

CUDBG_ERROR_INVALID_ARGS,

Return

CUDBG_ERROR_UNINITIALIZED,

Return

CUDBG_ERROR_INTERNAL,

Return

CUDBG_ERROR_INVALID_WARP,

Return

CUDBG_ERROR_INITIALIZATION_FAILURE,

Return

CUDBG_ERROR_INVALID_GRID,

Return

CUDBG_ERROR_INVALID_CONTEXT,

Return

CUDBG_ERROR_RECURSIVE_API_CALL

CUDBGResult (*getElfImage32)(uint32_t dev, uint32_t sm, uint32_t wp, bool relocated, void **elfImage, uint32_t *size)

Get the relocated or non-relocated ELF image and size for the grid on the given device.

Behaves like getElfImage but will truncate the image size for cubins larger than 4GiB.

Since CUDA 3.0.

See also

getElfImage

Note

DEPRECATED in CUDA 4.0: Use getElfImage instead.

Param dev

[in] - device index

Param sm

[in] - SM index

Param wp

[in] - warp index

Param relocated

[in] - set to true to specify the relocated ELF image, false otherwise

Param elfImage

[out] - pointer to the ELF image

Param size

[out] - size of the ELF image (32 bits)

Return

CUDBG_SUCCESS,

Return

CUDBG_ERROR_INVALID_ARGS,

Return

CUDBG_ERROR_UNINITIALIZED,

Return

CUDBG_ERROR_INTERNAL,

Return

CUDBG_ERROR_INVALID_WARP,

Return

CUDBG_ERROR_INITIALIZATION_FAILURE,

Return

CUDBG_ERROR_INVALID_GRID,

Return

CUDBG_ERROR_INVALID_CONTEXT,

Return

CUDBG_ERROR_RECURSIVE_API_CALL

CUDBGResult (*getElfImageByHandle)(uint32_t dev, uint64_t handle, CUDBGElfImageType type, void *elfImage, uint64_t size)

Get the relocated or non-relocated ELF image for the given handle on the given device.

The handle is provided in the ELF Image Loaded notification event.

Since CUDA 6.0.

See also

getElfImage

Param dev

[in] - device index

Param handle

[in] - elf image handle

Param type

[in] - type of the requested ELF image

Param elfImage

[out] - pointer to the ELF image

Param elfImage_size

[in] - size of the ELF image

Return

CUDBG_SUCCESS,

Return

CUDBG_ERROR_INVALID_ARGS,

Return

CUDBG_ERROR_UNINITIALIZED,

Return

CUDBG_ERROR_INTERNAL,

Return

CUDBG_ERROR_INITIALIZATION_FAILURE,

Return

CUDBG_ERROR_RECURSIVE_API_CALL

CUDBGResult (*getErrorStringEx)(char *buf, uint32_t bufSz, uint32_t *msgSz)

Fills a user-provided buffer with an error message encoded as a null-terminated ASCII string.

The error message is specific to the last failed API call and is invalidated after every API method call except this one. It’s possible to query the size of the error message without reading it by passing 0 as buf and bufSz parameters. The msgSz parameter is optional unless 0 as passed in as buf and bufSz. CUDBG_ERROR_BUFFER_TOO_SMALL is returned when the passed in buffer is too small to contain the message.

Since CUDA 12.2.

Param buf

[out] - the destination buffer

Param bufSz

[in] - the size of the destination buffer in bytes

Param msgSz

[out] - the size of the written error message including the terminating null character.

Return

CUDBG_SUCCESS,

Return

CUDBG_ERROR_BUFFER_TOO_SMALL,

Return

CUDBG_ERROR_INVALID_ARGS,

Return

CUDBG_ERROR_UNINITIALIZED,

Return

CUDBG_ERROR_INTERNAL,

Return

CUDBG_ERROR_INITIALIZATION_FAILURE,

Return

CUDBG_ERROR_RECURSIVE_API_CALL

CUDBGResult (*getGridAttribute)(uint32_t dev, uint32_t sm, uint32_t wp, CUDBGAttribute attr, uint64_t *value)

Get the value of a grid attribute.

See CUDBGAttribute for the list of available attributes.

Since CUDA 3.1.

Param dev

[in] - device index

Param sm

[in] - SM index

Param wp

[in] - warp index

Param attr

[in] - the attribute

Param value

[out] - the returned value of the attribute

Return

CUDBG_SUCCESS,

Return

CUDBG_ERROR_INVALID_ARGS,

Return

CUDBG_ERROR_UNINITIALIZED,

Return

CUDBG_ERROR_INVALID_WARP,

Return

CUDBG_ERROR_INITIALIZATION_FAILURE,

Return

CUDBG_ERROR_INVALID_ATTRIBUTE,

Return

CUDBG_ERROR_INVALID_CONTEXT,

Return

CUDBG_ERROR_RECURSIVE_API_CALL

CUDBGResult (*getGridAttributes)(uint32_t dev, uint32_t sm, uint32_t wp, CUDBGAttributeValuePair *pairs, uint32_t numPairs)

Get several grid attribute values in a single API call.

See CUDBGAttribute for the list of available attributes.

Since CUDA 3.1.

See also

getGridAttribute

Param dev

[in] - device index

Param sm

[in] - SM index

Param wp

[in] - warp index

Param pairs

[out] - array of attribute/value pairs

Param numPairs

[in] - the number of attribute/values pairs in the array

Return

CUDBG_SUCCESS,

Return

CUDBG_ERROR_INVALID_ARGS,

Return

CUDBG_ERROR_UNINITIALIZED,

Return

CUDBG_ERROR_INVALID_WARP,

Return

CUDBG_ERROR_INITIALIZATION_FAILURE,

Return

CUDBG_ERROR_INVALID_ATTRIBUTE,

Return

CUDBG_ERROR_INVALID_CONTEXT,

Return

CUDBG_ERROR_RECURSIVE_API_CALL

CUDBGResult (*getGridDim)(uint32_t dev, uint32_t sm, uint32_t wp, CuDim3 *gridDim)

Get the dimensions in blocks of the given grid.

Since CUDA 4.0.

See also

getBlockDim

See also

getClusterDim

Param dev

[in] - device index

Param sm

[in] - SM index

Param wp

[in] - warp index

Param gridDim

[out] - the dimensions of the grid

Return

CUDBG_SUCCESS,

Return

CUDBG_ERROR_INVALID_ARGS,

Return

CUDBG_ERROR_UNINITIALIZED,

Return

CUDBG_ERROR_INTERNAL,

Return

CUDBG_ERROR_INVALID_WARP,

Return

CUDBG_ERROR_INITIALIZATION_FAILURE,

Return

CUDBG_ERROR_INVALID_CONTEXT,

Return

CUDBG_ERROR_RECURSIVE_API_CALL

CUDBGResult (*getGridDim32)(uint32_t dev, uint32_t sm, uint32_t wp, CuDim2 *gridDim)

Get the dimensions of the given grid.

Behaves like getGridDim but doesn’t return the z dimension.

Since CUDA 3.0.

See also

getGridDim

Note

DEPRECATED in CUDA 4.0: Use getGridDim instead.

Param dev

[in] - device index

Param sm

[in] - SM index

Param wp

[in] - warp index

Param gridDim

[out] - the returned number of blocks in the grid

Return

CUDBG_SUCCESS,

Return

CUDBG_ERROR_INVALID_ARGS,

Return

CUDBG_ERROR_UNINITIALIZED,

Return

CUDBG_ERROR_INTERNAL,

Return

CUDBG_ERROR_INVALID_WARP,

Return

CUDBG_ERROR_INITIALIZATION_FAILURE,

Return

CUDBG_ERROR_INVALID_CONTEXT,

Return

CUDBG_ERROR_RECURSIVE_API_CALL

CUDBGResult (*getGridInfo)(uint32_t dev, uint64_t gridId64, CUDBGGridInfo *gridInfo)

Get information about the specified grid.

Returns CUDBG_ERROR_INVALID_GRID if the context of the grid has already been destroyed (even if grid ID itself is correct).

Since CUDA 12.7.

Param dev

[in] - device index

Param gridId

[in] - grid ID for which information is to be collected

Param gridInfo

[out] - pointer to a client allocated structure in which grid info will be returned

Return

CUDBG_SUCCESS,

Return

CUDBG_ERROR_INVALID_ARGS,

Return

CUDBG_ERROR_UNINITIALIZED,

Return

CUDBG_ERROR_INTERNAL,

Return

CUDBG_ERROR_INITIALIZATION_FAILURE,

Return

CUDBG_ERROR_INVALID_GRID,

Return

CUDBG_ERROR_INVALID_CONTEXT,

Return

CUDBG_ERROR_RECURSIVE_API_CALL

CUDBGResult (*getGridInfo120)(uint32_t dev, uint64_t gridId64, CUDBGGridInfo120 *gridInfo)

Get information about the specified grid.

Behaves like getGridInfo, but returns less information. Returns CUDBG_ERROR_INVALID_GRID if the context of the grid has already been destroyed (even if grid ID itself is correct).

Since CUDA 12.0.

See also

getGridInfo

Note

DEPRECATED in CUDA 12.7: Use getGridInfo instead.

Param dev

[in] - device index

Param gridId

[in] - grid ID for which information is to be collected

Param gridInfo

[out] - pointer to a client allocated structure in which grid info will be returned

Return

CUDBG_SUCCESS,

Return

CUDBG_ERROR_INVALID_ARGS,

Return

CUDBG_ERROR_UNINITIALIZED,

Return

CUDBG_ERROR_INTERNAL,

Return

CUDBG_ERROR_INITIALIZATION_FAILURE,

Return

CUDBG_ERROR_INVALID_GRID,

Return

CUDBG_ERROR_INVALID_CONTEXT,

Return

CUDBG_ERROR_RECURSIVE_API_CALL

CUDBGResult (*getGridInfo55)(uint32_t dev, uint64_t gridId64, CUDBGGridInfo55 *gridInfo)

Get information about the specified grid.

Behaves like getGridInfo, but returns less information. Returns CUDBG_ERROR_INVALID_GRID if the context of the grid has already been destroyed (even if grid ID itself is correct).

Since CUDA 5.5.

See also

getGridInfo

Note

DEPRECATED in CUDA 12.0: Use getGridInfo instead.

Param dev

[in] - device index

Param gridId

[in] - grid ID for which information is to be collected

Param gridInfo

[out] - pointer to a client allocated structure in which grid info will be returned

Return

CUDBG_SUCCESS,

Return

CUDBG_ERROR_INVALID_ARGS,

Return

CUDBG_ERROR_UNINITIALIZED,

Return

CUDBG_ERROR_INTERNAL,

Return

CUDBG_ERROR_INITIALIZATION_FAILURE,

Return

CUDBG_ERROR_INVALID_GRID,

Return

CUDBG_ERROR_INVALID_CONTEXT,

Return

CUDBG_ERROR_RECURSIVE_API_CALL

CUDBGResult (*getGridStatus)(uint32_t dev, uint64_t gridId64, CUDBGGridStatus *status)

Check whether the grid corresponding to the ID is still present on the device.

Since CUDA 5.5.

Param dev

[in] - device index

Param gridId64

[in] - 64-bit grid ID

Param status

[out] - enum indicating the grid status

Return

CUDBG_SUCCESS,

Return

CUDBG_ERROR_INVALID_ARGS,

Return

CUDBG_ERROR_UNINITIALIZED,

Return

CUDBG_ERROR_INTERNAL,

Return

CUDBG_ERROR_INITIALIZATION_FAILURE,

Return

CUDBG_ERROR_RECURSIVE_API_CALL

CUDBGResult (*getGridStatus50)(uint32_t dev, uint32_t gridId, CUDBGGridStatus *status)

Check whether the grid corresponding to the ID is still present on the device.

Behaves like getGridStatus, but takes a 32-bit grid ID instead of a 64-bit one.

Since CUDA 5.0.

See also

getGridStatus

Note

DEPRECATED in CUDA 5.5: Use getGridStatus instead.

Param dev

[in] - device index

Param gridId

[in] - grid ID

Param status

[out] - enum indicating the grid status

Return

CUDBG_SUCCESS,

Return

CUDBG_ERROR_INVALID_ARGS,

Return

CUDBG_ERROR_UNINITIALIZED,

Return

CUDBG_ERROR_INTERNAL,

Return

CUDBG_ERROR_INITIALIZATION_FAILURE,

Return

CUDBG_ERROR_RECURSIVE_API_CALL

CUDBGResult (*getHardwareBarrierInfo)(uint32_t dev, uint32_t sm, uint32_t wp, uint32_t ln, CUDBGBarrierScope *scope, char *buf, uint32_t bufSz, uint32_t *msgSz)

Get hardware barrier information.

Since CUDA 13.1.

Param dev

[in] - device index

Param sm

[in] - SM index

Param wp

[in] - warp index

Param ln

[in] - lane index

Param scope

[out] - barrier scope

Param buf

[out] - buffer for the barrier information

Param bufSz

[in] - buffer size

Param msgSz

[out] - error message size with null character, can be null

Return

CUDBG_SUCCESS,

Return

CUDBG_ERROR_BUFFER_TOO_SMALL,

Return

CUDBG_ERROR_INVALID_ARGS,

Return

CUDBG_ERROR_UNINITIALIZED,

Return

CUDBG_ERROR_INTERNAL,

Return

CUDBG_ERROR_INVALID_WARP,

Return

CUDBG_ERROR_INITIALIZATION_FAILURE,

Return

CUDBG_ERROR_INVALID_CONTEXT,

Return

CUDBG_ERROR_RECURSIVE_API_CALL

CUDBGResult (*getHostAddrFromDeviceAddr)(uint32_t dev, uint64_t device_addr, uint64_t *host_addr)

Given a device virtual address, return a corresponding system memory virtual address.

Since CUDA 4.1.

Param dev

[in] - device index

Param device_addr

[in] - device memory address

Param host_addr

[out] - returned system memory address

Return

CUDBG_SUCCESS,

Return

CUDBG_ERROR_INVALID_ARGS,

Return

CUDBG_ERROR_UNINITIALIZED,

Return

CUDBG_ERROR_INVALID_MEMORY_SEGMENT,

Return

CUDBG_ERROR_INITIALIZATION_FAILURE,

Return

CUDBG_ERROR_INVALID_CONTEXT,

Return

CUDBG_ERROR_RECURSIVE_API_CALL

CUDBGResult (*getLoadedFunctionInfo)(uint32_t dev, uint64_t handle, CUDBGLoadedFunctionInfo *info, uint32_t startIndex, uint32_t numEntries)

Get the section number and address of loaded functions for a given module.

If the CUDBG_DEBUGGER_CAPABILITY_LAZY_FUNCTION_LOADING capability is enabled, CUDA loads functions lazily after the module has been reported. This method could be used to get the lazily loaded functions.

Since CUDA 12.3.

Param dev

[in] - device index

Param handle

[in] - ELF/cubin image handle

Param info

[out] - information about loaded functions

Param startIndex

[in] - start index of the entries to get

Param numEntries

[in] - number of function load entries to read

Return

CUDBG_SUCCESS,

Return

CUDBG_ERROR_INVALID_ARGS,

Return

CUDBG_ERROR_UNINITIALIZED,

Return

CUDBG_ERROR_INTERNAL,

Return

CUDBG_ERROR_INITIALIZATION_FAILURE,

Return

CUDBG_ERROR_RECURSIVE_API_CALL

CUDBGResult (*getLoadedFunctionInfo118)(uint32_t dev, uint64_t handle, CUDBGLoadedFunctionInfo *info, uint32_t numEntries)

Get the section number and address of loaded functions for a given module.

Behaves like getLoadedFunctionInfo but doesn’t allow querying a subset of all lazily loaded functions.

Since CUDA 11.8.

Note

DEPRECATED in CUDA 12.3: Use getLoadedFunctionInfo instead.

Param dev

[in] - device index

Param handle

[in] - ELF/cubin image handle

Param info

[out] - information about loaded functions

Param numEntries

[in] - number of function load entries to read

Return

CUDBG_SUCCESS,

Return

CUDBG_ERROR_INVALID_ARGS,

Return

CUDBG_ERROR_UNINITIALIZED,

Return

CUDBG_ERROR_INTERNAL,

Return

CUDBG_ERROR_INITIALIZATION_FAILURE,

Return

CUDBG_ERROR_RECURSIVE_API_CALL

CUDBGResult (*getManagedMemoryRegionInfo)(uint64_t startAddress, CUDBGMemoryInfo *memoryInfo, uint32_t memoryInfo_size, uint32_t *numEntries)

Get a sorted list of managed memory regions.

The sorted list of memory regions starts from a region containing the specified starting address. If the starting address is set to 0, a sorted list of managed memory regions is returned which starts from the managed memory region with the lowest start address.

Since CUDA 6.0.

Param startAddress

[in] - the address that the first region in the list must contain

Param memoryInfo

[out] - client-allocated array of memory region records of type CUDBGMemoryInfo

Param memoryInfo_size

[in] - number of records of type CUDBGMemoryInfo that memoryInfo can hold

Param numEntries

[out] - pointer to a client-allocated variable holding the number of valid entries returned in memoryInfo

Return

CUDBG_SUCCESS,

Return

CUDBG_ERROR_INVALID_ARGS,

Return

CUDBG_ERROR_UNINITIALIZED,

Return

CUDBG_ERROR_INTERNAL,

Return

CUDBG_ERROR_INITIALIZATION_FAILURE,

Return

CUDBG_ERROR_RECURSIVE_API_CALL

CUDBGResult (*getNextAsyncEvent50)(CUDBGEvent50 *event)

Copies the next available event in the asynchronous event queue into ‘event’ and removes it from the queue.

Behaves like getNextEvent but only for ASYNC events and doesn’t support the latest event struct format so some fields won’t be available.

Since CUDA 5.0.

See also

getNextEvent

Note

DEPRECATED in CUDA 5.5: Use getNextEvent instead.

Param event

[out] - pointer to an event container where to copy the event parameters

Return

CUDBG_SUCCESS,

Return

CUDBG_ERROR_INVALID_ARGS,

Return

CUDBG_ERROR_UNINITIALIZED,

Return

CUDBG_ERROR_INTERNAL,

Return

CUDBG_ERROR_INITIALIZATION_FAILURE,

Return

CUDBG_ERROR_NO_EVENT_AVAILABLE,

Return

CUDBG_ERROR_INVALID_CONTEXT

CUDBGResult (*getNextAsyncEvent55)(CUDBGEvent55 *event)

Copies the next available event in the asynchronous event queue into ‘event’ and removes it from the queue.

Behaves like getNextEvent but only for ASYNC events and doesn’t support the latest event struct format so some fields won’t be available.

Since CUDA 5.5.

See also

getNextEvent

Note

DEPRECATED in CUDA 6.0: Use getNextEvent instead.

Param event

[out] - pointer to an event container where to copy the event parameters

Return

CUDBG_SUCCESS,

Return

CUDBG_ERROR_INVALID_ARGS,

Return

CUDBG_ERROR_UNINITIALIZED,

Return

CUDBG_ERROR_INTERNAL,

Return

CUDBG_ERROR_INITIALIZATION_FAILURE,

Return

CUDBG_ERROR_NO_EVENT_AVAILABLE,

Return

CUDBG_ERROR_INVALID_CONTEXT

CUDBGResult (*getNextEvent)(CUDBGEventQueueType type, CUDBGEvent *event)

Copies the next available event into ‘event’ and removes it from the queue.

CUDBG_ERROR_NO_EVENT_AVAILABLE is returned if the queue is empty. ASYNC and SYNC queues are separate and each one is ordered separately, but it’s impossible to find out the relative order of ASYNC and SYNC events.

Since CUDA 6.0.

Param type

[in] - application event queue type

Param event

[out] - pointer to an event container where to copy the event parameters

Return

CUDBG_SUCCESS,

Return

CUDBG_ERROR_INVALID_ARGS,

Return

CUDBG_ERROR_UNINITIALIZED,

Return

CUDBG_ERROR_INITIALIZATION_FAILURE,

Return

CUDBG_ERROR_NO_EVENT_AVAILABLE

CUDBGResult (*getNextEvent30)(CUDBGEvent30 *event)

Copies the next available event in the event queue into ‘event’ and removes it from the queue.

Behaves like getNextEvent but only for SYNC events and doesn’t support the latest event struct format so some fields won’t be available.

Since CUDA 3.0.

See also

getNextEvent

Note

DEPRECATED in CUDA 3.1: Use getNextEvent instead.

Param event

[out] - pointer to an event container where to copy the event parameters

Return

CUDBG_SUCCESS,

Return

CUDBG_ERROR_INVALID_ARGS,

Return

CUDBG_ERROR_UNINITIALIZED,

Return

CUDBG_ERROR_INTERNAL,

Return

CUDBG_ERROR_INITIALIZATION_FAILURE,

Return

CUDBG_ERROR_NO_EVENT_AVAILABLE,

Return

CUDBG_ERROR_INVALID_CONTEXT

CUDBGResult (*getNextEvent32)(CUDBGEvent32 *event)

Copies the next available event in the event queue into ‘event’ and removes it from the queue.

Behaves like getNextEvent but only for SYNC events and doesn’t support the latest event struct format so some fields won’t be available.

Since CUDA 3.1.

See also

getNextEvent

Note

DEPRECATED in CUDA 4.0: Use getNextEvent instead.

Param event

[out] - pointer to an event container where to copy the event parameters

Return

CUDBG_SUCCESS,

Return

CUDBG_ERROR_INVALID_ARGS,

Return

CUDBG_ERROR_UNINITIALIZED,

Return

CUDBG_ERROR_INTERNAL,

Return

CUDBG_ERROR_INITIALIZATION_FAILURE,

Return

CUDBG_ERROR_NO_EVENT_AVAILABLE,

Return

CUDBG_ERROR_INVALID_CONTEXT

CUDBGResult (*getNextEvent42)(CUDBGEvent42 *event)

Copies the next available event in the event queue into ‘event’ and removes it from the queue.

Behaves like getNextEvent but only for SYNC events and doesn’t support the latest event struct format so some fields won’t be available.

Since CUDA 4.0.

See also

getNextEvent

Note

DEPRECATED in CUDA 5.0: Use getNextEvent instead.

Param event

[out] - pointer to an event container where to copy the event parameters

Return

CUDBG_SUCCESS,

Return

CUDBG_ERROR_INVALID_ARGS,

Return

CUDBG_ERROR_UNINITIALIZED,

Return

CUDBG_ERROR_INTERNAL,

Return

CUDBG_ERROR_INITIALIZATION_FAILURE,

Return

CUDBG_ERROR_NO_EVENT_AVAILABLE,

Return

CUDBG_ERROR_INVALID_CONTEXT

CUDBGResult (*getNextSyncEvent50)(CUDBGEvent50 *event)

Copies the next available event in the synchronous event queue into ‘event’ and removes it from the queue.

Behaves like getNextEvent but only for SYNC events and doesn’t support the latest event struct format so some fields won’t be available.

Since CUDA 5.0.

See also

getNextEvent

Note

DEPRECATED in CUDA 5.5: Use getNextEvent instead.

Param event

[out] - pointer to an event container where to copy the event parameters

Return

CUDBG_SUCCESS,

Return

CUDBG_ERROR_INVALID_ARGS,

Return

CUDBG_ERROR_UNINITIALIZED,

Return

CUDBG_ERROR_INTERNAL,

Return

CUDBG_ERROR_INITIALIZATION_FAILURE,

Return

CUDBG_ERROR_NO_EVENT_AVAILABLE,

Return

CUDBG_ERROR_INVALID_CONTEXT

CUDBGResult (*getNextSyncEvent55)(CUDBGEvent55 *event)

Copies the next available event in the synchronous event queue into ‘event’ and removes it from the queue.

Behaves like getNextEvent but only for SYNC events and doesn’t support the latest event struct format so some fields won’t be available.

Since CUDA 5.5.

See also

getNextEvent

Note

DEPRECATED in CUDA 6.0: Use getNextEvent instead.

Param event

[out] - pointer to an event container where to copy the event parameters

Return

CUDBG_SUCCESS,

Return

CUDBG_ERROR_INVALID_ARGS,

Return

CUDBG_ERROR_UNINITIALIZED,

Return

CUDBG_ERROR_INTERNAL,

Return

CUDBG_ERROR_INITIALIZATION_FAILURE,

Return

CUDBG_ERROR_NO_EVENT_AVAILABLE,

Return

CUDBG_ERROR_INVALID_CONTEXT

CUDBGResult (*getNumDevices)(uint32_t *numDev)

Get the number of installed CUDA devices.

This value is constant within a single session.

Since CUDA 3.0.

See also

getNumLanes

See also

getNumPredicates

See also

getNumRegisters

See also

getNumSMs

See also

getNumWarps

Param numDev

[out] - the returned number of devices

Return

CUDBG_SUCCESS,

Return

CUDBG_ERROR_INVALID_ARGS,

Return

CUDBG_ERROR_UNINITIALIZED,

Return

CUDBG_ERROR_INITIALIZATION_FAILURE,

Return

CUDBG_ERROR_RECURSIVE_API_CALL

CUDBGResult (*getNumLanes)(uint32_t dev, uint32_t *numLanes)

Get the number of lanes per warp on the device.

This value is constant within a single session for a given device.

Since CUDA 3.0.

See also

getNumDevices

See also

getNumPredicates

See also

getNumRegisters

See also

getNumSMs

See also

getNumWarps

Param dev

[in] - device index

Param numLanes

[out] - the returned number of lanes

Return

CUDBG_SUCCESS,

Return

CUDBG_ERROR_INVALID_ARGS,

Return

CUDBG_ERROR_UNINITIALIZED,

Return

CUDBG_ERROR_INITIALIZATION_FAILURE,

Return

CUDBG_ERROR_RECURSIVE_API_CALL

CUDBGResult (*getNumPredicates)(uint32_t dev, uint32_t *numPredicates)

Get the number of predicate registers per lane on the device.

This value is constant within a single session for a given device.

Since CUDA 6.5.

See also

getNumDevices

See also

getNumLanes

See also

getNumRegisters

See also

getNumSMs

See also

getNumWarps

Param dev

[in] - device index

Param numPredicates

[out] - the returned number of predicate registers

Return

CUDBG_SUCCESS,

Return

CUDBG_ERROR_INVALID_ARGS,

Return

CUDBG_ERROR_UNINITIALIZED,

Return

CUDBG_ERROR_INITIALIZATION_FAILURE,

Return

CUDBG_ERROR_RECURSIVE_API_CALL

CUDBGResult (*getNumRegisters)(uint32_t dev, uint32_t *numRegs)

Get the maximum number of registers per lane on the device.

This value is constant within a single session for a given device. Note that the actual number of registers can change per warp, use readWarpResources() to query that number dynamically.

Since CUDA 3.0.

See also

getNumDevices

See also

getNumLanes

See also

getNumPredicates

See also

getNumSMs

See also

getNumWarps

Param dev

[in] - device index

Param numRegs

[out] - the returned number of registers

Return

CUDBG_SUCCESS,

Return

CUDBG_ERROR_INVALID_ARGS,

Return

CUDBG_ERROR_UNINITIALIZED,

Return

CUDBG_ERROR_INITIALIZATION_FAILURE,

Return

CUDBG_ERROR_RECURSIVE_API_CALL

CUDBGResult (*getNumSMs)(uint32_t dev, uint32_t *numSMs)

Get the total number of SMs on the device.

This value is constant within a single session for a given device.

Since CUDA 3.0.

See also

getNumDevices

See also

getNumLanes

See also

getNumPredicates

See also

getNumRegisters

See also

getNumWarps

Param dev

[in] - device index

Param numSMs

[out] - the returned number of SMs

Return

CUDBG_SUCCESS,

Return

CUDBG_ERROR_INVALID_ARGS,

Return

CUDBG_ERROR_UNINITIALIZED,

Return

CUDBG_ERROR_INITIALIZATION_FAILURE,

Return

CUDBG_ERROR_RECURSIVE_API_CALL

CUDBGResult (*getNumUniformPredicates)(uint32_t dev, uint32_t *numPredicates)

Get the number of uniform predicate registers per warp on the device.

This value is constant within a single session for a given device.

Since CUDA 10.0.

See also

getNumDevices

See also

getNumLanes

See also

getNumPredicates

See also

getNumRegisters

See also

getNumSMs

See also

getNumWarps

Param dev

[in] - device index

Param numPredicates

[out] - the returned number of uniform predicate registers

Return

CUDBG_SUCCESS,

Return

CUDBG_ERROR_INVALID_ARGS,

Return

CUDBG_ERROR_UNINITIALIZED,

Return

CUDBG_ERROR_INITIALIZATION_FAILURE,

Return

CUDBG_ERROR_RECURSIVE_API_CALL

CUDBGResult (*getNumUniformRegisters)(uint32_t dev, uint32_t *numRegs)

Get the number of uniform registers per warp on the device.

This value is constant within a single session for a given device.

Since CUDA 10.0.

See also

getNumDevices

See also

getNumLanes

See also

getNumPredicates

See also

getNumRegisters

See also

getNumSMs

See also

getNumWarps

Param dev

[in] - device index

Param numRegs

[out] - the returned number of uniform registers

Return

CUDBG_SUCCESS,

Return

CUDBG_ERROR_INVALID_ARGS,

Return

CUDBG_ERROR_UNINITIALIZED,

Return

CUDBG_ERROR_INITIALIZATION_FAILURE,

Return

CUDBG_ERROR_RECURSIVE_API_CALL

CUDBGResult (*getNumWarps)(uint32_t dev, uint32_t *numWarps)

Get the number of warps per SM on the device.

This value is constant within a single session for a given device.

Since CUDA 3.0.

See also

getNumDevices

See also

getNumLanes

See also

getNumPredicates

See also

getNumRegisters

See also

getNumSMs

Param dev

[in] - device index

Param numWarps

[out] - the returned number of warps

Return

CUDBG_SUCCESS,

Return

CUDBG_ERROR_INVALID_ARGS,

Return

CUDBG_ERROR_UNINITIALIZED,

Return

CUDBG_ERROR_INITIALIZATION_FAILURE,

Return

CUDBG_ERROR_RECURSIVE_API_CALL

CUDBGResult (*getPhysicalRegister30)(uint64_t pc, char *reg, uint32_t *buf, uint32_t sz, uint32_t *numPhysRegs, CUDBGRegClass *regClass)

Get the physical register number(s) assigned to a virtual register name at a given PC, if it’s live at that PC.

Since CUDA 3.0.

Note

DEPRECATED in CUDA 3.1: Do not use.

Param pc

[in] - Program counter

Param reg

[in] - virtual register index

Param buf

[out] - physical register name(s)

Param sz

[in] - the physical register name buffer size

Param numPhysRegs

[out] - number of physical register names returned

Param regClass

[out] - the class of the physical registers

Return

CUDBG_SUCCESS,

Return

CUDBG_ERROR_BUFFER_TOO_SMALL,

Return

CUDBG_ERROR_UNKNOWN_FUNCTION,

Return

CUDBG_ERROR_INVALID_ARGS,

Return

CUDBG_ERROR_UNINITIALIZED,

Return

CUDBG_ERROR_INTERNAL,

Return

CUDBG_ERROR_INITIALIZATION_FAILURE,

Return

CUDBG_ERROR_INVALID_CONTEXT,

Return

CUDBG_ERROR_RECURSIVE_API_CALL

CUDBGResult (*getPhysicalRegister40)(uint32_t dev, uint32_t sm, uint32_t wp, uint64_t pc, char *reg, uint32_t *buf, uint32_t sz, uint32_t *numPhysRegs, CUDBGRegClass *regClass)

Get the physical register number(s) assigned to a virtual register name at a given PC, if it’s live at that PC.

Instead, the PTX to SASS mappings can be read from the cubin directly.

Since CUDA 3.1.

Note

DEPRECATED in CUDA 4.1: Do not use.

Param dev

[in] - device index

Param sm

[in] - SM index

Param wp

[in] - warp index

Param pc

[in] - Program counter

Param reg

[in] - virtual register index

Param buf

[out] - physical register name(s)

Param sz

[in] - the physical register name buffer size

Param numPhysRegs

[out] - number of physical register names returned

Param regClass

[out] - the class of the physical registers

Return

CUDBG_SUCCESS,

Return

CUDBG_ERROR_BUFFER_TOO_SMALL,

Return

CUDBG_ERROR_UNKNOWN_FUNCTION,

Return

CUDBG_ERROR_INVALID_ARGS,

Return

CUDBG_ERROR_UNINITIALIZED,

Return

CUDBG_ERROR_INTERNAL,

Return

CUDBG_ERROR_INITIALIZATION_FAILURE,

Return

CUDBG_ERROR_INVALID_CONTEXT,

Return

CUDBG_ERROR_RECURSIVE_API_CALL

CUDBGResult (*getSmType)(uint32_t dev, char *buf, uint32_t sz)

Get the SM type of the device.

Returns CUDBG_ERROR_BUFFER_TOO_SMALL if the provided buffer is not large enough. This value is constant within a single session for a given device.

Since CUDA 3.0.

See also

getDeviceName

See also

getDeviceType

Param dev

[in] - device index

Param buf

[out] - the destination buffer

Param sz

[in] - buffer size in bytes

Return

CUDBG_SUCCESS,

Return

CUDBG_ERROR_BUFFER_TOO_SMALL,

Return

CUDBG_ERROR_INVALID_ARGS,

Return

CUDBG_ERROR_UNINITIALIZED,

Return

CUDBG_ERROR_INITIALIZATION_FAILURE,

Return

CUDBG_ERROR_RECURSIVE_API_CALL

CUDBGResult (*getSupportedDebuggerCapabilities)(CUDBGCapabilityFlags *capabilities)

Returns debug agent capabilities that are supported by this version of the API.

This API method can be called without initializing the API.

Since CUDA 12.5.

Param capabilities

[out] - returned debug engine capabilities

Return

CUDBG_SUCCESS,

Return

CUDBG_ERROR_INVALID_ARGS,

Return

CUDBG_ERROR_INITIALIZATION_FAILURE,

Return

CUDBG_ERROR_RECURSIVE_API_CALL

CUDBGResult (*getTID)(uint32_t dev, uint32_t sm, uint32_t wp, uint32_t *tid)

Get the ID of the Linux thread hosting the CUDA context active at the given coordinates.

This returns a Linux thread ID.

Since CUDA 3.0.

Param dev

[in] - device index

Param sm

[in] - SM index

Param wp

[in] - warp index

Param tid

[out] - the returned thread id

Return

CUDBG_SUCCESS,

Return

CUDBG_ERROR_INVALID_ARGS,

Return

CUDBG_ERROR_UNINITIALIZED,

Return

CUDBG_ERROR_INVALID_WARP,

Return

CUDBG_ERROR_INITIALIZATION_FAILURE,

Return

CUDBG_ERROR_INVALID_CONTEXT,

Return

CUDBG_ERROR_RECURSIVE_API_CALL

CUDBGResult (*getWarpHitBreakpoint)(uint32_t dev, uint32_t sm, uint32_t wp, CUDBGBreakpointHandle *handle)

Get the handle of the breakpoint that the given warp hit.

An error is returned if the warp did not hit a breakpoint. Use readBrokenWarps() to check if the warp is broken before calling this method. Some breakpoint handles are special, see the documentation of CUDBGBreakpointHandle for more details.

Since CUDA 13.2.

See also

enableBreakpoint

See also

insertBreakpoint

See also

readBrokenWarps

See also

removeBreakpoint

Param dev

[in] - device index

Param sm

[in] - SM index

Param wp

[in] - warp index

Param handle

[out] - the returned breakpoint handle

Return

CUDBG_SUCCESS,

Return

CUDBG_ERROR_INVALID_ARGS,

Return

CUDBG_ERROR_UNINITIALIZED,

Return

CUDBG_ERROR_INTERNAL,

Return

CUDBG_ERROR_INVALID_WARP,

Return

CUDBG_ERROR_INITIALIZATION_FAILURE,

Return

CUDBG_ERROR_INVALID_CONTEXT,

Return

CUDBG_ERROR_RECURSIVE_API_CALL

CUDBGResult (*initialize)(void)

Initialize the API.

setNotifyNewEventCallback() and getSupportedDebuggerCapabilities() can be called before initialize(). If no CUDA devices are detected on the system, CUDBG_ERROR_NO_DEVICE_AVAILABLE is returned.

Since CUDA 3.0.

See also

finalize

Return

CUDBG_SUCCESS,

Return

CUDBG_ERROR_INITIALIZATION_FAILURE,

Return

CUDBG_ERROR_NO_DEVICE_AVAILABLE

CUDBGResult (*initializeAttachStub)(void)

Initialize the attach stub.

This is no longer necessary starting with driver version r590.

Since CUDA 5.0.

Return

CUDBG_SUCCESS

CUDBGResult (*insertBreakpoint)(uint32_t dev, uint64_t addr, CUDBGBreakpointHandle *handle)

Set a breakpoint at the given instruction address for the given device.

Before setting a breakpoint, getAdjustedCodeAddress() should be called to get the adjusted breakpoint address. The returned handle can be used to enable/disable/remove the breakpoint.

Since CUDA 13.2.

See also

enableBreakpoint

See also

removeBreakpoint

Param dev

[in] - the device index

Param addr

[in] - instruction address

Param handle

[out] - the returned breakpoint handle

Return

CUDBG_SUCCESS,

Return

CUDBG_ERROR_INVALID_ARGS,

Return

CUDBG_ERROR_UNINITIALIZED,

Return

CUDBG_ERROR_INTERNAL,

Return

CUDBG_ERROR_INVALID_ADDRESS,

Return

CUDBG_ERROR_INITIALIZATION_FAILURE,

Return

CUDBG_ERROR_RECURSIVE_API_CALL,

Return

CUDBG_ERROR_BREAKPOINT_STATE_CONFLICT

CUDBGResult (*isBreakpointEnabled)(CUDBGBreakpointHandle handle, uint32_t *enabled)

Check if a breakpoint specified by its handle is enabled.

The breakpoint enablement state is never implicitly modified by the API implementation; the API user must always enable or disable them manually. Prior to CUDA 13.4, an error is returned if the CUDBG_BREAKPOINT_HANDLE_BREAK_ON_LAUNCH handle is provided.

Since CUDA 13.2.

See also

enableBreakpoint

See also

insertBreakpoint

See also

removeBreakpoint

Param handle

[in] - the breakpoint handle.

Param enabled

[out] - whether the breakpoint is enabled

Return

CUDBG_SUCCESS,

Return

CUDBG_ERROR_INVALID_ARGS,

Return

CUDBG_ERROR_UNINITIALIZED,

Return

CUDBG_ERROR_INTERNAL,

Return

CUDBG_ERROR_INITIALIZATION_FAILURE,

Return

CUDBG_ERROR_RECURSIVE_API_CALL

CUDBGResult (*isDeviceCodeAddress)(uintptr_t addr, bool *isDeviceAddress)

Determine whether a virtual address resides within device code.

Since CUDA 3.0.

Param addr

[in] - virtual address

Param isDeviceAddress

[out] - true if address resides within device code

Return

CUDBG_SUCCESS,

Return

CUDBG_ERROR_INVALID_ARGS,

Return

CUDBG_ERROR_UNINITIALIZED,

Return

CUDBG_ERROR_INTERNAL,

Return

CUDBG_ERROR_INITIALIZATION_FAILURE,

Return

CUDBG_ERROR_RECURSIVE_API_CALL

CUDBGResult (*isDeviceCodeAddress55)(uintptr_t addr, bool *isDeviceAddress)

Determine whether a virtual address resides within device code.

Behaves exactly like isDeviceCodeAddress.

Since CUDA 3.0.

Note

DEPRECATED in CUDA 6.0: Use isDeviceCodeAddress instead.

Param addr

[in] - virtual address

Param isDeviceAddress

[out] - true if address resides within device code

Return

CUDBG_SUCCESS,

Return

CUDBG_ERROR_INVALID_ARGS,

Return

CUDBG_ERROR_UNINITIALIZED,

Return

CUDBG_ERROR_INTERNAL,

Return

CUDBG_ERROR_INITIALIZATION_FAILURE,

Return

CUDBG_ERROR_RECURSIVE_API_CALL

CUDBGResult (*lookupDeviceCodeSymbol)(char *symName, bool *symFound, uintptr_t *symAddr)

Determines whether a symbol represents a function in device code and returns its virtual address.

Since CUDA 3.0.

Param symName

[in] - symbol name

Param symFound

[out] - set to true if the symbol is found

Param symAddr

[out] - the symbol virtual address if found

Return

CUDBG_SUCCESS,

Return

CUDBG_ERROR_UNKNOWN_FUNCTION,

Return

CUDBG_ERROR_INVALID_ARGS,

Return

CUDBG_ERROR_UNINITIALIZED,

Return

CUDBG_ERROR_INTERNAL,

Return

CUDBG_ERROR_INITIALIZATION_FAILURE,

Return

CUDBG_ERROR_RECURSIVE_API_CALL

CUDBGResult (*memcheckReadErrorAddress)(uint32_t dev, uint32_t sm, uint32_t wp, uint32_t ln, uint64_t *address, ptxStorageKind *storage)

Get the address that memcheck detected an error on.

Will always return CUDBG_ERROR_NOT_SUPPORTED.

Since CUDA 5.0.

Note

DEPRECATED in CUDA 12.0: Do not use.

Param dev

[in] - device index

Param sm

[in] - SM index

Param wp

[in] - warp index

Param ln

[in] - lane index

Param address

[out] - returned address detected by memcheck

Param storage

[out] - returned address class of address

Return

CUDBG_ERROR_INVALID_ARGS,

Return

CUDBG_ERROR_UNINITIALIZED,

Return

CUDBG_ERROR_INITIALIZATION_FAILURE,

Return

CUDBG_ERROR_RECURSIVE_API_CALL,

Return

CUDBG_ERROR_NOT_SUPPORTED

CUDBGResult (*readActiveLanes)(uint32_t dev, uint32_t sm, uint32_t wp, uint32_t *activeLanesMask)

Read the lane bitmask of active threads on a valid warp.

Since CUDA 3.0.

See also

readBlockIdx

See also

readBrokenWarps

See also

readGridId

See also

readThreadIdx

See also

readValidLanes

See also

readValidWarps

Param dev

[in] - device index

Param sm

[in] - SM index

Param wp

[in] - warp index

Param activeLanesMask

[out] - the returned bitmask of active threads

Return

CUDBG_SUCCESS,

Return

CUDBG_ERROR_INVALID_ARGS,

Return

CUDBG_ERROR_UNINITIALIZED,

Return

CUDBG_ERROR_INVALID_WARP,

Return

CUDBG_ERROR_INITIALIZATION_FAILURE,

Return

CUDBG_ERROR_INVALID_CONTEXT,

Return

CUDBG_ERROR_RECURSIVE_API_CALL

CUDBGResult (*readAllVirtualReturnAddresses)(uint32_t dev, uint32_t sm, uint32_t wp, uint32_t ln, uint64_t *addrs, uint32_t numAddrs, uint32_t *callDepth, uint32_t *syscallCallDepth)

Read all the virtual return addresses for a thread (the full backtrace).

Note that syscallCallDepth is always set to 0.

Since CUDA 12.5.

See also

readCallDepth

Param dev

[in] - device index

Param sm

[in] - SM index

Param wp

[in] - warp index

Param ln

[in] - lane index

Param addrs

[out] - the returned addresses array

Param numAddrs

[in] - number of elements in addrs array

Param callDepth

[out] - the returned call depth

Param syscallCallDepth

[out] - the returned syscall call depth

Return

CUDBG_SUCCESS,

Return

CUDBG_ERROR_INVALID_ARGS,

Return

CUDBG_ERROR_UNINITIALIZED,

Return

CUDBG_ERROR_INTERNAL,

Return

CUDBG_ERROR_INVALID_WARP,

Return

CUDBG_ERROR_INITIALIZATION_FAILURE,

Return

CUDBG_ERROR_INVALID_CONTEXT,

Return

CUDBG_ERROR_RECURSIVE_API_CALL

CUDBGResult (*readBlockIdx)(uint32_t dev, uint32_t sm, uint32_t wp, CuDim3 *blockIdx)

Read the CUDA block index running on a valid warp.

Since CUDA 4.0.

See also

readActiveLanes

See also

readBrokenWarps

See also

readGridId

See also

readThreadIdx

See also

readValidLanes

See also

readValidWarps

Param dev

[in] - device index

Param sm

[in] - SM index

Param wp

[in] - warp index

Param blockIdx

[out] - the returned CUDA block index

Return

CUDBG_SUCCESS,

Return

CUDBG_ERROR_INVALID_ARGS,

Return

CUDBG_ERROR_UNINITIALIZED,

Return

CUDBG_ERROR_INTERNAL,

Return

CUDBG_ERROR_INVALID_WARP,

Return

CUDBG_ERROR_INITIALIZATION_FAILURE,

Return

CUDBG_ERROR_INVALID_CONTEXT,

Return

CUDBG_ERROR_RECURSIVE_API_CALL

CUDBGResult (*readBlockIdx32)(uint32_t dev, uint32_t sm, uint32_t wp, CuDim2 *blockIdx)

Read the two-dimensional CUDA block index running on a valid warp.

Behaves like readBlockIdx but doesn’t return the z dimension.

Since CUDA 3.0.

See also

readBlockIdx

Note

DEPRECATED in CUDA 4.0: Use readBlockIdx instead.

Param dev

[in] - device index

Param sm

[in] - SM index

Param wp

[in] - warp index

Param blockIdx

[out] - the returned CUDA block index

Return

CUDBG_SUCCESS,

Return

CUDBG_ERROR_INVALID_ARGS,

Return

CUDBG_ERROR_UNINITIALIZED,

Return

CUDBG_ERROR_INTERNAL,

Return

CUDBG_ERROR_INVALID_WARP,

Return

CUDBG_ERROR_INITIALIZATION_FAILURE,

Return

CUDBG_ERROR_INVALID_CONTEXT,

Return

CUDBG_ERROR_RECURSIVE_API_CALL

CUDBGResult (*readBrokenWarps)(uint32_t dev, uint32_t sm, uint64_t *brokenWarpsMask)

Read the bitmask of warps that are at a breakpoint on a given SM.

Since CUDA 3.0.

See also

readActiveLanes

See also

readBlockIdx

See also

readGridId

See also

readThreadIdx

See also

readValidLanes

See also

readValidWarps

Param dev

[in] - device index

Param sm

[in] - SM index

Param brokenWarpsMask

[out] - the returned bitmask of broken warps

Return

CUDBG_SUCCESS,

Return

CUDBG_ERROR_INVALID_ARGS,

Return

CUDBG_ERROR_UNINITIALIZED,

Return

CUDBG_ERROR_INITIALIZATION_FAILURE,

Return

CUDBG_ERROR_RECURSIVE_API_CALL

CUDBGResult (*readCallDepth)(uint32_t dev, uint32_t sm, uint32_t wp, uint32_t ln, uint32_t *depth)

Read the call depth (number of calls) for a given thread.

Since CUDA 4.0.

Param dev

[in] - device index

Param sm

[in] - SM index

Param wp

[in] - warp index

Param ln

[in] - lane index

Param depth

[out] - the returned call depth

Return

CUDBG_SUCCESS,

Return

CUDBG_ERROR_INVALID_ARGS,

Return

CUDBG_ERROR_UNINITIALIZED,

Return

CUDBG_ERROR_INTERNAL,

Return

CUDBG_ERROR_INVALID_WARP,

Return

CUDBG_ERROR_INITIALIZATION_FAILURE,

Return

CUDBG_ERROR_INVALID_CONTEXT,

Return

CUDBG_ERROR_RECURSIVE_API_CALL

CUDBGResult (*readCallDepth32)(uint32_t dev, uint32_t sm, uint32_t wp, uint32_t *depth)

Read the call depth (number of calls) for a given warp.

Behaves like readCallDepth() for the active thread group.

Since CUDA 3.1.

See also

readCallDepth

Note

DEPRECATED in CUDA 4.0: Use readCallDepth instead.

Param dev

[in] - device index

Param sm

[in] - SM index

Param wp

[in] - warp index

Param depth

[out] - the returned call depth

Return

CUDBG_SUCCESS,

Return

CUDBG_ERROR_INVALID_ARGS,

Return

CUDBG_ERROR_UNINITIALIZED,

Return

CUDBG_ERROR_INTERNAL,

Return

CUDBG_ERROR_INVALID_WARP,

Return

CUDBG_ERROR_INVALID_LANE,

Return

CUDBG_ERROR_INITIALIZATION_FAILURE,

Return

CUDBG_ERROR_INVALID_CONTEXT,

Return

CUDBG_ERROR_RECURSIVE_API_CALL

CUDBGResult (*readCCRegister)(uint32_t dev, uint32_t sm, uint32_t wp, uint32_t ln, uint32_t *val)

Read the hardware CC register.

The CC register is no longer available in the supported hardware.

Since CUDA 6.5.

Note

DEPRECATED in CUDA 13.1: Do not use.

Param dev

[in] - device index

Param sm

[in] - SM index

Param wp

[in] - warp index

Param ln

[in] - lane index

Param val

[out] - the returned value of the CC register

Return

CUDBG_SUCCESS,

Return

CUDBG_ERROR_INVALID_ARGS,

Return

CUDBG_ERROR_UNINITIALIZED,

Return

CUDBG_ERROR_INITIALIZATION_FAILURE,

Return

CUDBG_ERROR_RECURSIVE_API_CALL

CUDBGResult (*readClusterIdx)(uint32_t dev, uint32_t sm, uint32_t wp, CuDim3 *clusterIdx)

Read the CUDA cluster index running on a valid warp.

Since CUDA 12.0.

See also

readActiveLanes

See also

readBlockIdx

See also

readBrokenWarps

See also

readGridId

See also

readThreadIdx

See also

readValidLanes

See also

readValidWarps

Param dev

[in] - device index

Param sm

[in] - SM index

Param wp

[in] - warp index

Param clusterIdx

[out] - the returned CUDA cluster index

Return

CUDBG_SUCCESS,

Return

CUDBG_ERROR_INVALID_ARGS,

Return

CUDBG_ERROR_UNINITIALIZED,

Return

CUDBG_ERROR_INTERNAL,

Return

CUDBG_ERROR_INVALID_WARP,

Return

CUDBG_ERROR_INITIALIZATION_FAILURE,

Return

CUDBG_ERROR_INVALID_CONTEXT,

Return

CUDBG_ERROR_RECURSIVE_API_CALL

CUDBGResult (*readCodeMemory)(uint32_t dev, uint64_t addr, void *buf, uint32_t sz)

Read content at address in the code memory segment.

It is generally not necessary to call this function - instead, the same memory could be read from the ELF module images received from the API.

Since CUDA 3.0.

See also

readLocalMemory

See also

readPC

See also

readParamMemory

See also

readRegister

See also

readSharedMemory

Param dev

[in] - device index

Param addr

[in] - memory address

Param buf

[out] - buffer

Param sz

[in] - buffer size in bytes

Return

CUDBG_SUCCESS,

Return

CUDBG_ERROR_INVALID_ARGS,

Return

CUDBG_ERROR_UNINITIALIZED,

Return

CUDBG_ERROR_INTERNAL,

Return

CUDBG_ERROR_INVALID_ADDRESS,

Return

CUDBG_ERROR_INITIALIZATION_FAILURE,

Return

CUDBG_ERROR_INVALID_CONTEXT,

Return

CUDBG_ERROR_RECURSIVE_API_CALL

CUDBGResult (*readConstMemory129)(uint32_t dev, uint64_t addr, void *buf, uint32_t sz)

Read content at address in the constant memory segment.

Behaves exactly like readGlobalMemory.

Since CUDA 3.0.

See also

readGlobalMemory

Note

DEPRECATED in CUDA 13.0: Use readGlobalMemory instead.

Param dev

[in] - device index

Param addr

[in] - memory address

Param buf

[out] - buffer

Param sz

[in] - buffer size in bytes

Return

CUDBG_SUCCESS,

Return

CUDBG_ERROR_UNKNOWN,

Return

CUDBG_ERROR_INVALID_ARGS,

Return

CUDBG_ERROR_UNINITIALIZED,

Return

CUDBG_ERROR_INVALID_MEMORY_ACCESS,

Return

CUDBG_ERROR_INITIALIZATION_FAILURE,

Return

CUDBG_ERROR_ADDRESS_NOT_IN_DEVICE_MEM,

Return

CUDBG_ERROR_AMBIGUOUS_MEMORY_ADDRESS,

Return

CUDBG_ERROR_RECURSIVE_API_CALL,

Return

CUDBG_ERROR_NOT_SUPPORTED

CUDBGResult (*readCPUCallStack)(uint32_t dev, uint64_t gridId64, uint64_t *addrs, uint32_t numAddrs, uint32_t *totalNumAddrs)

Read the CPU call stack captured at the time of kernel launch.

This method only works if the CUDBG_DEBUGGER_CAPABILITY_COLLECT_CPU_CALL_STACK_FOR_KERNEL_LAUNCHES capability is enabled.

Since CUDA 12.9.

Param dev

[in] - device index

Param gridId64

[in] - 64-bit grid ID

Param addrs

[out] - the returned addresses array, can be NULL

Param numAddrs

[in] - capacity of addrs (possibly 0)

Param totalNumAddrs

[out] - the actual size of the stack (number of frames) is written here; the value written can be greater than numAddrs

Return

CUDBG_SUCCESS,

Return

CUDBG_ERROR_INVALID_ARGS,

Return

CUDBG_ERROR_UNINITIALIZED,

Return

CUDBG_ERROR_INTERNAL,

Return

CUDBG_ERROR_INITIALIZATION_FAILURE,

Return

CUDBG_ERROR_INVALID_GRID,

Return

CUDBG_ERROR_INVALID_CONTEXT,

Return

CUDBG_ERROR_RECURSIVE_API_CALL

CUDBGResult (*readDeviceExceptionState)(uint32_t dev, uint64_t *mask, uint32_t numWords)

Get the exception state of the SMs on the device.

If the CUDBG_DEBUGGER_CAPABILITY_REPORT_EXCEPTIONS_IN_EXITED_WARPS capability is enabled, exceptions in exited warps will be reported.

Since CUDA 9.0.

See also

getNumSMs

Param dev

[in] - device index

Param mask

[out] - Arbitrarily sized bit field containing a 1 at (1 << i) if SM i hit an exception

Param numWords

[in] - Number of uint64_t elements in mask (must be large enough to hold a bit for each sm on the device)

Return

CUDBG_SUCCESS,

Return

CUDBG_ERROR_INVALID_ARGS,

Return

CUDBG_ERROR_UNINITIALIZED,

Return

CUDBG_ERROR_INITIALIZATION_FAILURE,

Return

CUDBG_ERROR_RECURSIVE_API_CALL

CUDBGResult (*readDeviceExceptionState80)(uint32_t dev, uint64_t *exceptionSMMask)

Get the exception state of the SMs on the device.

Behaves like readDeviceExceptionState but only supports up to 64 SMs.

Since CUDA 5.5.

Note

DEPRECATED in CUDA 9.0: Use readDeviceExceptionState instead.

Param dev

[in] - device index

Param exceptionSMMask

[out] - Bit field containing a 1 at (1 << i) if SM i hit an exception

Return

CUDBG_SUCCESS,

Return

CUDBG_ERROR_INVALID_ARGS,

Return

CUDBG_ERROR_UNINITIALIZED,

Return

CUDBG_ERROR_INITIALIZATION_FAILURE,

Return

CUDBG_ERROR_RECURSIVE_API_CALL

CUDBGResult (*readErrorPC)(uint32_t dev, uint32_t sm, uint32_t wp, uint64_t *errorPC, bool *errorPCValid)

Get the hardware reported error PC if it exists.

The error PC, if available, shows the PC where an error happened (the thread can progress past that so its PC could be beyond that).

Since CUDA 6.0.

Param dev

[in] - device index

Param sm

[in] - SM index

Param warp

[in] - warp index

Param errorPC

[out] - PC ofthe exception

Param errorPCValid

[out] - boolean to indicate that the returned error PC is valid

Return

CUDBG_SUCCESS,

Return

CUDBG_ERROR_UNKNOWN_FUNCTION,

Return

CUDBG_ERROR_INVALID_ARGS,

Return

CUDBG_ERROR_UNINITIALIZED,

Return

CUDBG_ERROR_INVALID_WARP,

Return

CUDBG_ERROR_INITIALIZATION_FAILURE,

Return

CUDBG_ERROR_INVALID_CONTEXT,

Return

CUDBG_ERROR_RECURSIVE_API_CALL

CUDBGResult (*readGenericMemory)(uint32_t dev, uint32_t sm, uint32_t wp, uint32_t ln, uint64_t addr, void *buf, uint32_t sz)

Read content at an address in any memory segment.

The address will be used to determine whether the read is to local, shared or global memory. The target address range should entirely reside within a single memory segment. Coordinate arguments are only used when relevant. They should be provided for the following segments:

  • Shared memory: SM and Warp

  • Local memory: SM, Warp and Lane

Since CUDA 6.0.

See also

readCodeMemory

See also

readLocalMemory

See also

readPC

See also

readParamMemory

See also

readRegister

See also

readSharedMemory

Param dev

[in] - device index

Param sm

[in] - SM index

Param wp

[in] - warp index

Param ln

[in] - lane index

Param addr

[in] - memory address

Param buf

[out] - buffer

Param buf_size

[in] - buffer size in bytes

Return

CUDBG_SUCCESS,

Return

CUDBG_ERROR_UNKNOWN,

Return

CUDBG_ERROR_INVALID_ARGS,

Return

CUDBG_ERROR_UNINITIALIZED,

Return

CUDBG_ERROR_INVALID_MEMORY_ACCESS,

Return

CUDBG_ERROR_INTERNAL,

Return

CUDBG_ERROR_INVALID_WARP,

Return

CUDBG_ERROR_INITIALIZATION_FAILURE,

Return

CUDBG_ERROR_INVALID_CONTEXT,

Return

CUDBG_ERROR_ADDRESS_NOT_IN_DEVICE_MEM,

Return

CUDBG_ERROR_AMBIGUOUS_MEMORY_ADDRESS,

Return

CUDBG_ERROR_RECURSIVE_API_CALL,

Return

CUDBG_ERROR_NOT_SUPPORTED

CUDBGResult (*readGlobalMemory)(uint64_t addr, void *buf, uint32_t sz)

Read content at an address in the global address space.

If the address is valid on more than one device and one of those devices does not support UVA, an error is returned.

Since CUDA 6.0.

See also

readCodeMemory

See also

readLocalMemory

See also

readPC

See also

readParamMemory

See also

readRegister

See also

readSharedMemory

Param addr

[in] - memory address

Param buf

[out] - buffer

Param buf_size

[in] - buffer size in bytes

Return

CUDBG_SUCCESS,

Return

CUDBG_ERROR_UNKNOWN,

Return

CUDBG_ERROR_INVALID_ARGS,

Return

CUDBG_ERROR_UNINITIALIZED,

Return

CUDBG_ERROR_INVALID_MEMORY_ACCESS,

Return

CUDBG_ERROR_INITIALIZATION_FAILURE,

Return

CUDBG_ERROR_ADDRESS_NOT_IN_DEVICE_MEM,

Return

CUDBG_ERROR_AMBIGUOUS_MEMORY_ADDRESS,

Return

CUDBG_ERROR_RECURSIVE_API_CALL,

Return

CUDBG_ERROR_NOT_SUPPORTED

CUDBGResult (*readGlobalMemory31)(uint32_t dev, uint64_t addr, void *buf, uint32_t sz)

Read content at address in the global memory segment.

Behaves like readGenericMemory() with sm, wp, ln == 0. This makes this method not at all useful.

Since CUDA 3.0.

See also

readGlobalMemory

Note

DEPRECATED in CUDA 3.2: Use readGlobalMemory instead.

Param dev

[in] - device index

Param addr

[in] - memory address

Param buf

[out] - buffer

Param sz

[in] - buffer size in bytes

Return

CUDBG_SUCCESS,

Return

CUDBG_ERROR_UNKNOWN,

Return

CUDBG_ERROR_INVALID_ARGS,

Return

CUDBG_ERROR_UNINITIALIZED,

Return

CUDBG_ERROR_INVALID_MEMORY_ACCESS,

Return

CUDBG_ERROR_INTERNAL,

Return

CUDBG_ERROR_INVALID_WARP,

Return

CUDBG_ERROR_INITIALIZATION_FAILURE,

Return

CUDBG_ERROR_INVALID_CONTEXT,

Return

CUDBG_ERROR_ADDRESS_NOT_IN_DEVICE_MEM,

Return

CUDBG_ERROR_AMBIGUOUS_MEMORY_ADDRESS,

Return

CUDBG_ERROR_RECURSIVE_API_CALL,

Return

CUDBG_ERROR_NOT_SUPPORTED

CUDBGResult (*readGlobalMemory55)(uint32_t dev, uint32_t sm, uint32_t wp, uint32_t ln, uint64_t addr, void *buf, uint32_t sz)

Read content at address in the global memory segment.

Behaves exactly like readGenericMemory().

Since CUDA 3.2.

See also

readGlobalMemory

Note

DEPRECATED in CUDA 6.0: Use readGlobalMemory instead.

Param dev

[in] - device index

Param sm

[in] - SM index

Param wp

[in] - warp index

Param ln

[in] - lane index

Param addr

[in] - memory address

Param buf

[out] - buffer

Param sz

[in] - buffer size in bytes

Return

CUDBG_SUCCESS,

Return

CUDBG_ERROR_UNKNOWN,

Return

CUDBG_ERROR_INVALID_ARGS,

Return

CUDBG_ERROR_UNINITIALIZED,

Return

CUDBG_ERROR_INVALID_MEMORY_ACCESS,

Return

CUDBG_ERROR_INTERNAL,

Return

CUDBG_ERROR_INVALID_WARP,

Return

CUDBG_ERROR_INITIALIZATION_FAILURE,

Return

CUDBG_ERROR_INVALID_CONTEXT,

Return

CUDBG_ERROR_ADDRESS_NOT_IN_DEVICE_MEM,

Return

CUDBG_ERROR_AMBIGUOUS_MEMORY_ADDRESS,

Return

CUDBG_ERROR_RECURSIVE_API_CALL,

Return

CUDBG_ERROR_NOT_SUPPORTED

CUDBGResult (*readGridId)(uint32_t dev, uint32_t sm, uint32_t wp, uint64_t *gridId64)

Read the 64-bit CUDA grid index running on a valid warp.

The grid ID is guaranteed to be unique within a device, but not globally.

Since CUDA 5.5.

See also

readActiveLanes

See also

readBlockIdx

See also

readBrokenWarps

See also

readThreadIdx

See also

readValidLanes

See also

readValidWarps

Param dev

[in] - device index

Param sm

[in] - SM index

Param wp

[in] - warp index

Param gridId

[out] - the returned 64-bit CUDA grid index

Return

CUDBG_SUCCESS,

Return

CUDBG_ERROR_INVALID_ARGS,

Return

CUDBG_ERROR_UNINITIALIZED,

Return

CUDBG_ERROR_INVALID_WARP,

Return

CUDBG_ERROR_INITIALIZATION_FAILURE,

Return

CUDBG_ERROR_INVALID_CONTEXT,

Return

CUDBG_ERROR_RECURSIVE_API_CALL

CUDBGResult (*readGridId50)(uint32_t dev, uint32_t sm, uint32_t wp, uint32_t *gridId)

Read the CUDA grid index running on a valid warp.

Behaves like readGridId but truncates the grid ID to 32bit. This is incompatible with some grid IDs like those used by the OptiX applications.

Since CUDA 3.0.

See also

readGridId

Note

DEPRECATED in CUDA 5.5: Use readGridId instead.

Param dev

[in] - device index

Param sm

[in] - SM index

Param wp

[in] - warp index

Param gridId

[out] - the returned CUDA grid index

Return

CUDBG_SUCCESS,

Return

CUDBG_ERROR_INVALID_ARGS,

Return

CUDBG_ERROR_UNINITIALIZED,

Return

CUDBG_ERROR_INVALID_WARP,

Return

CUDBG_ERROR_INITIALIZATION_FAILURE,

Return

CUDBG_ERROR_INVALID_CONTEXT,

Return

CUDBG_ERROR_RECURSIVE_API_CALL

CUDBGResult (*readLaneException)(uint32_t dev, uint32_t sm, uint32_t wp, uint32_t ln, CUDBGException_t *exception)

Read the exception type for a given thread.

Since CUDA 3.1.

Param dev

[in] - device index

Param sm

[in] - SM index

Param wp

[in] - warp index

Param ln

[in] - lane index

Param exception

[out] - the returned exception type

Return

CUDBG_SUCCESS,

Return

CUDBG_ERROR_INVALID_ARGS,

Return

CUDBG_ERROR_UNINITIALIZED,

Return

CUDBG_ERROR_INVALID_WARP,

Return

CUDBG_ERROR_INITIALIZATION_FAILURE,

Return

CUDBG_ERROR_INVALID_CONTEXT,

Return

CUDBG_ERROR_RECURSIVE_API_CALL

CUDBGResult (*readLaneStatus)(uint32_t dev, uint32_t sm, uint32_t wp, uint32_t ln, bool *error)

Read the status of the given thread.

For specific error values, use readLaneException.

Since CUDA 3.0.

Param dev

[in] - device index

Param sm

[in] - SM index

Param wp

[in] - warp index

Param ln

[in] - lane index

Param error

[out] - true if there is an error

Return

CUDBG_SUCCESS,

Return

CUDBG_ERROR_INVALID_ARGS,

Return

CUDBG_ERROR_UNINITIALIZED,

Return

CUDBG_ERROR_INVALID_WARP,

Return

CUDBG_ERROR_INITIALIZATION_FAILURE,

Return

CUDBG_ERROR_INVALID_CONTEXT,

Return

CUDBG_ERROR_RECURSIVE_API_CALL

CUDBGResult (*readLocalMemory)(uint32_t dev, uint32_t sm, uint32_t wp, uint32_t ln, uint64_t addr, void *buf, uint32_t sz)

Read content at address in the local memory segment.

Since CUDA 3.0.

See also

readCodeMemory

See also

readPC

See also

readParamMemory

See also

readRegister

See also

readSharedMemory

Param dev

[in] - device index

Param sm

[in] - SM index

Param wp

[in] - warp index

Param ln

[in] - lane index

Param addr

[in] - memory address

Param buf

[out] - buffer

Param sz

[in] - buffer size in bytes

Return

CUDBG_SUCCESS,

Return

CUDBG_ERROR_INVALID_ARGS,

Return

CUDBG_ERROR_UNINITIALIZED,

Return

CUDBG_ERROR_INTERNAL,

Return

CUDBG_ERROR_INVALID_WARP,

Return

CUDBG_ERROR_INVALID_ADDRESS,

Return

CUDBG_ERROR_INITIALIZATION_FAILURE,

Return

CUDBG_ERROR_INVALID_CONTEXT,

Return

CUDBG_ERROR_RECURSIVE_API_CALL

CUDBGResult (*readParamMemory)(uint32_t dev, uint32_t sm, uint32_t wp, uint64_t addr, void *buf, uint32_t sz)

Read content at address in the param memory segment.

Since CUDA 3.0.

See also

readCodeMemory

See also

readLocalMemory

See also

readPC

See also

readRegister

See also

readSharedMemory

Param dev

[in] - device index

Param sm

[in] - SM index

Param wp

[in] - warp index

Param addr

[in] - memory address

Param buf

[out] - buffer

Param sz

[in] - buffer size in bytes

Return

CUDBG_SUCCESS,

Return

CUDBG_ERROR_INVALID_ARGS,

Return

CUDBG_ERROR_UNINITIALIZED,

Return

CUDBG_ERROR_INTERNAL,

Return

CUDBG_ERROR_INVALID_WARP,

Return

CUDBG_ERROR_INITIALIZATION_FAILURE,

Return

CUDBG_ERROR_INVALID_CONTEXT,

Return

CUDBG_ERROR_RECURSIVE_API_CALL

CUDBGResult (*readPC)(uint32_t dev, uint32_t sm, uint32_t wp, uint32_t ln, uint64_t *pc)

Read the PC offset on the given active thread.

The returned PC offset is from the start of the current function. If a function can’t be found, the full virtual address is returned.

Since CUDA 3.0.

See also

readCodeMemory

See also

readLocalMemory

See also

readParamMemory

See also

readRegister

See also

readSharedMemory

See also

readVirtualPC

Param dev

[in] - device index

Param sm

[in] - SM index

Param wp

[in] - warp index

Param ln

[in] - lane index

Param pc

[out] - the returned PC

Return

CUDBG_SUCCESS,

Return

CUDBG_ERROR_UNKNOWN_FUNCTION,

Return

CUDBG_ERROR_INVALID_ARGS,

Return

CUDBG_ERROR_UNINITIALIZED,

Return

CUDBG_ERROR_INTERNAL,

Return

CUDBG_ERROR_INVALID_WARP,

Return

CUDBG_ERROR_INITIALIZATION_FAILURE,

Return

CUDBG_ERROR_INVALID_CONTEXT,

Return

CUDBG_ERROR_RECURSIVE_API_CALL

CUDBGResult (*readPinnedMemory)(uint64_t addr, void *buf, uint32_t sz)

Read content at pinned address in system memory.

Depending on the platform, this method may fail and a platform-specific CPU RAM way of reading memory from the debuggee must be used (e.g. ptrace).

Since CUDA 3.2.

See also

readCodeMemory

See also

readLocalMemory

See also

readPC

See also

readParamMemory

See also

readRegister

See also

readSharedMemory

Param addr

[in] - system memory address

Param buf

[out] - buffer

Param sz

[in] - buffer size in bytes

Return

CUDBG_SUCCESS,

Return

CUDBG_ERROR_UNKNOWN,

Return

CUDBG_ERROR_INVALID_ARGS,

Return

CUDBG_ERROR_UNINITIALIZED,

Return

CUDBG_ERROR_INVALID_MEMORY_ACCESS,

Return

CUDBG_ERROR_MEMORY_MAPPING_FAILED,

Return

CUDBG_ERROR_INITIALIZATION_FAILURE,

Return

CUDBG_ERROR_ADDRESS_NOT_IN_DEVICE_MEM,

Return

CUDBG_ERROR_AMBIGUOUS_MEMORY_ADDRESS,

Return

CUDBG_ERROR_RECURSIVE_API_CALL

CUDBGResult (*readPredicates)(uint32_t dev, uint32_t sm, uint32_t wp, uint32_t ln, uint32_t predicates_size, uint32_t *predicates)

Read content of hardware predicate registers.

Since CUDA 6.5.

See also

readCodeMemory

See also

readGlobalMemory

See also

readLocalMemory

See also

readPC

See also

readParamMemory

See also

readRegister

See also

readSharedMemory

Param dev

[in] - device index

Param sm

[in] - SM index

Param wp

[in] - warp index

Param ln

[in] - lane index

Param predicates_size

[in] - number of predicate registers to read

Param predicates

[out] - buffer

Return

CUDBG_SUCCESS,

Return

CUDBG_ERROR_INVALID_ARGS,

Return

CUDBG_ERROR_UNINITIALIZED,

Return

CUDBG_ERROR_INTERNAL,

Return

CUDBG_ERROR_INVALID_WARP,

Return

CUDBG_ERROR_INITIALIZATION_FAILURE,

Return

CUDBG_ERROR_INVALID_CONTEXT,

Return

CUDBG_ERROR_RECURSIVE_API_CALL

CUDBGResult (*readRegister)(uint32_t dev, uint32_t sm, uint32_t wp, uint32_t ln, uint32_t regno, uint32_t *val)

Read content of a hardware register.

Note that warps can dynamically change the number of used registers at runtime, readWarpResources() could be used to query that.

Since CUDA 3.0.

See also

readCodeMemory

See also

readLocalMemory

See also

readPC

See also

readParamMemory

See also

readSharedMemory

Param dev

[in] - device index

Param sm

[in] - SM index

Param wp

[in] - warp index

Param ln

[in] - lane index

Param regno

[in] - register index

Param val

[out] - the returned value of the register

Return

CUDBG_SUCCESS,

Return

CUDBG_ERROR_INVALID_ARGS,

Return

CUDBG_ERROR_UNINITIALIZED,

Return

CUDBG_ERROR_INTERNAL,

Return

CUDBG_ERROR_INVALID_WARP,

Return

CUDBG_ERROR_INITIALIZATION_FAILURE,

Return

CUDBG_ERROR_INVALID_CONTEXT,

Return

CUDBG_ERROR_RECURSIVE_API_CALL

CUDBGResult (*readRegisterRange)(uint32_t dev, uint32_t sm, uint32_t wp, uint32_t ln, uint32_t index, uint32_t numRegisters, uint32_t *registers, uint32_t *numRegistersRead)

Read content of a hardware range of hardware registers.

Since CUDA 13.2.

See also

readCodeMemory

See also

readLocalMemory

See also

readPC

See also

readParamMemory

See also

readRegister

See also

readSharedMemory

Param dev

[in] - device index

Param sm

[in] - SM index

Param wp

[in] - warp index

Param ln

[in] - lane index

Param index

[in] - index of the first register to read

Param numRegisters

[in] - number of registers to read

Param registers

[out] - buffer

Param numRegistersRead

[out] - number of registers actually read, ignored if null

Return

CUDBG_SUCCESS,

Return

CUDBG_ERROR_INVALID_ARGS,

Return

CUDBG_ERROR_UNINITIALIZED,

Return

CUDBG_ERROR_INTERNAL,

Return

CUDBG_ERROR_INVALID_WARP,

Return

CUDBG_ERROR_INITIALIZATION_FAILURE,

Return

CUDBG_ERROR_INVALID_CONTEXT,

Return

CUDBG_ERROR_RECURSIVE_API_CALL

CUDBGResult (*readRegisterRange60)(uint32_t dev, uint32_t sm, uint32_t wp, uint32_t ln, uint32_t index, uint32_t registers_size, uint32_t *registers)

Read content of a range of hardware registers.

Since CUDA 6.0.

Note

DEPRECATED in CUDA 13.2: Use readRegisterRange instead.

Param dev

[in] - device index

Param sm

[in] - SM index

Param wp

[in] - warp index

Param ln

[in] - lane index

Param index

[in] - index of the first register to read

Param registers_size

[in] - number of registers to read

Param registers

[out] - buffer

Return

CUDBG_SUCCESS,

Return

CUDBG_ERROR_INVALID_ARGS,

Return

CUDBG_ERROR_UNINITIALIZED,

Return

CUDBG_ERROR_INTERNAL,

Return

CUDBG_ERROR_INVALID_WARP,

Return

CUDBG_ERROR_INITIALIZATION_FAILURE,

Return

CUDBG_ERROR_INVALID_CONTEXT,

Return

CUDBG_ERROR_RECURSIVE_API_CALL

CUDBGResult (*readReturnAddress)(uint32_t dev, uint32_t sm, uint32_t wp, uint32_t ln, uint32_t level, uint64_t *ra)

Read the return address (offset) for a call level.

The returned return address is an offset from the start of the current function. If a function can’t be found, the full virtual address is returned.

Since CUDA 4.0.

See also

readCallDepth

Param dev

[in] - device index

Param sm

[in] - SM index

Param wp

[in] - warp index

Param ln

[in] - lane index

Param level

[in] - the specified call level

Param ra

[out] - the returned return address for level

Return

CUDBG_SUCCESS,

Return

CUDBG_ERROR_UNKNOWN_FUNCTION,

Return

CUDBG_ERROR_INVALID_ARGS,

Return

CUDBG_ERROR_UNINITIALIZED,

Return

CUDBG_ERROR_INTERNAL,

Return

CUDBG_ERROR_INVALID_WARP,

Return

CUDBG_ERROR_INITIALIZATION_FAILURE,

Return

CUDBG_ERROR_INVALID_CALL_LEVEL,

Return

CUDBG_ERROR_INVALID_CONTEXT,

Return

CUDBG_ERROR_RECURSIVE_API_CALL

CUDBGResult (*readReturnAddress32)(uint32_t dev, uint32_t sm, uint32_t wp, uint32_t level, uint64_t *ra)

Read the return address (offset) for a call level.

Behaves like readReturnAddress() for the active thread group.

Since CUDA 3.1.

Note

DEPRECATED in CUDA 4.0: Use readReturnAddress instead.

Param dev

[in] - device index

Param sm

[in] - SM index

Param wp

[in] - warp index

Param level

[in] - the specified call level

Param ra

[out] - the returned return address for level

Return

CUDBG_SUCCESS,

Return

CUDBG_ERROR_UNKNOWN_FUNCTION,

Return

CUDBG_ERROR_INVALID_ARGS,

Return

CUDBG_ERROR_UNINITIALIZED,

Return

CUDBG_ERROR_INTERNAL,

Return

CUDBG_ERROR_INVALID_WARP,

Return

CUDBG_ERROR_INVALID_LANE,

Return

CUDBG_ERROR_INITIALIZATION_FAILURE,

Return

CUDBG_ERROR_INVALID_CALL_LEVEL,

Return

CUDBG_ERROR_INVALID_CONTEXT,

Return

CUDBG_ERROR_RECURSIVE_API_CALL

CUDBGResult (*readRpcRegisters)(uint32_t dev, uint32_t sm, uint32_t wp, uint32_t ln, uint32_t *rpcLo, uint32_t *rpcHi)

Read the RPC.LO and/or RPC.HI hardware registers for a specific thread.

These registers are normally used by hardware to store the program counter of diverged threads. In some cases the compiler may also spill data into them for active threads. These registers can be read for both active and diverged threads.

Passing NULL for rpcLo or rpcHi causes that register to be skipped. Passing NULL for both is an error.

Since CUDA 13.4.

Param dev

[in] - device index

Param sm

[in] - SM index

Param wp

[in] - warp index

Param ln

[in] - lane index

Param rpcLo

[out] - receives RPC.LO (lower 32 bits), or NULL to skip

Param rpcHi

[out] - receives RPC.HI (upper 32 bits), or NULL to skip

Return

CUDBG_SUCCESS,

Return

CUDBG_ERROR_INVALID_ARGS,

Return

CUDBG_ERROR_INVALID_DEVICE,

Return

CUDBG_ERROR_INVALID_SM,

Return

CUDBG_ERROR_INVALID_WARP,

Return

CUDBG_ERROR_INVALID_LANE,

Return

CUDBG_ERROR_INTERNAL,

Return

CUDBG_ERROR_UNINITIALIZED,

Return

CUDBG_ERROR_INITIALIZATION_FAILURE,

Return

CUDBG_ERROR_RECURSIVE_API_CALL

CUDBGResult (*readSharedMemory)(uint32_t dev, uint32_t sm, uint32_t wp, uint64_t addr, void *buf, uint32_t sz)

Read content at address in the shared memory segment.

Since CUDA 3.0.

See also

readCodeMemory

See also

readLocalMemory

See also

readPC

See also

readParamMemory

See also

readRegister

Param dev

[in] - device index

Param sm

[in] - SM index

Param wp

[in] - warp index

Param addr

[in] - memory address

Param buf

[out] - buffer

Param sz

[in] - buffer size in bytes

Return

CUDBG_SUCCESS,

Return

CUDBG_ERROR_INVALID_ARGS,

Return

CUDBG_ERROR_UNINITIALIZED,

Return

CUDBG_ERROR_INVALID_MEMORY_ACCESS,

Return

CUDBG_ERROR_INTERNAL,

Return

CUDBG_ERROR_INVALID_WARP,

Return

CUDBG_ERROR_INITIALIZATION_FAILURE,

Return

CUDBG_ERROR_INVALID_CONTEXT,

Return

CUDBG_ERROR_RECURSIVE_API_CALL

CUDBGResult (*readSmException)(uint32_t dev, uint32_t sm, CUDBGException_t *exception, uint64_t *errorPC, bool *errorPCValid)

Get the SM exception status if it exists.

If the CUDBG_DEBUGGER_CAPABILITY_REPORT_EXCEPTIONS_IN_EXITED_WARPS capability is enabled, exceptions in exited warps will be reported.

Since CUDA 12.5.

Param dev

[in] - the device index

Param sm

[in] - the SM index

Param exception

[out] - returned exception

Param errorPC

[out] - returned PC of the exception

Param errorPCValid

[out] - boolean to indicate that the returned error PC is valid

Return

CUDBG_SUCCESS,

Return

CUDBG_ERROR_INVALID_ARGS,

Return

CUDBG_ERROR_UNINITIALIZED,

Return

CUDBG_ERROR_INITIALIZATION_FAILURE,

Return

CUDBG_ERROR_INVALID_CONTEXT,

Return

CUDBG_ERROR_RECURSIVE_API_CALL

CUDBGResult (*readSyscallCallDepth)(uint32_t dev, uint32_t sm, uint32_t wp, uint32_t ln, uint32_t *depth)

Read the call depth of syscalls for a given thread.

Will always return 0.

Since CUDA 4.1.

Note

DEPRECATED in CUDA 12.9: Do not use.

Param dev

[in] - device index

Param sm

[in] - SM index

Param wp

[in] - warp index

Param ln

[in] - lane index

Param depth

[out] - the returned call depth

Return

CUDBG_SUCCESS,

Return

CUDBG_ERROR_INVALID_ARGS,

Return

CUDBG_ERROR_UNINITIALIZED,

Return

CUDBG_ERROR_INITIALIZATION_FAILURE,

Return

CUDBG_ERROR_RECURSIVE_API_CALL

CUDBGResult (*readTextureMemory)(uint32_t dev, uint32_t vsm, uint32_t wp, uint32_t id, uint32_t dim, uint32_t *coords, void *buf, uint32_t sz)

This method is no longer supported since CUDA 12.0.

Will always return CUDBG_ERROR_NOT_SUPPORTED.

Since CUDA 4.0.

Note

DEPRECATED in CUDA 12.0: Do not use.

Param dev

[in] - device index

Param sm

[in] - SM index

Param wp

[in] - warp index

Param id

[in] - texture id (the value of DW_AT_location attribute in the relocated ELF image)

Param dim

[in] - texture dimension (1 to 4)

Param coords

[in] - array of coordinates of size dim

Param buf

[out] - result buffer

Param sz

[in] - buffer size in bytes

Return

CUDBG_ERROR_INVALID_ARGS,

Return

CUDBG_ERROR_UNINITIALIZED,

Return

CUDBG_ERROR_INITIALIZATION_FAILURE,

Return

CUDBG_ERROR_RECURSIVE_API_CALL,

Return

CUDBG_ERROR_NOT_SUPPORTED

CUDBGResult (*readTextureMemoryBindless)(uint32_t dev, uint32_t vsm, uint32_t wp, uint32_t texSymtabIndex, uint32_t dim, uint32_t *coords, void *buf, uint32_t sz)

This method is no longer supported since CUDA 12.0.

Will always return CUDBG_ERROR_NOT_SUPPORTED.

Since CUDA 4.2.

Note

DEPRECATED in CUDA 12.0: Do not use.

Param dev

[in] - device index

Param sm

[in] - SM index

Param wp

[in] - warp index

Param texSymtabIndex

[in] - global symbol table index of the texture symbol

Param dim

[in] - texture dimension (1 to 4)

Param coords

[in] - array of coordinates of size dim

Param buf

[out] - result buffer

Param sz

[in] - buffer size in bytes

Return

CUDBG_ERROR_INVALID_ARGS,

Return

CUDBG_ERROR_UNINITIALIZED,

Return

CUDBG_ERROR_INITIALIZATION_FAILURE,

Return

CUDBG_ERROR_RECURSIVE_API_CALL,

Return

CUDBG_ERROR_NOT_SUPPORTED

CUDBGResult (*readThreadIdx)(uint32_t dev, uint32_t sm, uint32_t wp, uint32_t ln, CuDim3 *threadIdx)

Read the CUDA thread index running on valid thread.

Since CUDA 3.0.

See also

readActiveLanes

See also

readBlockIdx

See also

readBrokenWarps

See also

readGridId

See also

readValidLanes

See also

readValidWarps

Param dev

[in] - device index

Param sm

[in] - SM index

Param wp

[in] - warp index

Param ln

[in] - lane index

Param threadIdx

[out] - the returned CUDA thread index

Return

CUDBG_SUCCESS,

Return

CUDBG_ERROR_INVALID_ARGS,

Return

CUDBG_ERROR_UNINITIALIZED,

Return

CUDBG_ERROR_INTERNAL,

Return

CUDBG_ERROR_INVALID_WARP,

Return

CUDBG_ERROR_INITIALIZATION_FAILURE,

Return

CUDBG_ERROR_INVALID_CONTEXT,

Return

CUDBG_ERROR_RECURSIVE_API_CALL

CUDBGResult (*readUniformPredicates)(uint32_t dev, uint32_t sm, uint32_t wp, uint32_t predicates_size, uint32_t *predicates)

Read contents of uniform predicate registers.

Since CUDA 10.0.

See also

readPredicates

Param dev

[in] - device index

Param sm

[in] - SM index

Param wp

[in] - warp index

Param predicates_size

[in] - number of predicate registers to read

Param predicates

[out] - buffer

Return

CUDBG_SUCCESS,

Return

CUDBG_ERROR_INVALID_ARGS,

Return

CUDBG_ERROR_UNINITIALIZED,

Return

CUDBG_ERROR_INTERNAL,

Return

CUDBG_ERROR_INVALID_WARP,

Return

CUDBG_ERROR_INITIALIZATION_FAILURE,

Return

CUDBG_ERROR_INVALID_CONTEXT,

Return

CUDBG_ERROR_RECURSIVE_API_CALL

CUDBGResult (*readUniformRegisterRange)(uint32_t dev, uint32_t sm, uint32_t wp, uint32_t regno, uint32_t registers_size, uint32_t *registers)

Read a range of uniform registers.

Since CUDA 10.0.

See also

readRegister

Param dev

[in] - device index

Param sm

[in] - SM index

Param wp

[in] - warp index

Param regno

[in] - starting index into uniform register file

Param registers_size

[in] - number of bytes to read

Param registers

[out] - pointer to buffer

Return

CUDBG_SUCCESS,

Return

CUDBG_ERROR_INVALID_ARGS,

Return

CUDBG_ERROR_UNINITIALIZED,

Return

CUDBG_ERROR_INTERNAL,

Return

CUDBG_ERROR_INVALID_WARP,

Return

CUDBG_ERROR_INITIALIZATION_FAILURE,

Return

CUDBG_ERROR_INVALID_CONTEXT,

Return

CUDBG_ERROR_RECURSIVE_API_CALL

CUDBGResult (*readValidLanes)(uint32_t dev, uint32_t sm, uint32_t wp, uint32_t *validLanesMask)

Read the lane bitmask of valid threads on a given warp.

Since CUDA 3.0.

See also

readActiveLanes

See also

readBlockIdx

See also

readBrokenWarps

See also

readGridId

See also

readThreadIdx

See also

readValidWarps

Param dev

[in] - device index

Param sm

[in] - SM index

Param wp

[in] - warp index

Param validLanesMask

[out] - the returned bitmask of valid threads

Return

CUDBG_SUCCESS,

Return

CUDBG_ERROR_INVALID_ARGS,

Return

CUDBG_ERROR_UNINITIALIZED,

Return

CUDBG_ERROR_INVALID_WARP,

Return

CUDBG_ERROR_INITIALIZATION_FAILURE,

Return

CUDBG_ERROR_INVALID_CONTEXT,

Return

CUDBG_ERROR_RECURSIVE_API_CALL

CUDBGResult (*readValidWarps)(uint32_t dev, uint32_t sm, uint64_t *validWarpsMask)

Read the bitmask of valid warps on a given SM.

Since CUDA 3.0.

See also

readActiveLanes

See also

readBlockIdx

See also

readBrokenWarps

See also

readGridId

See also

readThreadIdx

See also

readValidLanes

Param dev

[in] - device index

Param sm

[in] - SM index

Param validWarpsMask

[out] - the returned bitmask of valid warps

Return

CUDBG_SUCCESS,

Return

CUDBG_ERROR_INVALID_ARGS,

Return

CUDBG_ERROR_UNINITIALIZED,

Return

CUDBG_ERROR_INITIALIZATION_FAILURE,

Return

CUDBG_ERROR_RECURSIVE_API_CALL

CUDBGResult (*readVirtualPC)(uint32_t dev, uint32_t sm, uint32_t wp, uint32_t ln, uint64_t *pc)

Read the PC (virtual address) on the given active thread.

Since CUDA 3.0.

See also

readPC

Param dev

[in] - device index

Param sm

[in] - SM index

Param wp

[in] - warp index

Param ln

[in] - lane index

Param pc

[out] - the returned PC

Return

CUDBG_SUCCESS,

Return

CUDBG_ERROR_INVALID_ARGS,

Return

CUDBG_ERROR_UNINITIALIZED,

Return

CUDBG_ERROR_INTERNAL,

Return

CUDBG_ERROR_INVALID_WARP,

Return

CUDBG_ERROR_INITIALIZATION_FAILURE,

Return

CUDBG_ERROR_INVALID_CONTEXT,

Return

CUDBG_ERROR_RECURSIVE_API_CALL

CUDBGResult (*readVirtualReturnAddress)(uint32_t dev, uint32_t sm, uint32_t wp, uint32_t ln, uint32_t level, uint64_t *ra)

Read the virtual return address for a call level.

Since CUDA 4.0.

See also

readCallDepth

Param dev

[in] - device index

Param sm

[in] - SM index

Param wp

[in] - warp index

Param ln

[in] - lane index

Param level

[in] - the specified call level

Param ra

[out] - the returned virtual return address for level

Return

CUDBG_SUCCESS,

Return

CUDBG_ERROR_INVALID_ARGS,

Return

CUDBG_ERROR_UNINITIALIZED,

Return

CUDBG_ERROR_INTERNAL,

Return

CUDBG_ERROR_INVALID_WARP,

Return

CUDBG_ERROR_INITIALIZATION_FAILURE,

Return

CUDBG_ERROR_INVALID_CALL_LEVEL,

Return

CUDBG_ERROR_INVALID_CONTEXT,

Return

CUDBG_ERROR_RECURSIVE_API_CALL

CUDBGResult (*readVirtualReturnAddress32)(uint32_t dev, uint32_t sm, uint32_t wp, uint32_t level, uint64_t *ra)

Read the virtual return address for a call level.

Behaves like readVirtualReturnAddress for the active thread group.

Since CUDA 3.1.

Note

DEPRECATED in CUDA 4.0: Use readVirtualReturnAddress instead.

Param dev

[in] - device index

Param sm

[in] - SM index

Param wp

[in] - warp index

Param level

[in] - the specified call level

Param ra

[out] - the returned virtual return address for level

Return

CUDBG_SUCCESS,

Return

CUDBG_ERROR_INVALID_ARGS,

Return

CUDBG_ERROR_UNINITIALIZED,

Return

CUDBG_ERROR_INTERNAL,

Return

CUDBG_ERROR_INVALID_WARP,

Return

CUDBG_ERROR_INVALID_LANE,

Return

CUDBG_ERROR_INITIALIZATION_FAILURE,

Return

CUDBG_ERROR_INVALID_CALL_LEVEL,

Return

CUDBG_ERROR_INVALID_CONTEXT,

Return

CUDBG_ERROR_RECURSIVE_API_CALL

CUDBGResult (*readWarpResources)(uint32_t dev, uint32_t sm, uint32_t wp, CUDBGWarpResources *resources)

Get the resources assigned to a given warp.

Note that these resources can change between suspends, which makes this method useful for avoiding warp data access errors.

Since CUDA 12.8.

Param dev

[in] - device index

Param sm

[in] - SM index

Param wp

[in] - warp index

Param resources

[out] - pointer to structure that contains warp resources

Return

CUDBG_SUCCESS,

Return

CUDBG_ERROR_INVALID_ARGS,

Return

CUDBG_ERROR_UNINITIALIZED,

Return

CUDBG_ERROR_INTERNAL,

Return

CUDBG_ERROR_INVALID_WARP,

Return

CUDBG_ERROR_INITIALIZATION_FAILURE,

Return

CUDBG_ERROR_INVALID_CONTEXT,

Return

CUDBG_ERROR_RECURSIVE_API_CALL

CUDBGResult (*readWarpState)(uint32_t dev, uint32_t sm, uint32_t wp, CUDBGWarpState *state)

Read the state of a given warp.

Since CUDA 12.9.

Param dev

[in] - device index

Param sm

[in] - SM index

Param wp

[in] - warp index

Param state

[out] - pointer to structure that contains warp state

Return

CUDBG_SUCCESS,

Return

CUDBG_ERROR_INVALID_ARGS,

Return

CUDBG_ERROR_UNINITIALIZED,

Return

CUDBG_ERROR_INTERNAL,

Return

CUDBG_ERROR_INVALID_WARP,

Return

CUDBG_ERROR_INITIALIZATION_FAILURE,

Return

CUDBG_ERROR_INVALID_GRID,

Return

CUDBG_ERROR_INVALID_CONTEXT,

Return

CUDBG_ERROR_RECURSIVE_API_CALL

CUDBGResult (*readWarpState120)(uint32_t dev, uint32_t sm, uint32_t wp, CUDBGWarpState120 *state)

Read the state of a given warp.

Behaves like readWarpState but returns fewer fields.

Since CUDA 12.0.

See also

readWarpState

Note

DEPRECATED in CUDA 12.7: Use readWarpState instead.

Param dev

[in] - device index

Param sm

[in] - SM index

Param wp

[in] - warp index

Param state

[out] - pointer to structure that contains warp state

Return

CUDBG_SUCCESS,

Return

CUDBG_ERROR_INVALID_ARGS,

Return

CUDBG_ERROR_UNINITIALIZED,

Return

CUDBG_ERROR_INTERNAL,

Return

CUDBG_ERROR_INVALID_WARP,

Return

CUDBG_ERROR_INITIALIZATION_FAILURE,

Return

CUDBG_ERROR_INVALID_GRID,

Return

CUDBG_ERROR_INVALID_CONTEXT,

Return

CUDBG_ERROR_RECURSIVE_API_CALL

CUDBGResult (*readWarpState127)(uint32_t dev, uint32_t sm, uint32_t wp, CUDBGWarpState127 *state)

Read the state of a given warp.

Behaves like readWarpState but returns fewer fields.

Since CUDA 12.7.

See also

readWarpState

Note

DEPRECATED in CUDA 12.9: Use readWarpState instead.

Param dev

[in] - device index

Param sm

[in] - SM index

Param wp

[in] - warp index

Param state

[out] - pointer to structure that contains warp state

Return

CUDBG_SUCCESS,

Return

CUDBG_ERROR_INVALID_ARGS,

Return

CUDBG_ERROR_UNINITIALIZED,

Return

CUDBG_ERROR_INTERNAL,

Return

CUDBG_ERROR_INVALID_WARP,

Return

CUDBG_ERROR_INITIALIZATION_FAILURE,

Return

CUDBG_ERROR_INVALID_GRID,

Return

CUDBG_ERROR_INVALID_CONTEXT,

Return

CUDBG_ERROR_RECURSIVE_API_CALL

CUDBGResult (*readWarpState60)(uint32_t dev, uint32_t sm, uint32_t wp, CUDBGWarpState60 *state)

Read the state of a given warp.

Behaves like readWarpState but returns fewer fields.

Since CUDA 6.0.

See also

readWarpState

Note

DEPRECATED in CUDA 12.0: Use readWarpState instead.

Param dev

[in] - device index

Param sm

[in] - SM index

Param wp

[in] - warp index

Param state

[out] - pointer to structure that contains warp state

Return

CUDBG_SUCCESS,

Return

CUDBG_ERROR_INVALID_ARGS,

Return

CUDBG_ERROR_UNINITIALIZED,

Return

CUDBG_ERROR_INTERNAL,

Return

CUDBG_ERROR_INVALID_WARP,

Return

CUDBG_ERROR_INITIALIZATION_FAILURE,

Return

CUDBG_ERROR_INVALID_GRID,

Return

CUDBG_ERROR_INVALID_CONTEXT,

Return

CUDBG_ERROR_RECURSIVE_API_CALL

CUDBGResult (*removeBreakpoint)(CUDBGBreakpointHandle handle)

Remove a breakpoint specified by its handle.

Since CUDA 13.2.

See also

enableBreakpoint

See also

insertBreakpoint

Param handle

[in] - the breakpoint handle. If it’s CUDBG_BREAKPOINT_HANDLE_ALL_USER_BREAKPOINTS, remove all breakpoints inserted by the client (except the break-on-launch breakpoint). It’s fine to use ALL_USER_BREAKPOINTS when there are no breakpoints added.

Return

CUDBG_SUCCESS,

Return

CUDBG_ERROR_INVALID_ARGS,

Return

CUDBG_ERROR_UNINITIALIZED,

Return

CUDBG_ERROR_INTERNAL,

Return

CUDBG_ERROR_INITIALIZATION_FAILURE,

Return

CUDBG_ERROR_RECURSIVE_API_CALL

CUDBGResult (*requestCleanupOnDetach)(uint32_t appResumeFlag)

Request for cleanup of driver state when detaching.

Needs to be conditionally called by the client depending on the state of the debugged application. See the “Attaching and Detaching” section for more information.

Since CUDA 6.0.

Param appResumeFlag

[in] - value of CUDBG_RESUME_FOR_ATTACH_DETACH as read from the application’s process space.

Return

CUDBG_SUCCESS,

Return

CUDBG_ERROR_INVALID_ARGS,

Return

CUDBG_ERROR_UNINITIALIZED,

Return

CUDBG_ERROR_INTERNAL,

Return

CUDBG_ERROR_INITIALIZATION_FAILURE,

Return

CUDBG_ERROR_RECURSIVE_API_CALL

CUDBGResult (*requestCleanupOnDetach55)(void)

Request for cleanup of driver state when detaching.

Needs to be conditionally called by the client depending on the state of the debugged application. See the “Attaching and Detaching” section for more information.

Since CUDA 5.0.

Note

DEPRECATED in CUDA 6.0: Use requestCleanupOnDetach instead.

Return

CUDBG_SUCCESS,

Return

CUDBG_ERROR_INVALID_ARGS,

Return

CUDBG_ERROR_UNINITIALIZED,

Return

CUDBG_ERROR_INTERNAL,

Return

CUDBG_ERROR_INITIALIZATION_FAILURE,

Return

CUDBG_ERROR_RECURSIVE_API_CALL

CUDBGResult (*resumeAllDevices)()

Resume all running CUDA devices.

Since CUDA 13.2.

Return

CUDBG_SUCCESS,

Return

CUDBG_ERROR_INVALID_ARGS,

Return

CUDBG_ERROR_UNINITIALIZED,

Return

CUDBG_ERROR_INTERNAL,

Return

CUDBG_ERROR_RUNNING_DEVICE,

Return

CUDBG_ERROR_INITIALIZATION_FAILURE,

Return

CUDBG_ERROR_RECURSIVE_API_CALL

CUDBGResult (*resumeDevice)(uint32_t dev)

Resume a suspended CUDA device.

Using this method is discouraged, use resumeAllDevices() instead to avoid race conditions. This method has no effect if the device is already running.

Since CUDA 3.0.

See also

resumeAllDevices

Param dev

[in] - device index

Return

CUDBG_SUCCESS,

Return

CUDBG_ERROR_INVALID_ARGS,

Return

CUDBG_ERROR_UNINITIALIZED,

Return

CUDBG_ERROR_INTERNAL,

Return

CUDBG_ERROR_RUNNING_DEVICE,

Return

CUDBG_ERROR_INITIALIZATION_FAILURE,

Return

CUDBG_ERROR_RECURSIVE_API_CALL

CUDBGResult (*resumeWarpsUntilPC)(uint32_t dev, uint32_t sm, uint64_t warpMask, uint64_t pc, uint32_t flags)

Insert a temporary breakpoint at the specified virtual PC and resume all warps in the specified bitmask on a given SM.

Compared to resumeDevice(), this method provides finer-grain control by resuming a selected set of warps on the same SM. The main intended usage is to accelerate the single-stepping process when the target PC is known in advance. Instead of single-stepping each warp individually until the target PC is hit, the client can use this method. If an unsteppable barrier is hit by the resumed warps, this method returns early (before reaching the target PC). When this method is used, errors within CUDA kernels will no longer be reported precisely. In the situation where resuming warps is not possible, this method will return CUDBG_ERROR_WARP_RESUME_NOT_POSSIBLE. The client should then fall back to using singleStepWarp() or resumeDevice().

Since CUDA 13.2.

See also

resumeAllDevices

See also

singleStepWarp

Param dev

[in] - device index

Param sm

[in] - the SM index

Param warpMask

[in] - the bitmask of warps to resume (1 = resume, 0 = do not resume)

Param virtPC

[in] - the virtual PC where the temporary breakpoint will be inserted

Param flags

[in] - flags of type CUDBGSingleStepFlags to change the stepping behavior

Return

CUDBG_SUCCESS,

Return

CUDBG_ERROR_UNKNOWN_FUNCTION,

Return

CUDBG_ERROR_INVALID_ARGS,

Return

CUDBG_ERROR_UNINITIALIZED,

Return

CUDBG_ERROR_INTERNAL,

Return

CUDBG_ERROR_RUNNING_DEVICE,

Return

CUDBG_ERROR_INVALID_ADDRESS,

Return

CUDBG_ERROR_INITIALIZATION_FAILURE,

Return

CUDBG_ERROR_INVALID_CONTEXT,

Return

CUDBG_ERROR_WARP_RESUME_NOT_POSSIBLE,

Return

CUDBG_ERROR_INVALID_WARP_MASK,

Return

CUDBG_ERROR_RECURSIVE_API_CALL

CUDBGResult (*resumeWarpsUntilPC60)(uint32_t dev, uint32_t sm, uint64_t warpMask, uint64_t virtPC)

Insert a temporary breakpoint at the specified virtual PC and resume all warps in the specified bitmask on a given SM.

Compared to resumeDevice(), this method provides finer-grain control by resuming a selected set of warps on the same SM. The main intended usage is to accelerate the single-stepping process when the target PC is known in advance. Instead of single-stepping each warp individually until the target PC is hit, the client can use this method. If an unsteppable barrier is hit by the resumed warps, this method returns early (before reaching the target PC). When this method is used, errors within CUDA kernels will no longer be reported precisely. In the situation where resuming warps is not possible, this method will return CUDBG_ERROR_WARP_RESUME_NOT_POSSIBLE. The client should then fall back to using singleStepWarp() or resumeDevice().

Since CUDA 6.0.

Note

DEPRECATED in CUDA 13.2: Use resumeWarpsUntilPC instead.

Param dev

[in] - device index

Param sm

[in] - SM index

Param warpMask

[in] - the bitmask of warps to resume (1 = resume, 0 = do not resume)

Param virtPC

[in] - the virtual PC where the temporary breakpoint will be inserted

Return

CUDBG_SUCCESS,

Return

CUDBG_ERROR_UNKNOWN_FUNCTION,

Return

CUDBG_ERROR_INVALID_ARGS,

Return

CUDBG_ERROR_UNINITIALIZED,

Return

CUDBG_ERROR_INTERNAL,

Return

CUDBG_ERROR_RUNNING_DEVICE,

Return

CUDBG_ERROR_INVALID_ADDRESS,

Return

CUDBG_ERROR_INITIALIZATION_FAILURE,

Return

CUDBG_ERROR_INVALID_CONTEXT,

Return

CUDBG_ERROR_WARP_RESUME_NOT_POSSIBLE,

Return

CUDBG_ERROR_INVALID_WARP_MASK,

Return

CUDBG_ERROR_RECURSIVE_API_CALL

CUDBGResult (*setBreakpoint)(uint32_t dev, uint64_t addr)

Set a breakpoint at the given instruction address for the given device.

Before setting a breakpoint, getAdjustedCodeAddress() should be called to get the adjusted breakpoint address.

Since CUDA 3.2.

See also

unsetBreakpoint

Param dev

[in] - device index

Param addr

[in] - instruction address

Return

CUDBG_SUCCESS,

Return

CUDBG_ERROR_INVALID_ARGS,

Return

CUDBG_ERROR_UNINITIALIZED,

Return

CUDBG_ERROR_INTERNAL,

Return

CUDBG_ERROR_INVALID_ADDRESS,

Return

CUDBG_ERROR_INITIALIZATION_FAILURE,

Return

CUDBG_ERROR_RECURSIVE_API_CALL

CUDBGResult (*setBreakpoint31)(uint64_t addr)

Set a breakpoint at the given instruction address.

Behaves like setBreakpoint but tries to automatically find a device for the given address.

Since CUDA 3.0.

See also

setBreakpoint

Note

DEPRECATED in CUDA 3.2: Use setBreakpoint instead.

Param addr

[in] - instruction address

Return

CUDBG_SUCCESS,

Return

CUDBG_ERROR_INVALID_ARGS,

Return

CUDBG_ERROR_UNINITIALIZED,

Return

CUDBG_ERROR_INTERNAL,

Return

CUDBG_ERROR_INVALID_ADDRESS,

Return

CUDBG_ERROR_INITIALIZATION_FAILURE,

Return

CUDBG_ERROR_RECURSIVE_API_CALL

CUDBGResult (*setCudaLogRules)(const CUDBGCudaLogRule *rules, uint32_t numRules, uint32_t *newRulesetIndex)

Set CUDA log filtering rules.

All rules are applied in order, the first matching rule wins. If no rules match, the log message is excluded. The log level filter for each rule is applied by an equality test with the log level of the message. The API user can implement log level filtering in a flag enum style or nested levels style on its side.

The default ruleset is:

CUDBGCudaLogRule{CUDBG_CUDA_LOG_RULE_ACTION_SEND_ASYNC, CUDBG_CUDA_LOG_LEVEL_FILTER_ANY, 0, NULL}
meaning send all CUDA log messages to the API client asynchronously. The default ruleset index is 0.

Since CUDA 13.4.

See also

consumeCudaLogs

Note

This function returns immediately and the new rules are applied asynchronously in the debuggee process. It’s possible that the log messages sent immediately after calling this function are not affected by the new rules.

Param rules

[in] - array of log filtering rules

Param numRules

[in] - number of log filtering rules in the array

Param newRulesetIndex

[out] - the index of the new ruleset, guaranteed to be unique and increasing, can be passed as NULL if the caller is not interested in the index

Return

CUDBG_SUCCESS,

Return

CUDBG_ERROR_INVALID_ARGS,

Return

CUDBG_ERROR_UNINITIALIZED,

Return

CUDBG_ERROR_INITIALIZATION_FAILURE,

Return

CUDBG_ERROR_RECURSIVE_API_CALL

CUDBGResult (*setKernelLaunchNotificationMode)(CUDBGKernelLaunchNotifyMode mode)

Set the launch notification policy.

If mode is CUDBG_KNL_LAUNCH_NOTIFY_EVENT, enable synchronous launch notification reporting (via events). This can noticeably slow down the execution of the application. If mode is CUDBG_KNL_LAUNCH_NOTIFY_DEFER, the launch notifications are not reported at all.

Since CUDA 5.5.

Param mode

[in] - mode to deliver kernel launch notifications in

Return

CUDBG_SUCCESS,

Return

CUDBG_ERROR_INVALID_ARGS,

Return

CUDBG_ERROR_UNINITIALIZED,

Return

CUDBG_ERROR_INTERNAL,

Return

CUDBG_ERROR_INITIALIZATION_FAILURE,

Return

CUDBG_ERROR_RECURSIVE_API_CALL

CUDBGResult (*setNotifyNewEventCallback)(CUDBGNotifyNewEventCallback callback, void *userData)

Provides the API with the function to call to notify the debugger of a new application or device event.

The callback function is called for every ASYNC and SYNC event. The callback function is always called on the same thread. No API methods can be called from that thread except getNextEvent(), acknowledgeSyncEvents() (and their deprecated variants), and consumeCudaLogs() (since CUDA 13.4), otherwise CUDBG_ERROR_RECURSIVE_API_CALL will be returned.

Since CUDA 13.0.

See also

getNextEvent

See also

consumeCudaLogs

Param callback

[in] - the callback function

Param data

[in] - a pointer to be passed to the callback when called

Return

CUDBG_SUCCESS,

Return

CUDBG_ERROR_INVALID_ARGS,

Return

CUDBG_ERROR_INITIALIZATION_FAILURE,

Return

CUDBG_ERROR_RECURSIVE_API_CALL

CUDBGResult (*setNotifyNewEventCallback31)(CUDBGNotifyNewEventCallback31 callback, void *data)

Provides the API with the function to call to notify the debugger of a new application or device event.

Behaves like setNotifyNewEventCallback but doesn’t return the host thread ID from which the event originates.

Since CUDA 3.0.

Note

DEPRECATED in CUDA 3.2: Use setNotifyNewEventCallback instead.

Param callback

[in] - the callback function

Param data

[in] - a pointer to be passed to the callback when called

Return

CUDBG_SUCCESS,

Return

CUDBG_ERROR_INVALID_ARGS,

Return

CUDBG_ERROR_INITIALIZATION_FAILURE,

Return

CUDBG_ERROR_RECURSIVE_API_CALL

CUDBGResult (*setNotifyNewEventCallback40)(CUDBGNotifyNewEventCallback40 callback)

Provides the API with the function to call to notify the debugger of a new application or device event.

Behaves like setNotifyNewEventCallback but doesn’t allow passing in the user data pointer.

Since CUDA 3.2.

Note

DEPRECATED in CUDA 4.1: Use setNotifyNewEventCallback instead.

Param callback

[in] - the callback function

Return

CUDBG_SUCCESS,

Return

CUDBG_ERROR_INVALID_ARGS,

Return

CUDBG_ERROR_INITIALIZATION_FAILURE,

Return

CUDBG_ERROR_RECURSIVE_API_CALL

CUDBGResult (*setNotifyNewEventCallback41)(CUDBGNotifyNewEventCallback41 callback)

Provides the API with the function to call to notify the debugger of a new application or device event.

Behaves like setNotifyNewEventCallback but doesn’t allow passing in the user data pointer. The timeout field is always 0.

Since CUDA 4.1.

Note

DEPRECATED in CUDA 13.0: Use setNotifyNewEventCallback instead.

Param callback

[in] - the callback function

Return

CUDBG_SUCCESS,

Return

CUDBG_ERROR_INVALID_ARGS,

Return

CUDBG_ERROR_INITIALIZATION_FAILURE,

Return

CUDBG_ERROR_RECURSIVE_API_CALL

CUDBGResult (*singleStepWarp)(uint32_t dev, uint32_t sm, uint32_t wp, uint32_t laneHint, uint32_t nsteps, uint32_t flags, uint64_t *warpMask)

Single step an individual warp nsteps times on a suspended CUDA device.

By default, if the warp is on a convergence barrier, resumeWarpsUntilPC is called internally to quickly advance the warp past that barrier. If the CUDBG_SINGLE_STEP_FLAGS_NO_STEP_OVER_WARP_BARRIERS flag is passed in, this optimization is not performed (which would likely lead to diverged threads becoming focused and starting to advance towards the convergence barrier). If a warp is on a block-wide barrier (or wider), other warps required to advance past the barrier are automatically resumed. The output parameter warpMask will have the warps resumed in the current SM. Warps can also be resumed in other SMs, but are not reported via the API. This method is synchronous and will not return until the step is complete.

Since CUDA 12.4.

See also

resumeAllDevices

Param dev

[in] - device index

Param sm

[in] - SM index

Param wp

[in] - warp index

Param laneHint

[in] - focused lane (~0 to let the API decide)

Param nsteps

[in] - number of single steps

Param flags

[in] - flags of type CUDBGSingleStepFlags to change the stepping behavior

Param warpMask

[out] - the warps that have been single-stepped

Return

CUDBG_SUCCESS,

Return

CUDBG_ERROR_UNKNOWN_FUNCTION,

Return

CUDBG_ERROR_INVALID_ARGS,

Return

CUDBG_ERROR_UNINITIALIZED,

Return

CUDBG_ERROR_INTERNAL,

Return

CUDBG_ERROR_INVALID_WARP,

Return

CUDBG_ERROR_RUNNING_DEVICE,

Return

CUDBG_ERROR_INVALID_ADDRESS,

Return

CUDBG_ERROR_INITIALIZATION_FAILURE,

Return

CUDBG_ERROR_INVALID_CONTEXT,

Return

CUDBG_ERROR_WARP_RESUME_NOT_POSSIBLE,

Return

CUDBG_ERROR_INVALID_WARP_MASK,

Return

CUDBG_ERROR_RECURSIVE_API_CALL

CUDBGResult (*singleStepWarp40)(uint32_t dev, uint32_t sm, uint32_t wp)

Single step an individual warp on a suspended CUDA device.

Behaves like singleStepWarp41 without the output warpMask parameter.

Since CUDA 3.0.

See also

singleStepWarp

Note

DEPRECATED in CUDA 4.1: Use singleStepWarp instead.

Param dev

[in] - device index

Param sm

[in] - SM index

Param wp

[in] - warp index

Return

CUDBG_SUCCESS,

Return

CUDBG_ERROR_UNKNOWN_FUNCTION,

Return

CUDBG_ERROR_INVALID_ARGS,

Return

CUDBG_ERROR_UNINITIALIZED,

Return

CUDBG_ERROR_INTERNAL,

Return

CUDBG_ERROR_INVALID_WARP,

Return

CUDBG_ERROR_RUNNING_DEVICE,

Return

CUDBG_ERROR_INVALID_ADDRESS,

Return

CUDBG_ERROR_INITIALIZATION_FAILURE,

Return

CUDBG_ERROR_INVALID_CONTEXT,

Return

CUDBG_ERROR_WARP_RESUME_NOT_POSSIBLE,

Return

CUDBG_ERROR_INVALID_WARP_MASK,

Return

CUDBG_ERROR_RECURSIVE_API_CALL

CUDBGResult (*singleStepWarp41)(uint32_t dev, uint32_t sm, uint32_t wp, uint64_t *warpMask)

Single step an individual warp on a suspended CUDA device.

Behaves like singleStepWarp65 with nsteps set to 1.

Since CUDA 4.1.

See also

singleStepWarp

Note

DEPRECATED in CUDA 6.5: Use singleStepWarp instead.

Param dev

[in] - device index

Param sm

[in] - SM index

Param wp

[in] - warp index

Param warpMask

[out] - the warps that have been single-stepped

Return

CUDBG_SUCCESS,

Return

CUDBG_ERROR_UNKNOWN_FUNCTION,

Return

CUDBG_ERROR_INVALID_ARGS,

Return

CUDBG_ERROR_UNINITIALIZED,

Return

CUDBG_ERROR_INTERNAL,

Return

CUDBG_ERROR_INVALID_WARP,

Return

CUDBG_ERROR_RUNNING_DEVICE,

Return

CUDBG_ERROR_INVALID_ADDRESS,

Return

CUDBG_ERROR_INITIALIZATION_FAILURE,

Return

CUDBG_ERROR_INVALID_CONTEXT,

Return

CUDBG_ERROR_WARP_RESUME_NOT_POSSIBLE,

Return

CUDBG_ERROR_INVALID_WARP_MASK,

Return

CUDBG_ERROR_RECURSIVE_API_CALL

CUDBGResult (*singleStepWarp65)(uint32_t dev, uint32_t sm, uint32_t wp, uint32_t nsteps, uint64_t *warpMask)

Single step an individual warp nsteps times on a suspended CUDA device.

Behaves like singleStepWarp with no lane hint and the CUDBG_SINGLE_STEP_FLAGS_NO_STEP_OVER_WARP_BARRIERS flag set.

Since CUDA 6.5.

See also

singleStepWarp

Note

DEPRECATED in CUDA 12.4: Use singleStepWarp instead.

Param dev

[in] - device index

Param sm

[in] - SM index

Param wp

[in] - warp index

Param nsteps

[in] - number of single steps

Param warpMask

[out] - the warps that have been single-stepped

Return

CUDBG_SUCCESS,

Return

CUDBG_ERROR_UNKNOWN_FUNCTION,

Return

CUDBG_ERROR_INVALID_ARGS,

Return

CUDBG_ERROR_UNINITIALIZED,

Return

CUDBG_ERROR_INTERNAL,

Return

CUDBG_ERROR_INVALID_WARP,

Return

CUDBG_ERROR_RUNNING_DEVICE,

Return

CUDBG_ERROR_INVALID_ADDRESS,

Return

CUDBG_ERROR_INITIALIZATION_FAILURE,

Return

CUDBG_ERROR_INVALID_CONTEXT,

Return

CUDBG_ERROR_WARP_RESUME_NOT_POSSIBLE,

Return

CUDBG_ERROR_INVALID_WARP_MASK,

Return

CUDBG_ERROR_RECURSIVE_API_CALL

CUDBGResult (*suspendAllDevices)(uint32_t nonBlocking)

Suspend all running CUDA devices.

If the nonBlocking flag is non-zero, the function returns immediately and sends CUDBG_EVENT_ALL_DEVICES_SUSPENDED when the operation finishes in the background. Otherwise, if the function returns with CUDBG_SUCCESS, that guarantees that all devices have been suspended.

Since CUDA 13.2.

See also

resumeAllDevices

Param nonBlocking

[in] - whether or not asynchronous operation is desired

Return

CUDBG_SUCCESS,

Return

CUDBG_ERROR_INVALID_ARGS,

Return

CUDBG_ERROR_UNINITIALIZED,

Return

CUDBG_ERROR_INTERNAL,

Return

CUDBG_ERROR_SUSPENDED_DEVICE,

Return

CUDBG_ERROR_INITIALIZATION_FAILURE,

Return

CUDBG_ERROR_RECURSIVE_API_CALL

CUDBGResult (*suspendDevice)(uint32_t dev)

Suspends a running CUDA device.

Using this method is discouraged, use suspendAllDevices() instead to avoid race conditions. The device has to be suspended in order to execute most operations on it. CUDBG_ERROR_SUSPENDED_DEVICE is returned if the device is already suspended.

Since CUDA 3.0.

Param dev

[in] - device index

Return

CUDBG_SUCCESS,

Return

CUDBG_ERROR_INVALID_ARGS,

Return

CUDBG_ERROR_UNINITIALIZED,

Return

CUDBG_ERROR_SUSPENDED_DEVICE,

Return

CUDBG_ERROR_INITIALIZATION_FAILURE,

Return

CUDBG_ERROR_RECURSIVE_API_CALL

CUDBGResult (*unsetBreakpoint)(uint32_t dev, uint64_t addr)

Unset a breakpoint at the given instruction address for the given device.

Since CUDA 3.2.

See also

setBreakpoint

Param dev

[in] - device index

Param addr

[in] - instruction address

Return

CUDBG_SUCCESS,

Return

CUDBG_ERROR_INVALID_ARGS,

Return

CUDBG_ERROR_UNINITIALIZED,

Return

CUDBG_ERROR_INTERNAL,

Return

CUDBG_ERROR_INITIALIZATION_FAILURE,

Return

CUDBG_ERROR_RECURSIVE_API_CALL

CUDBGResult (*unsetBreakpoint31)(uint64_t addr)

Unset a breakpoint at the given instruction address.

Behaves like unsetBreakpoint but tries to automatically find a device for the given address.

Since CUDA 3.0.

See also

unsetBreakpoint

Note

DEPRECATED in CUDA 3.2: Use unsetBreakpoint instead.

Param addr

[in] - instruction address

Return

CUDBG_SUCCESS,

Return

CUDBG_ERROR_INVALID_ARGS,

Return

CUDBG_ERROR_UNINITIALIZED,

Return

CUDBG_ERROR_INTERNAL,

Return

CUDBG_ERROR_INVALID_ADDRESS,

Return

CUDBG_ERROR_INITIALIZATION_FAILURE,

Return

CUDBG_ERROR_RECURSIVE_API_CALL

CUDBGResult (*writeCCRegister)(uint32_t dev, uint32_t sm, uint32_t wp, uint32_t ln, uint32_t val)

Write to the hardware CC register.

The CC register is no longer available in the supported hardware.

Since CUDA 6.5.

Note

DEPRECATED in CUDA 13.1: Do not use.

Param dev

[in] - device index

Param sm

[in] - SM index

Param wp

[in] - warp index

Param ln

[in] - lane index

Param val

[in] - the new value of the CC register

Return

CUDBG_SUCCESS,

Return

CUDBG_ERROR_INVALID_ARGS,

Return

CUDBG_ERROR_UNINITIALIZED,

Return

CUDBG_ERROR_INITIALIZATION_FAILURE,

Return

CUDBG_ERROR_RECURSIVE_API_CALL

CUDBGResult (*writeGenericMemory)(uint32_t dev, uint32_t sm, uint32_t wp, uint32_t ln, uint64_t addr, const void *buf, uint32_t sz)

Write to an address in any memory segment.

The address will be used to determine whether the write is to local, shared or global memory. The target address range should entirely reside within a single memory segment. Coordinate arguments are only used when relevant. They should be provided for the following segments:

  • Shared memory: SM and Warp

  • Local memory: SM, Warp and Lane

Since CUDA 6.0.

See also

writeLocalMemory

See also

writeParamMemory

Param dev

[in] - device index

Param sm

[in] - SM index

Param wp

[in] - warp index

Param ln

[in] - lane index

Param addr

[in] - address

Param buf

[in] - buffer

Param sz

[in] - buffer size in bytes

Return

CUDBG_SUCCESS,

Return

CUDBG_ERROR_UNKNOWN,

Return

CUDBG_ERROR_INVALID_ARGS,

Return

CUDBG_ERROR_UNINITIALIZED,

Return

CUDBG_ERROR_INVALID_MEMORY_ACCESS,

Return

CUDBG_ERROR_INTERNAL,

Return

CUDBG_ERROR_INVALID_WARP,

Return

CUDBG_ERROR_INITIALIZATION_FAILURE,

Return

CUDBG_ERROR_INVALID_CONTEXT,

Return

CUDBG_ERROR_ADDRESS_NOT_IN_DEVICE_MEM,

Return

CUDBG_ERROR_AMBIGUOUS_MEMORY_ADDRESS,

Return

CUDBG_ERROR_RECURSIVE_API_CALL,

Return

CUDBG_ERROR_NOT_SUPPORTED

CUDBGResult (*writeGlobalMemory)(uint64_t addr, const void *buf, uint32_t sz)

Write to an address in global memory.

It’s not possible to access a shared memory page or an ambiguous address allocated on several devices that don’t support UVA.

Since CUDA 6.0.

See also

writeLocalMemory

See also

writeParamMemory

Param addr

[in] - address

Param buf

[in] - buffer

Param sz

[in] - buffer size in bytes

Return

CUDBG_SUCCESS,

Return

CUDBG_ERROR_UNKNOWN,

Return

CUDBG_ERROR_INVALID_ARGS,

Return

CUDBG_ERROR_UNINITIALIZED,

Return

CUDBG_ERROR_INVALID_MEMORY_ACCESS,

Return

CUDBG_ERROR_INITIALIZATION_FAILURE,

Return

CUDBG_ERROR_ADDRESS_NOT_IN_DEVICE_MEM,

Return

CUDBG_ERROR_AMBIGUOUS_MEMORY_ADDRESS,

Return

CUDBG_ERROR_RECURSIVE_API_CALL,

Return

CUDBG_ERROR_NOT_SUPPORTED

CUDBGResult (*writeGlobalMemory31)(uint32_t dev, uint64_t addr, const void *buf, uint32_t sz)

Write to an address in global memory.

This method is unsupported on Hopper and later architectures. Use newer methods: writeGlobalMemory or writeGenericMemory.

Since CUDA 3.0.

Note

DEPRECATED in CUDA 3.2: Use writeGlobalMemory instead.

Param dev

[in] - device index

Param addr

[in] - address

Param buf

[in] - buffer

Param sz

[in] - buffer size in bytes

Return

CUDBG_SUCCESS,

Return

CUDBG_ERROR_UNKNOWN,

Return

CUDBG_ERROR_INVALID_ARGS,

Return

CUDBG_ERROR_UNINITIALIZED,

Return

CUDBG_ERROR_INVALID_MEMORY_ACCESS,

Return

CUDBG_ERROR_INTERNAL,

Return

CUDBG_ERROR_INVALID_WARP,

Return

CUDBG_ERROR_INITIALIZATION_FAILURE,

Return

CUDBG_ERROR_INVALID_CONTEXT,

Return

CUDBG_ERROR_ADDRESS_NOT_IN_DEVICE_MEM,

Return

CUDBG_ERROR_AMBIGUOUS_MEMORY_ADDRESS,

Return

CUDBG_ERROR_RECURSIVE_API_CALL,

Return

CUDBG_ERROR_NOT_SUPPORTED

CUDBGResult (*writeGlobalMemory55)(uint32_t dev, uint32_t sm, uint32_t wp, uint32_t ln, uint64_t addr, const void *buf, uint32_t sz)

Write to an address in global memory.

Use newer methods: writeGlobalMemory or writeGenericMemory.

Since CUDA 3.2.

Note

DEPRECATED in CUDA 6.0: Use writeGlobalMemory instead.

Param dev

[in] - device index

Param sm

[in] - SM index

Param wp

[in] - warp index

Param ln

[in] - lane index

Param addr

[in] - address

Param buf

[in] - buffer

Param sz

[in] - buffer size in bytes

Return

CUDBG_SUCCESS,

Return

CUDBG_ERROR_UNKNOWN,

Return

CUDBG_ERROR_INVALID_ARGS,

Return

CUDBG_ERROR_UNINITIALIZED,

Return

CUDBG_ERROR_INVALID_MEMORY_ACCESS,

Return

CUDBG_ERROR_INTERNAL,

Return

CUDBG_ERROR_INVALID_WARP,

Return

CUDBG_ERROR_INITIALIZATION_FAILURE,

Return

CUDBG_ERROR_INVALID_CONTEXT,

Return

CUDBG_ERROR_ADDRESS_NOT_IN_DEVICE_MEM,

Return

CUDBG_ERROR_AMBIGUOUS_MEMORY_ADDRESS,

Return

CUDBG_ERROR_RECURSIVE_API_CALL,

Return

CUDBG_ERROR_NOT_SUPPORTED

CUDBGResult (*writeLocalMemory)(uint32_t dev, uint32_t sm, uint32_t wp, uint32_t ln, uint64_t addr, const void *buf, uint32_t sz)

Write to an address in local memory.

The destination address range must be within local memory.

Since CUDA 3.0.

See also

writeParamMemory

Param dev

[in] - device index

Param sm

[in] - SM index

Param wp

[in] - warp index

Param ln

[in] - lane index

Param addr

[in] - address

Param buf

[in] - buffer

Param sz

[in] - buffer size in bytes

Return

CUDBG_SUCCESS,

Return

CUDBG_ERROR_INVALID_ARGS,

Return

CUDBG_ERROR_UNINITIALIZED,

Return

CUDBG_ERROR_INTERNAL,

Return

CUDBG_ERROR_INVALID_WARP,

Return

CUDBG_ERROR_INVALID_ADDRESS,

Return

CUDBG_ERROR_INITIALIZATION_FAILURE,

Return

CUDBG_ERROR_INVALID_CONTEXT,

Return

CUDBG_ERROR_RECURSIVE_API_CALL

CUDBGResult (*writeParamMemory)(uint32_t dev, uint32_t sm, uint32_t wp, uint64_t addr, const void *buf, uint32_t sz)

Write to an address in param memory.

The destination address range must be within param memory.

Since CUDA 3.0.

See also

writeLocalMemory

Param dev

[in] - device index

Param sm

[in] - SM index

Param wp

[in] - warp index

Param addr

[in] - address

Param buf

[in] - buffer

Param sz

[in] - buffer size in bytes

Return

CUDBG_SUCCESS,

Return

CUDBG_ERROR_INVALID_ARGS,

Return

CUDBG_ERROR_UNINITIALIZED,

Return

CUDBG_ERROR_INTERNAL,

Return

CUDBG_ERROR_INVALID_WARP,

Return

CUDBG_ERROR_INITIALIZATION_FAILURE,

Return

CUDBG_ERROR_INVALID_CONTEXT,

Return

CUDBG_ERROR_RECURSIVE_API_CALL

CUDBGResult (*writePinnedMemory)(uint64_t addr, const void *buf, uint32_t sz)

Write to a pinned memory address.

It’s not possible to access an ambiguous access allocated on several devices that don’t support UVA.

Since CUDA 3.2.

See also

readPinnedMemory

Param addr

[in] - address

Param buf

[in] - buffer

Param sz

[in] - buffer size in bytes

Return

CUDBG_SUCCESS,

Return

CUDBG_ERROR_UNKNOWN,

Return

CUDBG_ERROR_INVALID_ARGS,

Return

CUDBG_ERROR_UNINITIALIZED,

Return

CUDBG_ERROR_INVALID_MEMORY_ACCESS,

Return

CUDBG_ERROR_MEMORY_MAPPING_FAILED,

Return

CUDBG_ERROR_INITIALIZATION_FAILURE,

Return

CUDBG_ERROR_ADDRESS_NOT_IN_DEVICE_MEM,

Return

CUDBG_ERROR_AMBIGUOUS_MEMORY_ADDRESS,

Return

CUDBG_ERROR_RECURSIVE_API_CALL

CUDBGResult (*writePredicates)(uint32_t dev, uint32_t sm, uint32_t wp, uint32_t ln, uint32_t predicates_size, const uint32_t *predicates)

Write to hardware predicates.

This method writes to predicates_size predicates, starting from P0. Each predicate value must be either 0 or 1.

Since CUDA 6.5.

See also

writeRegister

Param dev

[in] - device index

Param sm

[in] - SM index

Param wp

[in] - warp index

Param ln

[in] - lane index

Param predicates_size

[in] - predicates count

Param predicates

[in] - predicate values

Return

CUDBG_SUCCESS,

Return

CUDBG_ERROR_INVALID_ARGS,

Return

CUDBG_ERROR_UNINITIALIZED,

Return

CUDBG_ERROR_INTERNAL,

Return

CUDBG_ERROR_INVALID_WARP,

Return

CUDBG_ERROR_INITIALIZATION_FAILURE,

Return

CUDBG_ERROR_INVALID_CONTEXT,

Return

CUDBG_ERROR_RECURSIVE_API_CALL

CUDBGResult (*writeRegister)(uint32_t dev, uint32_t sm, uint32_t wp, uint32_t ln, uint32_t regno, uint32_t val)

Write to a hardware register.

Since CUDA 3.0.

See also

writePredicates

Param dev

[in] - device index

Param sm

[in] - SM index

Param wp

[in] - warp index

Param ln

[in] - lane index

Param regno

[in] - register number

Param val

[in] - value

Return

CUDBG_SUCCESS,

Return

CUDBG_ERROR_INVALID_ARGS,

Return

CUDBG_ERROR_UNINITIALIZED,

Return

CUDBG_ERROR_INTERNAL,

Return

CUDBG_ERROR_INVALID_WARP,

Return

CUDBG_ERROR_INITIALIZATION_FAILURE,

Return

CUDBG_ERROR_INVALID_CONTEXT,

Return

CUDBG_ERROR_RECURSIVE_API_CALL

CUDBGResult (*writeRpcRegisters)(uint32_t dev, uint32_t sm, uint32_t wp, uint32_t ln, const uint32_t *rpcLo, const uint32_t *rpcHi)

Write the RPC.LO and/or RPC.HI hardware registers for a specific active thread.

Only active (non-diverged) threads may be written. This means that it’s impossible to use this method to change the PC of a diverged thread, but also that it’s impossible to change the PC of an active thread with it since the active thread does not restore its PC from the RPC registers.

Passing NULL for rpcLo or rpcHi causes that register to be skipped. Passing NULL for both is an error.

Since CUDA 13.4.

See also

readRpcRegisters

Param dev

[in] - device index

Param sm

[in] - SM index

Param wp

[in] - warp index

Param ln

[in] - lane index

Param rpcLo

[in] - new value for RPC.LO (lower 32 bits), or NULL to skip

Param rpcHi

[in] - new value for RPC.HI (upper 32 bits), or NULL to skip

Return

CUDBG_SUCCESS,

Return

CUDBG_ERROR_INVALID_ARGS,

Return

CUDBG_ERROR_INVALID_DEVICE,

Return

CUDBG_ERROR_INVALID_SM,

Return

CUDBG_ERROR_INVALID_WARP,

Return

CUDBG_ERROR_INVALID_LANE,

Return

CUDBG_ERROR_NOT_SUPPORTED,

Return

CUDBG_ERROR_INTERNAL,

Return

CUDBG_ERROR_UNINITIALIZED,

Return

CUDBG_ERROR_INITIALIZATION_FAILURE,

Return

CUDBG_ERROR_RECURSIVE_API_CALL

CUDBGResult (*writeSharedMemory)(uint32_t dev, uint32_t sm, uint32_t wp, uint64_t addr, const void *buf, uint32_t sz)

Write to an address in shared memory.

The destination address range must be within shared memory.

Since CUDA 3.0.

See also

writeLocalMemory

See also

writeParamMemory

Param dev

[in] - device index

Param sm

[in] - SM index

Param wp

[in] - warp index

Param addr

[in] - address

Param buf

[in] - buffer

Param sz

[in] - buffer size in bytes

Return

CUDBG_SUCCESS,

Return

CUDBG_ERROR_INVALID_ARGS,

Return

CUDBG_ERROR_UNINITIALIZED,

Return

CUDBG_ERROR_INVALID_MEMORY_ACCESS,

Return

CUDBG_ERROR_INTERNAL,

Return

CUDBG_ERROR_INVALID_WARP,

Return

CUDBG_ERROR_INITIALIZATION_FAILURE,

Return

CUDBG_ERROR_INVALID_CONTEXT,

Return

CUDBG_ERROR_RECURSIVE_API_CALL

CUDBGResult (*writeUniformPredicates)(uint32_t dev, uint32_t sm, uint32_t wp, uint32_t predicates_size, const uint32_t *predicates)

Write to hardware uniform predicates.

This method writes to predicates_size uniform predicates, starting from UP0. Each predicate value must be either 0 or 1.

Since CUDA 10.0.

See also

writePredicates

See also

writeRegister

Param dev

[in] - device index

Param sm

[in] - SM index

Param wp

[in] - warp index

Param predicates_size

[in] - predicates count

Param predicates

[in] - predicate values

Return

CUDBG_SUCCESS,

Return

CUDBG_ERROR_INVALID_ARGS,

Return

CUDBG_ERROR_UNINITIALIZED,

Return

CUDBG_ERROR_INTERNAL,

Return

CUDBG_ERROR_INVALID_WARP,

Return

CUDBG_ERROR_INITIALIZATION_FAILURE,

Return

CUDBG_ERROR_INVALID_CONTEXT,

Return

CUDBG_ERROR_RECURSIVE_API_CALL

CUDBGResult (*writeUniformRegister)(uint32_t dev, uint32_t sm, uint32_t wp, uint32_t regno, uint32_t val)

Write to a hardware uniform register.

Since CUDA 10.0.

See also

writePredicates

See also

writeRegister

Param dev

[in] - device index

Param sm

[in] - SM index

Param wp

[in] - warp index

Param regno

[in] - register number

Param val

[in] - value

Return

CUDBG_SUCCESS,

Return

CUDBG_ERROR_INVALID_ARGS,

Return

CUDBG_ERROR_UNINITIALIZED,

Return

CUDBG_ERROR_INTERNAL,

Return

CUDBG_ERROR_INVALID_WARP,

Return

CUDBG_ERROR_INITIALIZATION_FAILURE,

Return

CUDBG_ERROR_INVALID_CONTEXT,

Return

CUDBG_ERROR_RECURSIVE_API_CALL