Trace function name from cuda-memcheck output
I run to cuda-memcheck
to debug my code and the output looks like this
========= 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
Can you tell by line Host Frame:./nmt [0x53526]
where the code is broken? If so, how can I do this?
Thank.
source to share
As @talonmies pointed out (I suspect he doesn't mind if I post a CW answer), the tool cuda-memcheck
provides an additional stack tracking feature that can be enabled with a switch --show-backtrace
added to the command line.
A trace trace can consist of host and device functions (i.e., host and device traces).
If the application was also compiled with host debug symbol information (for example, -g
on linux), then it cuda-memcheck
can map function names for host functions in the host backtrace.
Additional usage information is available in the documentation .
source to share