CUDA API Changes from 12.x to 13.x#
This topic summarizes the CUDA API changes from version 12.x to 13.x, including Driver API and CUDART API signature changes, deprecated APIs, and removed header files.
Migration Details#
Backward Compatible |
No |
Migration Path |
Orin to Thor |
Platform |
NSR |
OS |
Linux and QNX |
Migration Path |
7.0 to 7.2 |
Driver API Signature Changes#
The following table summarizes the Driver API signature changes:
API Function |
12.x Signature |
13.x Signature |
|---|---|---|
cuMemPrefetchAsync |
|
|
cuMemAdvise |
|
|
cuDeviceGetUuid |
Returns physical UUID |
Returns physical UUID in non-MIG mode and MIG UUID in MIG mode |
cuCtxCreate |
|
|
cuEventElapsedTime |
Standard error checking |
Relaxed error checking for performance improvement |
cuStreamGetCaptureInfo |
|
|
cuStreamUpdateCaptureDependencies |
|
|
cuGraphGetEdges |
|
|
cuGraphNodeGetDependencies |
|
|
cuGraphNodeGetDependentNodes |
|
|
cuGraphAddDependencies |
|
|
cuGraphRemoveDependencies |
|
|
cuGraphAddNode |
|
|
cuMemcpyBatchAsync |
|
|
cuMemcpy3DBatchAsync |
|
|
CUDART API Signature Changes#
The following table summarizes the CUDART API signature changes:
API Function |
12.x Signature |
13.x Signature |
|---|---|---|
cudaMemPrefetchAsync |
|
|
cudaMemAdvise |
|
|
cudaStreamGetCaptureInfo |
|
|
cudaStreamUpdateCaptureDependencies |
|
|
cudaGraphGetEdges |
|
|
cudaGraphNodeGetDependencies |
|
|
cudaGraphNodeGetDependentNodes |
|
|
cudaGraphAddDependencies |
|
|
cudaGraphRemoveDependencies |
|
|
cudaGraphAddNode |
|
|
cudaEventElapsedTime |
Standard error checking |
Relaxed error checking for performance improvement |
cudaSignalExternalSemaphoresAsync |
|
|
cudaWaitExternalSemaphoresAsync |
|
|
cudaMemcpyBatchAsync |
|
|
cudaMemcpy3DBatchAsync |
|
|
Change Reasons and Examples#
Key Memory Management API Changes#
- cuMemPrefetchAsync / cudaMemPrefetchAsync
Reason: Add a CPU NUMA node parameter to CUDA managed memory APIs
Before: Used
CUdevice/intfor device specificationAfter: Uses
CUmemLocation/struct cudaMemLocationfor more flexible memory location specificationMigration: Replace device parameter with location structure
- cuMemAdvise / cudaMemAdvise
Reason: Add a CPU NUMA node parameter to CUDA managed memory APIs
Before: Used
CUdevice/intfor device specificationAfter: Uses
CUmemLocation/struct cudaMemLocationfor location specificationMigration: Replace device parameter with location structure
Graph API Enhancements#
Multiple graph-related APIs now include CUgraphEdgeData / cudaGraphEdgeData parameters to support enhanced graph functionality:
Affected APIs: All
cuGraph*andcudaGraph*functions related to dependencies and edgesReason: Enhanced graph edge data support
Migration: Add
NULL/nullptrforedgeDataparameter if not using edge data features
Performance Improvements#
- cuEventElapsedTime / cudaEventElapsedTime
Reason: Performance improvement by relaxed error checking
Change: Removed explicit context error checking for better performance
Migration: No code changes required
Batched Memory Copy Changes#
- cuMemcpyBatchAsync / cudaMemcpyBatchAsync
Reason: Batched Memcpy v2 improvements
Change: Removed
failIdxparameterMigration: Remove
failIdxparameter from function calls
- cuMemcpy3DBatchAsync / cudaMemcpy3DBatchAsync
Reason: Batched Memcpy v2 improvements
Change: Removed
failIdxparameterMigration: Remove
failIdxparameter from function calls
External Semaphore Updates#
- cudaSignalExternalSemaphoresAsync / cudaWaitExternalSemaphoresAsync
Reason: Deprecate existing external semaphore structs and switch to structs binary compatible with driver structs
Change: Updated parameter struct types
Migration: Use new struct types for external semaphore operations
Deprecated APIs#
API Function |
Status |
|---|---|
CooperativeGroupLaunchMultiDevice |
Deprecated in 13.x |
Removed Header Files#
The following unused header files have been removed in CUDA 13.x:
Header File |
Replacement/Action |
|---|---|
|
Remove include statements |
|
Remove include statements |
|
Remove include statements |
|
Remove include statements |
Migration Guidelines#
Memory Management APIs: Update
cuMemPrefetchAsync,cuMemAdvise,cudaMemPrefetchAsync, andcudaMemAdvisecalls to use location structures instead of device IDs.Graph APIs: Add
NULL/nullptrparameters for newedgeDataparameters if not using enhanced graph features.Batch Copy APIs: Remove
failIdxparameters fromcuMemcpyBatchAsync,cuMemcpy3DBatchAsync,cudaMemcpyBatchAsync, andcudaMemcpy3DBatchAsynccalls.External Semaphores: Update struct types for external semaphore operations to use new binary-compatible versions.
Header Files: Remove includes for deprecated header files and update build scripts accordingly.
Context Creation: Update
cuCtxCreatecalls to use newCUctxCreateParamsparameter.