python call cuda DLL, how can i debug into dll

my python code call cuda dll. I have all source code for python and cuda. How can I debug into cuda DLL?

thanks!

if you has Nsight Project for your cuda DLL.
the simple way is set your Project CUDA is active, and set [Project properity>Debugging>Command] to your python command and set corresponding command Arguments and Working Directory.

I follow your steps and find that. this way is different from Night CUDA debugging, because I cannot see actual value of variables on GPU. it more like debug on CPU side, am I right?

I also try Nsight CUDA debugging directly: config “Nsight user setting” of CUDA project. set “launch external program” to C:\Anaconda\python.exe and following command line args. I find the break points set in CUDA code are useless. That’s to say python.exe call output CUDA DLL. it does not stop at break points. I do not know why like this.

Here is the python code for loading CUDA DLL:

self.libmodel = import(MyDLL)

BTW, my output DLL file is in release , but not debug. because pass under release config. Does this impact anything?

I also try Nsight CUDA debugging directly: config “Nsight user setting” of CUDA project. set “launch external program” to C:\Anaconda\python.exe and following command line args. I find the break points set in CUDA code are useless. That’s to say python.exe call output CUDA DLL. it does not stop at break points. I do not know why like this.

this is right, you should use NSight user setting. The reason for not stopping at break points is that you use release DLL without Debug symbol Info. You should use debug version.