首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >如何在使用g++编译静态库的nvcc链接程序中使用cuda-gdb?

如何在使用g++编译静态库的nvcc链接程序中使用cuda-gdb?
EN

Stack Overflow用户
提问于 2012-11-29 01:50:28
回答 1查看 1.7K关注 0票数 0

我正在为一个g++链接项目开发一个nvcc编译的静态库。如何在最终的可执行文件上使用cuda-gdb?我得到的只是"Program exited“,没有任何printf输出或任何东西。

在编译静态库时,nvcc肯定会被赋予-g -G参数。

下面是我的命令行缓冲区:

代码语言:javascript
复制
cuda-gdb /home/sean/cuda-workspace/cudasplat/Debug/cudasplat 
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/sean/cuda-workspace/cudasplat/Debug/cudasplat...done.
(cuda-gdb) set args -t a1-31 a2-31 a3-31 a4-31 -L 30 -o tx_coverage -d /var/www/userman/plot-temp/ -db -85 -ngs -dbm -R 20
(cuda-gdb) run
Starting program: /home/sean/cuda-workspace/cudasplat/Debug/cudasplat -t a1-31 a2-31 a3-31 a4-31 -L 30 -o tx_coverage -d /var/www/userman/plot-temp/ -db -85 -ngs -dbm -R 20
[Thread debugging using libthread_db enabled]
Exiting...

Program exited normally.
(cuda-gdb)

这是在没有调试的情况下通常会发生的事情:

代码语言:javascript
复制
/home/sean/cuda-workspace/cudasplat/Debug/cudasplat -t  a1-31 a2-31 a3-31 a4-31 -L 30 -o tx_coverage -d /var/www/userman/plot-temp/ -db -85 -ngs -dbm -R 20
            --==[ Welcome To CUDASPLAT! HD v1.4.0a ]==--

Loading "51:52:113:114-hd.sdf" into page 1... Done!
Loading "50:51:113:114-hd.sdf" into page 2... Done!
Loading "50:51:114:115-hd.sdf" into page 3... Done!
Loading "51:52:114:115-hd.sdf" into page 4... Done!
copying 444 mb into device memory (3878 mb free)
finished copy
min_north 50, max_north 52, min_west 113, max_west 115
allocated antenna memory
invalid argument in ../cudapath.cu at line 551
EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2012-11-29 03:08:36

  1. 您应该在发出run命令之前设置断点。
  2. 您的应用程序是否执行正确的错误检查?请注意,cuda-gdb可能会“隐藏”用于呈现操作系统图形界面的GPU。例如,如果您有一个GPU系统,并且在窗口环境(如GTK或KDE)中从cuda-gdb运行CUDA应用程序,则您的应用程序可能会失败,因为将不会检测到任何GPU。
票数 2
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/13611342

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档