Does runtime API will call drive API?

I am learning CUDA Runtime API and Driver API, i understand Driver API apply more fine-grained operation than Runtime API and they have similar functions.

But I have a question, does runtime API will call drive API?

For example, cudaMalloc in Runtime API, and cuMemAlloc in Driver API, both of them has similar function, that is allocates memory.

Dose cudaMalloc will call cuMemAlloc to achieve this function? Or they all have a corresponding lower-level implementation, there is no calling relationship in Runtime and Driver.

Or some of Runtime API call Driver API, some of them don’t.

Yes, runtime API will call driver API. You can see the calls in the API trace of nsight compute.

,ID,API Name,Details,Func Return,Func Parameter,Start,Duration,Queued,Submitted
:,529,cudaSetDevice,,cudaSuccess(0),(0),,,,
:,530,   cuCtxSetCurrent,,CUDA_SUCCESS(0),(0x55be4bf0e940),,,,
:,531,   cuCtxGetCurrent,,CUDA_SUCCESS(0),(0x7ffca42bc2e8{0x55be4bf0e940}),,,,
:,532,   cuDevicePrimaryCtxRetain,,CUDA_SUCCESS(0),"(0x7ffca42bc2a8{0x55be4bf0e940}, 0x0)",,,,
:,533,   cuCtxGetCurrent,,CUDA_SUCCESS(0),(0x7ffca42bc2e8{0x55be4bf0e940}),,,,
:,534,   cuCtxGetDevice,,CUDA_SUCCESS(0),(0x7ffca42bc2d8{0x0}),,,,
:,535,cudaFree,,cudaSuccess(0),(0x0),,,,
:,536,   cuMemFree_v2,,CUDA_SUCCESS(0),(0x0),,,,
:,537,cudaMalloc,,cudaSuccess(0),"(0x7ffca42bc508{0x7f47fa000000}, 4000000000)",,,,
:,538,   cuMemAlloc_v2,,CUDA_SUCCESS(0),"(0x7ffca42bc508{0x7f47fa000000}, 4000000000)",,,,
:,539,cudaGetDevice,,cudaSuccess(0),(0x7ffca42bc120{0}),,,,
:,540,   cuCtxGetDevice,,CUDA_SUCCESS(0),(0x7ffca42bbfdc{0x0}),,,,

@striker159 Thanks for your answer, but how to output this in CLI?