gpt4 book ai didi

cuda - Nsight 跳过(忽略)VS10 Cuda 中的断点工作正常,nsight 始终跳过多个断点

转载 作者:行者123 更新时间:2023-12-04 18:12:24 27 4
gpt4 key购买 nike

我正在使用 nsight 2.2、Toolkit 4.2、最新的 nvidia 驱动程序,我在我的计算机中使用了几个 GPU。构建自定义 4.2。我在 CUDA 的项目属性上设置了“生成 GPU 输出”,nsight 监视器已打开(一切看起来都很棒)。

我在全局内核函数上设置了几个断点。 nsight 在函数声明处停止,但会跳过几个断点。这就像 nsight 决定是打断点还是跳过断点一样。有趣的是,nsight 在 for 循环处停止,但不会在简单的赋值操作上停止。

还有一个问题是我无法设置焦点或向监视列表添加变量。在这种情况下(见附件截图)我无法解析变量的值:“posss”或“testDetctoinRate1”在这种情况下是寄存器。另一方面,共享内存或块内存会自动插入到本地列表中。

Here is a screen shot of the kernel, before debugging

Here is a screen shot during debugging

我通过以下调用唤起了我的内核函数:

checkCUDA<<<1, 32>>>(sumMat->rows,sumMat->cols , (UINT *)pGPUsumMat); 
cudaError = cudaGetLastError();
if(cudaError != cudaSuccess)
{
printf("CUDA error: %s\n", cudaGetErrorString(cudaError));
exit(-1);
}

内核调用工作没有错误。

是否有任何选项可以在所有断点处强制 nsight 停止?如何将线程的寄存器添加到我的监视列表中?

更新

最初,我的调试命令行如下:
# Runtime API (NVCC Compilation Type is hybrid object or .c file)
set CUDAFE_FLAGS=--sdk_dir "c:\Program Files\Microsoft SDKs\Windows\v7.0A\"
"C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v4.2\bin\nvcc.exe" --use-local-env --cl-version 2010 -ccbin "C:\Program Files\Microsoft Visual Studio 10.0\VC\bin" -I"..\..\..\opencv\modules\gpu\src\opencv2\gpu\device" -I"..\..\..\opencv\modules\gpu\include\opencv2\gpu" -I"..\..\..\build\include\\" -G --keep-dir "Debug" -maxrregcount=0 --machine 32 --compile -g -Xcompiler "/EHsc /nologo /Od /Zi /MDd " -o "Debug\%(Filename)%(Extension).obj" "%(FullPath)"

我在属性页上更改了 --> cuda --> 主机 --> 生成托管调试信息 --> 否

现在我的命令行不包含 -g 和 -O 字母,我的命令行如下:
# Runtime API (NVCC Compilation Type is hybrid object or .c file)
set CUDAFE_FLAGS=--sdk_dir "c:\Program Files\Microsoft SDKs\Windows\v7.0A\"
"C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v4.2\bin\nvcc.exe" --use-local-env --cl-version 2010 -ccbin "C:\Program Files\Microsoft Visual Studio 10.0\VC\bin" -I"..\..\..\opencv\modules\gpu\src\opencv2\gpu\device" -I"..\..\..\opencv\modules\gpu\include\opencv2\gpu" -I"..\..\..\build\include\\" -G --keep-dir "Debug" -maxrregcount=0 --machine 32 --compile -Xcompiler "/EHsc /nologo /Od /Zi /MDd " -o "Debug\%(Filename)%(Extension).obj" "%(FullPath)"

虽然,我使用 -o 进行调试, 有关系吗?它不会做任何改变。

最佳答案

在解决方案资源管理器中右键单击 .cu 文件,然后转到 CUDA C/C++ | Device并设置 Generate GPU Debug InformationYes (-G0) .

关于cuda - Nsight 跳过(忽略)VS10 Cuda 中的断点工作正常,nsight 始终跳过多个断点,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10827995/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com