Skip to content

When I use a cuda function, how do I find the call chain corresponding to the function in the driver. #337

Answered by aritger
wenhaopang asked this question in Q&A
Discussion options

You must be logged in to vote

There isn't a clear mapping between function calls made to the CUDA user-mode driver and functions within the open kernel modules
in this repository. There is a lot of logic implemented in the CUDA user-mode driver. So, it isn't a thin wrapper over kernel system calls (in contrast to something like glibc).

To answer your question, probably the best thing to do would be to trace the entry points into the kernel drivers (e.g., spinkling some printks or similar). Most of the interesting calls will start with the fileops in kernel-open/nvidia/nv.c, and most of those will be ioctl. I would suggest to start with this call chain:

kernel-open/nvidia/nv.c:nvidia_ioctl()
  src/nvidia/arch/nvalloc/u…

Replies: 2 comments 5 replies

Comment options

You must be logged in to vote
5 replies
@wenhaopang
Comment options

@YusufKhan-gamedev
Comment options

@wenhaopang
Comment options

@YusufKhan-gamedev
Comment options

@wenhaopang
Comment options

Answer selected by wenhaopang
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
4 participants