I tried to use the following samples.
My environment is as follows.
- CPU arch: x86_64
- Ubuntu 22.04
- CUDA 12.1
- Compute Sanitizer 2023.1.0
- NVIDIA Driver 530.30.02
At first, I used memcheck_demo.
cd Memcheck
dbg=1 make
make run_leakcheck
As a result, I could check memory leak.
But, this tool does not show the information of source code and line number.
Is this expected behavior?
========= Leaked 1,024 bytes at 0x7f298bc00000
========= Saved host backtrace up to driver entry point at allocation time
========= Host Frame: [0x2b9d27]
========= in /lib/x86_64-linux-gnu/libcuda.so.1
========= Host Frame:__cudart600 [0x43ace]
========= in /home/dandelion/compute-sanitizer-samples/Memcheck/memcheck_demo
========= Host Frame:__cudart609 [0x10f2b]
========= in /home/dandelion/compute-sanitizer-samples/Memcheck/memcheck_demo
========= Host Frame:cudaMalloc [0x517c2]
========= in /home/dandelion/compute-sanitizer-samples/Memcheck/memcheck_demo
========= Host Frame:main [0xae3d]
========= in /home/dandelion/compute-sanitizer-samples/Memcheck/memcheck_demo
========= Host Frame:../sysdeps/nptl/libc_start_call_main.h:58:__libc_start_call_main [0x29d90]
========= in /lib/x86_64-linux-gnu/libc.so.6
========= Host Frame:../csu/libc-start.c:379:__libc_start_main [0x29e40]
========= in /lib/x86_64-linux-gnu/libc.so.6
========= Host Frame:_start [0xab05]
========= in /home/dandelion/compute-sanitizer-samples/Memcheck/memcheck_demo
I checked the document of Compute Sanitizer.
But, I could not find the information from the known issue and limitation.
- https://docs.nvidia.com/compute-sanitizer/ReleaseNotes/index.html#known-limitations
- https://docs.nvidia.com/compute-sanitizer/ReleaseNotes/index.html#known-issues
On the other hands, racecheck tool shows the information of source code and line number.
cd Racecheck
dbg=1 make
make run_block_error
========= COMPUTE-SANITIZER
========= Error: Race reported between Write access at 0x400 in /home/dandelion/compute-sanitizer-samples/Racecheck/block_error.cu:41:sumKernel(int *, int *)
========= and Read access at 0x700 in /home/dandelion/compute-sanitizer-samples/Racecheck/block_error.cu:51:sumKernel(int *, int *) [508 hazards]
=========
========= RACECHECK SUMMARY: 1 hazard displayed (1 error, 0 warnings)