cuda-memcheck报告了CUDA内核发布模式的这些信息:
========= Error: process didn't terminate successfully
========= Invalid __global__ read of size 4
========= at 0x000002c8 in xx_kernel
========= by thread (0,0,0) in block (0,0)
========= Address 0x10101600014 is out of bounds
=========
========= ERROR SUMMARY: 1 error
Run Code Online (Sandbox Code Playgroud)
此故障仅在发布模式下发生.在cuda-gdb下运行时也不会发生这种情况.
如何获取0x000002c8地址并确定导致错误的代码?我查看了缓存的中间文件(.ptx,.cubin等)并没有看到明确的方法来确定错误的源代码.
这是在带有CUDA 3.2的x86_64 Linux上.
更新:原来这是3.2中的编译器错误.升级到4.0会使memcheck错误消失.此外,我能够使用4.0中的cuobjdump来反汇编CUBIN,但由于它是发布模式并进行了优化,因此将反汇编与源代码相匹配非常困难.