0

我在我的 Ubuntu 12.10 64 位上安装了 cuda 5。我有一个 GTX 675M,所以我使用 bumblebee 在我的 cuda 设备上运行应用程序。我正在通过 bumblebee (optirun) 运行 nsight:

frederico@zeus:~$ optirun /usr/local/cuda/libnsight/nsight

它工作得很好,我可以编译和执行应用程序。问题是当我尝试在 nsight 中使用 cuda-gdb 时,单击调试按钮时出现以下错误:

No source available for "main() at 0x403c6f" 

但是如果我尝试在控制台上使用 cuda-gdb 它可以工作:

frederico@zeus:~/Dropbox/coisas/projetos/delta_cuda$ optirun cuda-gdb bin/linux/release/gpu_md5 
NVIDIA (R) CUDA Debugger
5.0 release
Portions Copyright (C) 2007-2012 NVIDIA Corporation
GNU gdb (GDB) 7.2
Copyright (C) 2010 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-unknown-linux-gnu".
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>...
Reading symbols from /home/frederico/Dropbox/coisas/projetos/delta_cuda/bin/linux/release/gpu_md5...done.
(cuda-gdb) run
Starting program: /home/frederico/Dropbox/coisas/projetos/delta_cuda/bin/linux/release/gpu_md5 
[Thread debugging using libthread_db enabled]
[New Thread 0x7ffff1dfe700 (LWP 10437)]
[New Thread 0x7ffff07f7700 (LWP 10438)]
[New Thread 0x7fffb07f6700 (LWP 10439)]
[New Thread 0x7fff6bfff700 (LWP 10440)]
[New Thread 0x7fff23fff700 (LWP 10441)]
[New Thread 0x7ffedbfff700 (LWP 10442)]
[New Thread 0x7ffe93fff700 (LWP 10443)]
[New Thread 0x7ffe4bfff700 (LWP 10444)]
[New Thread 0x7ffe03fff700 (LWP 10445)]
[Thread 0x7ffe03fff700 (LWP 10445) exited]
[Thread 0x7fffb07f6700 (LWP 10439) exited]
[Thread 0x7ffe4bfff700 (LWP 10444) exited]
[Thread 0x7fff23fff700 (LWP 10441) exited]
[Thread 0x7ffe93fff700 (LWP 10443) exited]
[Thread 0x7ffedbfff700 (LWP 10442) exited]
[Thread 0x7ffff07f7700 (LWP 10438) exited]
[Thread 0x7fff6bfff700 (LWP 10440) exited]
[Thread 0x7ffff1dfe700 (LWP 10437) exited]

Program exited with code 030.
(cuda-gdb) 

知道会发生什么吗?

4

1 回答 1

1

当您的应用程序挂起时,将打印该消息。这意味着您的应用程序没有使用调试信息进行编译 - 在这种情况下,调试器无法将您的指令映射到源代码行。

要在命令行 cuda-gdb 中重现此消息,您需要在断点处暂停,例如在执行“运行”之前执行“中断主”

更新 - 对于将来某个时候有类似问题的人

应用程序构建如下:

  1. CUDA 内核代码使用 NVCC 编译并包含调试信息。例如,NVCC 电话是:nvcc -g -G -c mykernel.cu -o mykernel.o
  2. 此目标文件与 GCC 编译的其他目标文件链接,但未生成调试信息 - g++ mycpp1.cpp mycpp2.cpp mykernel.cu -o mycudaapplication. 这导致一些部分调试信息不​​足以让 cuda-gdb 正确解析路径。

Nsight Eclipse 版在调试 CUDA 应用程序时默认依赖 cuda-gdb 源路径解析来查找要在编辑器中打开的文件。

于 2012-10-22T17:18:06.633 回答