Failed to detect memory leak on Jetson device

I tried to use the following samples.

My environment is as follows.

  • Jetson Orin NX 16GB
  • CPU arch: aarch64
  • Jetson Linux 35.4.1
  • CUDA 11.4
  • Compute Sanitizer 2021.2.2

And, I add my account to debug group.
https://docs.nvidia.com/compute-sanitizer/ComputeSanitizer/index.html#tegra-setup

cd Memcheck
dbg=1 make
make run_leakcheck

As a result, Compute Sanitizer could not detect memory leak.

Running out_of_bounds_kernel: no error
========= LEAK SUMMARY: 0 bytes leaked in 0 allocations
========= ERROR SUMMARY: 2 errors

This sample requires CUDA 12.1 or newer (missing cudaDeviceReset, see release notes), which is currently not available on Jetson. Editing file memcheck_demo.cu by adding cudaDeviceReset(); before return 0; in main should address the issue.

Thank you for your reply.

I add cudaDeviceReset in main().
As a result, Compute Sanitizer could detect memory leak.

========= Leaked 1024 bytes at 0x2028ce000
=========     Saved host backtrace up to driver entry point at cudaMalloc time
=========     Host Frame: [0x1dc980]
=========                in /usr/lib/aarch64-linux-gnu/tegra/libcuda.so.1
=========     Host Frame: [0x42be0]
=========                in /home/dandelion/compute-sanitizer-samples/Memcheck/memcheck_demo
=========     Host Frame: [0xf854]
=========                in /home/dandelion/compute-sanitizer-samples/Memcheck/memcheck_demo
=========     Host Frame: [0x4fe2c]
=========                in /home/dandelion/compute-sanitizer-samples/Memcheck/memcheck_demo
=========     Host Frame: [0x97d8]
=========                in /home/dandelion/compute-sanitizer-samples/Memcheck/memcheck_demo
=========     Host Frame:__libc_start_main [0x20e10]
=========                in /lib/aarch64-linux-gnu/libc.so.6
=========     Host Frame: [0x9490]
=========                in /home/dandelion/compute-sanitizer-samples/Memcheck/memcheck_demo
========= 
========= LEAK SUMMARY: 1024 bytes leaked in 1 allocations

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.