问题标签 [cuda-gdb]

For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.

0 投票
1 回答
1484 浏览

cuda - CUDA 内核指针参数变为 NULL

我的 CUDA 内核需要很多数组,这些数组需要作为指向内核的指针传递。问题是在内核启动之前,所有的指针都有有效的地址,而且cudaMalloccudaMemcpy调用总是返回cudaSuccess,但是一旦内核启动,所有这些参数都变为空!

我对正在发生的事情一无所知。这就是我运行代码时得到的cuda-gdb

有什么很明显的东西我错过了。提前致谢。

编辑 1: 正如 Gilles 所建议的,我正在尝试将主机指针和数据复制到结构中,然后复制到设备上。为了简单起见(MCVE),我在结构中只使用了一个指针:

当我检查 的值时d_struct->ptr,就在内核启动之前它显示给我0x0。(我在调试模式下使用 nsight 检查了这些值)

0 投票
1 回答
221 浏览

debugging - CUDA-GDB prints memory content using int format even though it should be float

In a CUDA C project, I have a pointer to float inside a structure called "p". It is a pointer to device memory and it is called "p->deviceOutput". I am using CUDA-GDB to check the content of this pointer during execution: when I try to print it this is what happens:

As you can see the printing returns something that looks like an int, definitely not a float. I am really sure the pointer is a pointer to float so I am really confused by this behaviour. Specifying the float format does not help:

Actually I get the same behaviour using GDB as well. I am working on Ubuntu 14.10 and my code was compiled with nvcc using -O0 and -g options.

Can anybody please explain what is going on and what should I do to inspect this memory location correctly? Thanks

0 投票
2 回答
3906 浏览

ubuntu - 所有 CUDA 设备都用于显示:无法从桌面环境中调试我的 CUDA 代码

自上周以来,我的 CUDA 开发设置遇到了一个大问题。我有一个集成的 GPU,我也连接了我的显示器和一个额外的 NVIDIA 卡,用于运行我的 CUDA 内核。但是,我不能再调试我的代码了,因为它说:

不知何故,我的 X-Server 似乎阻塞了我的 NVIDIA GPU,因为如果我切换到另一个虚拟控制台 (CTRL+ALT+F1),我就可以使用 cuda-gdb 运行我的代码。没有将显示器电缆插入 NVIDIA 卡...

“lsof /dev/nvidia*”没有给出任何输出。我正在使用 Xubuntu 14.04。

有谁知道如何解决这个问题?

0 投票
1 回答
2818 浏览

c++ - 检测到 Cuda API 错误时如何查找程序崩溃的位置:cudaMemcpy 返回(0xb)

我正在调试一个 cuda 程序并收到以下警告:

当我在 cuda-gdb 中输入“where”时,它会显示“no stack”。

应该如何找到我的程序崩溃的地方?

0 投票
1 回答
2070 浏览

cuda - How to run cuda-gdb in windows? Can I use cygwin for it?

I want to debug my application using cuda-gdb in windows. Is it possible to run cuda-gdb in windows? Will cygwin help to do it?

0 投票
1 回答
165 浏览

linux - 通过 cuda-gdb 调用内核故障?

有没有办法使用 cuda-gdb 调用内核故障?我尝试单步执行内核代码并设置无效的索引位置、变量的奇数值,但在从错误设置继续后我无法触发“内核执行失败”。

有谁知道通过 cuda-gdb 执行此操作的正确方法?我已经通读了两次 cuda-gdb 文档,但如果可能的话,我可能错过了一些关于如何实现这一点的线索。如果有人知道任何将不胜感激的工具/技术,谢谢。

我在 CentOS 7 上,我的设备的计算能力是 2.1。有关 uname -a 命令的输出,请参见下文。

0 投票
1 回答
2031 浏览

c++ - 调试时看不到任何变量值

我在 Ubuntu 16.04 上使用 Nsight。我当前的设置允许我通过 nsight IDE 完美地编译和运行我的代码。在确保程序在调试模式下构建(最初不是)之后,它终于允许我逐步完成我的代码。

我遇到的问题是每当我尝试调试我的代码时,所有变量都说“不可用”。另外,如果我将鼠标悬停在变量上,它会说“-var-create:无法创建变量对象”。这使它看起来像是编译器?也许它没有添加它应该做的事情?

Nsight 版本为 7.5,GCC & G++ 版本为 5.3.1,GDB 版本为 7.11,NVCC 版本为 7.5.17。

0 投票
1 回答
93 浏览

multithreading - cudaMalloc 产生的新线程 | 行为?

cudaMalloc似乎在调用它时产生了一个线程,即使它是异步的。在使用cuda-gdb. 在 alloc_mem_GPU 中调用 cudaMalloc 生成新线程

也花了一段时间才回来。

在程序结束时,虽然作为不同的 LWP 退出了相同的线程。

有人可以解释这种行为吗?

0 投票
1 回答
329 浏览

python - NSight gdb 错误

当我尝试调试时,IDE NSight (eclipse) 的“漂亮打印机”选项有问题。我已经用谷歌搜索了,但我还没有找到解决我的问题的方法。

当我开始调试时,出现下一条消息:

我不确定问题出在哪里,但变量值没有出现,唯一的解决方案是禁用漂亮的打印选项。

我使用的是 Ubuntu 16.04,并且 cuda 工具包是从存储库安装的。

如果有人可以提供帮助,我将不胜感激。

0 投票
1 回答
139 浏览

cuda - 检查当前驻留在 GPU 内存中的实体

检查已使用 cudaMalloc () 分配的实体(及其大小)当前驻留在 GPU 设备上的最简单方法是什么?我想在函数中找到内存泄漏,如果它只被调用一次并退出,则没有内存泄漏(通过 cuda-memcheck 检查),但如果多次调用,内存占用会越来越大。

Nsight Visual Profiler 对于我的要求似乎太复杂了,cuda-memcheck 没有发现泄漏!