How does the cuda-memcheck option "--binary-patching yes" modify the checked binary?


Does anybody know, how does the cuda-memcheck option “–binary-patching yes” (default value) modify the checked binary?

The background of my question:

my application runs correctly in debug modus and release modus on all tested architectures (Pascal, Kepler) but not on Volta in release. Rare and variing output errors occur in release mode (but not in debug) on Volta V100. The cuda-memcheck cannot find any error with any of the available tools.

It is nevertheless interesting that when I check the release version with “cuda-memcheck --binary-patching yes” the output of the release on V100 is always correct, but with “–binary-patching false”, the errors occur as usual. With the knowledge about what is modified by this option, I hope to come closer to the core of the problem.

The cuda-memcheck doc only says, that the option "Controls whether CUDA-MEMCHECK should modify the application binary at runtime. This option is enabled by default. Setting this to “no” will reduce the precision of errors reported by the tool. Normal users will not need to modify this flag. " I could not find anything more about the feature in Internet.

This option adds patches that are executed prior to any memory access in order to check the validity of the address accessed. However, they should not impact the result of the program.

Is using “–binary-patching no” fixes the output for all tools or only memcheck?

If you are able to share the faulty code, I could take a closer look.