how do I prevent cuda-gdb from optimizing out any value ( whether device or host, local or global )? I have checked nvidia forums but most of them are years old and there seems to be not a solution for old cuda versions, but is there one for the newest one (cuda 9.2 and sm 61)?
I am using flags described in nvidia's documentation:
-g
- "Generate debug information for host code."
-G
- "Generate debug information for device code. Turns off all optimizations. Don't use for profiling; use -lineinfo instead."
how do I prevent cuda-gdb from optimizing out any value
The cuda-gdb
is not optimizing anything; it is just interpreting the debug info that the compiler (nvcc
) put into the binary.
If the compiler chose not to describe location of some variable, then there is nothing cuda-gdb
can do to recover that info. This would generally be a quality of debugging info issue with nvcc
.
It's possible that nvcc
did describe the location you are after, but cuda-gdb
is failing to handle that description, in which case it's a bug in cuda-gdb
.
In either case, you can't really do anything about it, other than complaining to NVidia.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With