-
Notifications
You must be signed in to change notification settings - Fork 100
QUDA Debugging
QUDA supports address and undefined sanitizers to aid in finding subtle, difficult to find memory bugs. To enable the use of sanitizers, ensure that you build with g++ or clang++, and set -DCMAKE_BUILD_TYPE=SANITIZE
. This will build QUDA with both the address and undefined sanitizers enabled (-fsanitize=address,undefined
).
Due to conflicts with running the CUDA driver with address sanitizer, it is necessary to set the run-time environment variable ASAN_OPTIONS="protect_shadow_gap=0"
when running. Memory leak checking can be disable if desired with detect_leaks=0
(default is enabled).
To run with maximum checking enabled use
ASAN_OPTIONS=protect_shadow_gap=0,strict_string_checks=1:detect_stack_use_after_return=1:check_initialization_order=1:strict_init_order=1
The use of these run-time sanitizers has been critical in finding bugs in QUDA, and should be complimentary to running with valgrind
.