NVIDIA Nsight Visual Studio Edition似乎不能同时调试CPU(主机代码)和GPU(CUDA代码)。使用Nsight Eclipse版本(或cuda-gdb),这很简单,例如,您可以从主机执行步入CUDA内核。如何使用Visual Studio?
The NVIDIA Nsight Visual Studio Edition does not seem to be capable of debugging CPU (host code) and GPU (cuda code) at the same time. With the Nsight Eclipse Edition (or cuda-gdb) this is quite simple, for example, you can "step in" to a CUDA kernel from the host execution. How to do the same with Visual Studio?
推荐答案从 Nsight手册
它说
使用单独的Visual Studio实例来调试目标应用程序的主机部分。如果您希望在连接CUDA Debugger时调试CUDA 应用程序的主机部分,则必须使用附加不同的Visual Studio实例。附加的相同实例Visual Studio调试目标应用程序的主机部分和设备部分将导致调试器冲突。结果是目标应用程序和CUDA调试器挂起,而本地调试器的操作阻止了。
Use a separate Visual Studio instance to debug the host portion of a target application. If you wish to debug the host portion of your CUDA application while the CUDA Debugger is attached, you must attach using a different Visual Studio instance. Attaching the same instance of Visual Studio to debug both the host portion and the device portion of a target application will cause the debuggers to conflict. The result is that the target application and the CUDA Debugger hang while being blocked by operations of the native debugger.
因此,要调试CUDA应用程序,请执行以下步骤:
So to debug a CUDA application here are the steps:
额外功劳:远程调试CUDA应用程序。 步骤:
Extra credit: Debugging your CUDA application remotely. Steps:
注意:看起来VS的远程CPU调试不如其本地CPU调试那么有效。例如,当您将鼠标悬停在CPU变量上时,其值不会像您在进行本地调试时所期望的那样显示。
NOTE: It looks as if VS's remote CPU debugging is not as capable as its local CPU debugging. For example, when you mouse-over CPU variables, there values to not appear as you would expect when you are doing local debugging.
STILL未发送:是否可以在打开CUDA断点之前开始调试主机代码?这似乎是一个很大的限制,你只能调试主机代码 之后的第一个CUDA内核。如果您希望在第一个CUDA内核之前调试主机代码,该怎么办?
STILL UNANSWERED: Is it possible to start debugging the host code before hitting a CUDA breakpoint? It seems like a big limitation that you can only debug host code following your first CUDA kernel. What if you wish to debug the host code before the first CUDA kernel?
更多推荐
Nvidia视觉工作室Nsight CPU和GPU调试
发布评论