0

I am trying to get memory traces from cuda-gdb. However, I am not able to step into the kernel code. I use the nvcc flags -g -G and -keep but to no effect. I am able to put a breakpoint on the kernel function but when I try to access the next instruction, it jump to the end of the kernel function. I have tried this on the sdk examples and I observe the same behaviour. I am working on cuda 5 toolkit. Any suggestions? Thanks!

4

1 回答 1

1

此行为是内核启动失败的典型行为。确保检查 CUDA 调用的返回码。请注意,对于调试,您可能希望cudaDeviceSynchronize在内核调用之后立即添加额外的调用并检查此调用的返回代码 - 这是获取异步内核启动失败原因的最精确方法。

更新:在调试器之外运行但不在 cuda-gdb 中运行的代码通常是由于尝试从图形环境在单 GPU 系统上调试引起的。cuda-gdb 不能与 Xwindows 共享 GPU,因为这会挂起操作系统。

如果您的系统只有一个 GPU,您需要退出图形环境(例如退出 X 窗口)并从控制台进行调试。

如果您有一个多 GPU 系统,那么您应该检查您的 Xwindow 配置 (Xorg.conf),以便它不会使用您为调试保留的 GPU。

于 2013-06-19T00:57:02.070 回答