cuda中的断点不起作用!

发布于 2024-09-19 08:09:37 字数 194 浏览 1 评论 0原文

用一个非常简单的代码,hello world,断点不起作用。 我无法写出确切的评论,因为它不是用英文写的, 但它就像“该文档的符号未加载”之类的。

没有cuda代码,main函数中只有一行printf。

工作环境为windows7 64bit、vc++2008 sp1、cuda toolkit 3.1 64bits。 请给我一些解释。 :)

with a very simple code, hello world, the breakpoint is not working.
I can't write the exact comment since it's not written in English,
but it's like 'the symbols of this document are not loaded' or something.

there's not cuda codes, just only one line printf in main function.

The working environment is windows7 64bit, vc++2008 sp1, cuda toolkit 3.1 64bits.
Please give me some explanation on this. :)

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

§对你不离不弃 2024-09-26 08:09:38

那么这只是一个主机应用程序(即与 CUDA 无关)执行 printf 操作,您无法调试?您是否选择“调试”作为配置而不是“发布”?

So this is just a host application (i.e. nothing to do with CUDA) doing printf that you can't debug? Have you selected "Debug" as the configuration instead of "Release"?

拔了角的鹿 2024-09-26 08:09:38

您是否尝试使用 Visual Studio 断点来停止 CUDA 设备代码 (.cu)?如果是这样的话,那么我很确定你不能这样做。 NVIDIA 已经发布了 Parallel NSIGHT,它应该允许您对 CUDA 设备代码 (.cu) 进行调试,尽管我自己对此没有太多经验。

Are you trying to use a Visual Studio breakpoint to stop in your CUDA device code (.cu)? If that is the case, then I'm pretty sure that you can't do that. NVIDIA has released Parallel NSIGHT, which should allow you to do debugging of CUDA device code (.cu), though I don't have much experience with it myself.

岛歌少女 2024-09-26 08:09:38

您是否按照文档中所述使用 -g -G 选项进行编译?

NVCC, the NVIDIA CUDA compiler driver, provides a mechanism for generating the debugging information necessary for CUDA-GDB to work properly. The -g -G option pair must be passed to NVCC when an application is compiled for ease of debugging with CUDA-GDB; for example,

nvcc -g -G foo.cu -o foo

此处: https://docs.nvidia.com/cuda/cuda-gdb/索引.html

Did you compile with -g -G options as noted in the documentation?

NVCC, the NVIDIA CUDA compiler driver, provides a mechanism for generating the debugging information necessary for CUDA-GDB to work properly. The -g -G option pair must be passed to NVCC when an application is compiled for ease of debugging with CUDA-GDB; for example,

nvcc -g -G foo.cu -o foo

here: https://docs.nvidia.com/cuda/cuda-gdb/index.html

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文