我正在运行cuda-memcheck
来调试我的代码,输出如下
========= Program hit cudaErrorCudartUnloading (error 29) due to "driver shutting down" on CUDA API call to cudaFree.
========= Saved host backtrace up to driver entry point at error
========= Host Frame:/usr/lib/x86_64-linux-gnu/libcuda.so.1 [0x2e40d3]
========= Host Frame:./nmt [0x53526]
========= Host Frame:./nmt [0xfbd9]
terminate called after throwing an instance of '========= Host Frame:/lib/x86_64-linux-gnu/libc.so.6 [0x3c259]
========= Host Frame:/lib/x86_64-linux-gnu/libc.so.6 [0x3c2a5]
========= Host Frame:/lib/x86_64-linux-gnu/libc.so.6 (__libc_start_main + 0xfc) [0x21ecc]
thrust::system::system_error'
========= Host Frame:./nmt [0x530a]
=========
what(): driver shutting down
========= Error: process didn't terminate successfully
========= Internal error (20)
========= No CUDA-MEMCHECK results found
是否可以从代码中的Host Frame:./nmt [0x53526]
行中断?如果是这样,我该怎么做?
感谢。
答案 0 :(得分:2)
正如@talonmies指出的那样(我怀疑他不会介意我发布CW答案),cuda-memcheck
工具提供额外的堆栈反向跟踪功能,可以通过添加--show-backtrace
开关启用命令行。
后向跟踪可以包括主机和设备功能(即主机和设备返回跟踪)。
如果应用程序也使用主机调试符号信息编译(例如Linux上的-g
),则cuda-memcheck
可以显示主机回溯中主机功能的函数名称。
documentation中提供了其他使用信息。