Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to get and use CUDA Debugger API #48

Closed
rand-fly opened this issue May 7, 2024 · 2 comments
Closed

How to get and use CUDA Debugger API #48

rand-fly opened this issue May 7, 2024 · 2 comments

Comments

@rand-fly
Copy link

rand-fly commented May 7, 2024

The in-kernel checkpoint/restart relies on CUDA Debugger API to work, so
I tried to read Debugger API :: CUDA Toolkit Documentation (nvidia.com) but found it was unclearly documented, especially how to initialize the api, and how to attach and detach a program. I made some attempts but never successfully initialized CUDA Debugger API. I also looked into the code of cuda-gdb, but I found it didn't use CUDA Debugger API, but implemented its own set of debugger api by communicating directly to the driver and filled its own functions into the CUDBGAPI_st struct.

I looked into the code of the project and found the code called gdb_init and then just called cudbgGetAPI. I'm not sure what is happening here. How do you intergrate a part of cuda-gdb into your project and get CUDA Debugger API? Could you please explain this (and anything about CUDA Debugger API) for me? Does the raw CUDA Debugger API the same as the cuda-gdb implementation or it just can't work without cuda-gdb?

@n-eiling
Copy link
Member

You can compile gdb (and by therefore also cuda-gdb) as a library (make libgdb). Linking against that allows me to use the cuda-gdb Debugger API initialization.
I also tried several times to initialize the API myself. But even if I use the exact same methodology as cuda-gdb I couldn't get it to work. I even tried isolating the code from cuda-gdb to find out what it necessary for the initialization - but it never works if the initialization is called outside of cuda-gdb.
Linking to cuda-gdb is really annoying, but it was the only way I got it to work.

@rand-fly
Copy link
Author

Thank you for your reply. This is the best we can do now I think.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants