c++ - CUDA-GDB 在 C/C++ 中查看变量

标签 c++ cuda ubuntu-16.04 cuda-gdb

我已经安装了 NVIDIA 提供的最新版本的 CUDA 驱动程序

mmiller@host:~/NVIDIA_CUDA-7.5_Samples$ nvcc --version
nvcc: NVIDIA (R) Cuda compiler driver
Copyright (c) 2005-2015 NVIDIA Corporation
Built on Tue_Aug_11_14:27:32_CDT_2015
Cuda compilation tools, release 7.5, V7.5.17

但是当我调试程序时,我收到一条关于 python 的错误消息。

mmiller@csit-crackin:~$ cuda-gdb hello.out
NVIDIA (R) CUDA Debugger
7.5 release
Portions Copyright (C) 2007-2015 NVIDIA Corporation
GNU gdb (GDB) 7.6.2
Copyright (C) 2013 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/mmiller/hello.out...done.
(cuda-gdb) b main
Breakpoint 1 at 0x402546: file hello.cu, line 3.
(cuda-gdb) r
Starting program: /home/mmiller/hello.out
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".

Breakpoint 1, main () at hello.cu:3
3       foo:    int x = 1;
(cuda-gdb) s
4               int y = x+1;
(cuda-gdb) p x
Python Exception <type 'exceptions.AttributeError'> 'gdb.Type' object has no attribute 'name':
Python Exception <type 'exceptions.AttributeError'> 'gdb.Type' object has no attribute 'name':
$1 = 1
(cuda-gdb)

我的程序是一个非常简单的程序,我读到它可能是处理 python 和 gdb 的错误,但我不确定如何使用 Ubuntu 和 Nvidia 的最新软件修复错误。关于如何解决这个问题有什么建议吗?

最佳答案

看来 Ubuntu 不会更新路径以包含最新版本的 nvcc 和 cuda-gdb。您必须手动更新路径(或更改符号链接(symbolic link))才能引用这些库的正确版本。

关于c++ - CUDA-GDB 在 C/C++ 中查看变量,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43621990/

相关文章:

linux - docker 执行 : rpc error: code = 2 desc = oci runtime error: exec failed

多模式的 C++ 模板类实现

c++ - 为什么指向函数的指针不能绑定(bind)到左值引用,而函数可以?

docker -/var/run/docker.sock:没有这样的文件或目录

c++ - 如果无法在条件分支内调用 __syncthreads,如何减少 CUDA?

c++ - 内核调用产生错误 "error: a host function call cannot be configured"。调用有什么问题?

c++ - 如何在 Ubuntu 上安装 Rose 编译器?

c++ - 如何声明和分配指针

c++ - 在 MPI 通信器之间复制数据

c++ - 在哪里可以找到 cuda 4.1 的 cuda.rule 文件