Is compute-sanitizer compatible with NVDec?

I have an application that uses NVDec together with several image filtering kernels. The call to get the decoded frame is:

cuvidMapVideoFrame(state->cuDecoder, pPicParams->picture_index, &devPtr, &pitch, &vpp);

devPtr is returned as a device pointer to the decoded frame data. After this I do a memcpy:

cuMemcpy(gpu0, devPtr, nvh * pitch);

where gpu0 has been properly allocated.

Running compute-sanitizer initcheck on the application fails, saying that devPtr memory was not initialized. But it was loaded by NVDec. I tried writing 4 bytes to devPtr as an experiment but it failed as apparently NVDec does not allow writing to the decoded frame buffer.

memcheck, racecheck, and synccheck all pass.

Your advice to get this through initcheck would be appreciated. Thank you.

Thank you for your post! This is most likely a false positive, as I am assuming this is caused by the pitch (each end of row is uninitialized). You can ignore these errors using our error suppression feature: Compute Sanitizer User Manual :: Compute Sanitizer Documentation

Thank you, sir, for your response. I will try to ignore the error. Are you confirming that the NVDec loading of devPtr should have been fine if the width and pitch were the same, i.e, if all of devPtr was initialized? In other words, is compute-sanitizer aware of NVDec and what it is doing?

Correct! If width equal pitch does not work for you (i.e. throws initcheck errors), feel free to provide a minimal reproducer and I can look into it.

I can’t control the pitch that NVDec decides on. I’ll be happy to just ignore the error but I can’t figure out how. I added [–xml on --save d:\tmp\error.txt] but the file was not created. Note that the check output still comes to the stdout and I have to terminate the application because it wants to decode 2000 frames and I get an error for each one. Thank you.

Note: I had two dashes for xml but the forum code changes it.

Can you please provide information on the compute-sanitizer version you are using?

$ compute-sanitizer --version
NVIDIA (R) Compute Sanitizer
Copyright (c) 2020-2023 NVIDIA Corporation
...

Yes sir.

NVIDIA (R) Compute Sanitizer
Copyright (c) 2020-2022 NVIDIA Corporation
Version 2022.2.0

Suppressions require version 2023.3, can you please try it? You can download it as part of the CUDA 12.3 release: https://developer.nvidia.com/cuda-downloads

Please note that, even if you do not use the CUDA 12.3 toolkit to build your application, you can still use compute-sanitizer that is shipped with it. You do need however to install the driver provided with the toolkit for compute-sanitizer 2023.3 to work. Thanks!

Which driver are you referring to please? I have a specific 3090 graphics card driver that I run. It is not the latest because the latest has some regressions.

Sanitizer 2023.3 requires a 525 driver version or newer. If your current driver meets this requirements, you don’t need to install a new one. Thanks!

Ouch, that hurts. I run 516 because in 525 NVDec’s VPP has a broken deinterlacer. Guess it’s time to report that to the NVDec guys. I hope they are as responsive as you. ;)

I really do appreciate your excellent support and responsiveness.

1 Like

516 and 525 are both quite old, so it is probably worth trying using our latest driver released in 2024: GeForce Game Ready Driver | 551.23 | Windows 10 64-bit, Windows 11 | NVIDIA

Please let me know if I can be of any further help. Thanks!

I’ll give that a try. Just for fun I tried the new sanitizer but it said it needed 525 or better. I’m upgrading to a 4090 so will probably have to upgrade the driver in any case. I will keep you informed, sir, and thank you for your professional and dedicated approach. I would hope to match that in my support for my products!

I’m back! I upgraded to the latest driver (551.23). But now my sanitizer command fails. Here it is:

“C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.3\compute-sanitizer\compute-sanitizer” --tool initcheck --save “d:\tmp\error.xml” --xml on C:\Standalone\VirtualDub2\VirtualDub64.exe “D:\Don\Programming\C++\DGDecNV\DGDecodeNV Opt+H2S+DN\Test\nostalghia.avs”

The failure is:

========= COMPUTE-SANITIZER
========= Target application doesn’t exist or is not a valid executable

What did I do wrong? It ran with the earlier version of sanitizer. VirtualDub64.exe exists and is a valid application.

EDIT: When I deleted the --save and --xml options it runs.

You need to replace--xml on with --xml following changes from our 2023.3 version. Feel free to let me know if it works.

Cool. I have the xml file now. What do I do with it to suppress the error? Thank you.

You can pass it to the suppressions command-line flag, see Compute Sanitizer User Manual :: Compute Sanitizer Documentation for more information. Thanks!

I did that but it did not suppress the error. :(

EDIT: Address and size matches the xml file.

EDIT2: stdout gives the address in hex while xml gives it in decimal. I hope that is not a problem when it says they must match.

Can you please provide a minimal reproducer so I can take a look at it?

Well, that’s going to be difficult to impossible, because I will have to develop a minimal NVDec decoder application with a filter kernel etc.

Is this kind of thing covered in your test suite?

Looks like we hit the wall. :(