CUDA Memory Error Inspection Method

Hello, I’m Lee

I’m working on a CUDA project. However, “the main function” doesn’t work. To digging this problem, I checked stuffs. it caused by memory leackage which is attacted …

I’m tried to find this error Using Computer-Sanitizer and CUDA Memcheck to find this error
But it hasn’t been able to tell us where the problems come from

So, I’m postinng about this to know How Can I solve this memory problems

  1. When using cuda-memcheck or compute-sanitizer for NVIDIA, Is it possible to attach it to the APP in operation and inspect it?

  2. Cuda-memcheck or Compute-Sanitizer on NVIDIA when apps operating, is there any checking methods to solve various “CUDA memory errrors” by monitoring?

  3. Is there a way to monitor errors with CUDA Memcheck or Computer Sanitizer when testing units in “Visual Studio IDE”

  4. If there is no way, can you recommend another tool to solve these problems or recommend a company that can solve this problem?

I’m really want solve this problems…
Thank you.

Thank you for reaching out Lee! Unforutnately I am not sure I understood what you are asking here. Can you please provide more details? Also, feel free to attach a minimal reproduction example and I will be happy to look at it.

Hello. aladram
First of all, I’m sorry for the late response.

I think my previous question was too complicated(or wasn’t enough
So I prepared a more detailed explanation and situation.
First, I’d like to ask you this

We are currently developing software.
However, it was confirmed that there was a memory error during the software operation.
So I tried to solve it by using Compute Sanitizer (following how to use it)
As I proceeded with that, there was a problem with the software not working.
Is this the right way to use Compute sanitizer?

Additionally
The software we are developing does not use CUDA alone. Basically, we use the CPU at operation
Use the CUDA when necessary (such as the action of pressing a button).

Once again, I’m sorry for the late reply.
If you have any additional questions, I would appreciate it.

++ (Additional Questions)

  1. Is CUDAMEMCHECK only available for programs that use CUDA?

As I said before,
The software we develop uses not only CUDA, but also other development tools, so using CudaMemcheck causes problems
(Our problem: Software does not work when using CUDA Memcheck)

  1. Or at the same time as we use our software
    Is there a way to find a memory issue with Cudamemcheck?

  2. If we don’t have this method, I think we need to find a way to do CUDA Memcheck and test it anew, is that correct?

  3. Finally, we are using ASAN to check memory problems. Do you know any features like ASAN? Or if you know any other third party that can check memory problems, can you recommend them?

I’m sorry to ask so many things at once.
But I want to solve the problem

If there are any things you don’t understand, please let me know.
I’ll be waiting for your answer!!

Thanks Lee for your reply. If you have issues with a CUDA program, I recommend running it under Compute Sanitizer. For more information, please check the Compute Sanitizer documentation.

Example using a sample from our GitHub samples repository:

$ git clone --depth 1 https://github.com/NVIDIA/compute-sanitizer-samples
...
$ cd compute-sanitizer-samples/Memcheck/
$ make
...
$ compute-sanitizer --show-backtrace device ./memcheck_demo
========= COMPUTE-SANITIZER
Mallocing memory
========= Invalid __global__ write of size 4 bytes
=========     at unaligned_kernel()+0x30
=========     by thread (0,0,0) in block (0,0,0)
=========     Address 0x7efd85200001 is misaligned
=========     and is inside the nearest allocation at 0x7efd85200000 of size 4 bytes
=========
...
=========
========= ERROR SUMMARY: 4 errors

CUDA Memcheck is no longer supported, and should no longer be used. Compute Sanitizer is a drop-in replacement for CUDA Memcheck.