# Errors reported by compute-sanitizer for cuvidCreateDecoder

**URL:** <https://forums.developer.nvidia.com/t/errors-reported-by-compute-sanitizer-for-cuvidcreatedecoder/317461>\
**Category:** Video Codec, PyNv & OFA\
**Created:** [December 19, 2024, 11:30am UTC](https://forums.developer.nvidia.com/t/errors-reported-by-compute-sanitizer-for-cuvidcreatedecoder/317461 "2024-12-19T11:30:21Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![gabgab](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@gabgab](https://forums.developer.nvidia.com/u/gabgab)\
**Post date:** [December 19, 2024, 11:30am UTC](https://forums.developer.nvidia.com/t/errors-reported-by-compute-sanitizer-for-cuvidcreatedecoder/317461/1 "2024-12-19T11:30:21Z")

</div>

Hello,

I’m getting an error from compute-sanitizer when using cuvid decoder :

nvcc --version : **release 12.6, V12.6.77**  
Using latest video codec SDK : **Video\_Codec\_SDK\_12.2.72**

> ========= COMPUTE-SANITIZER  
> ========= Program hit CUDA\_ERROR\_INVALID\_VALUE (error 1) due to “invalid argument” on CUDA API call to cuArrayGetPlane.  
> ========= Saved host backtrace up to driver entry point at error  
> ========= Host Frame: [0x27fc24]  
> ========= in /lib/x86\_64-linux-gnu/libcuda.so.1  
> ========= Host Frame: [0x2a45a]  
> ========= in /lib/x86\_64-linux-gnu/libnvcuvid.so.1  
> ========= Host Frame: [0x25621]  
> ========= in /lib/x86\_64-linux-gnu/libnvcuvid.so.1  
> ========= Host Frame: [0x30006]  
> ========= in /lib/x86\_64-linux-gnu/libnvcuvid.so.1  
> ========= Host Frame: [0x33c60]  
> ========= in /lib/x86\_64-linux-gnu/libnvcuvid.so.1  
> ========= Host Frame: [0x2ede9]  
> ========= in /lib/x86\_64-linux-gnu/libnvcuvid.so.1  
> ========= Host Frame: [0x2de50]  
> ========= in /lib/x86\_64-linux-gnu/libnvcuvid.so.1  
> ========= Host Frame:main [0x148a]  
> ========= in /home/gabriel/dev/sources/test\_cuvid/build/./cuvid\_example  
> ========= Host Frame:\_\_libc\_start\_call\_main in …/sysdeps/nptl/libc\_start\_call\_main.h:58 [0x2a1c9]  
> ========= in /lib/x86\_64-linux-gnu/libc.so.6  
> ========= Host Frame:\_\_libc\_start\_main in …/csu/libc-start.c:360 [0x2a28a]  
> ========= in /lib/x86\_64-linux-gnu/libc.so.6  
> ========= Host Frame:\_start [0x1224]  
> ========= in /home/gabriel/dev/sources/test\_cuvid/build/./cuvid\_example

I created a minimal example to reproduce the error :

```auto
#include <cuda.h>
#include "NvCodec/NvDecoder/NvDecoder.h"

#include <iostream>

#ifdef __cuda_cuda_h__
#ifndef CUDA_CHECK
#define CUDA_CHECK(err) __checkCudaErrors(err,__FILE __,__ LINE__)
inline void __checkCudaErrors(CUresult err, const char *file, const int line) {
  if (CUDA_SUCCESS != err) {
    const char *errorStr = NULL;
    cuGetErrorString(err, &errorStr);
    fprintf(stderr,
            "checkCudaErrors() Driver API error = %04d \"%s\" from file <%s>, "
            "line %i.\n",
            err, errorStr, file, line);
    exit(EXIT_FAILURE);
  }
}
#endif // CUDA_CHECK
#endif // __cuda_cuda_h__

int main() {
    
    CUDA_CHECK(cuInit(0));

    CUdevice device;
    CUDA_CHECK(cuDeviceGet(&device, 0));

    CUcontext ctx;
    CUDA_CHECK(cuCtxCreate(&ctx, 0, device));

    CUvideoctxlock ctx_lock;    
    CUDA_CHECK(cuvidCtxLockCreate(&ctx_lock, ctx));

    CUvideodecoder decoder;
    CUVIDDECODECREATEINFO videoDecodeCreateInfo = { 0 };

    videoDecodeCreateInfo.CodecType = cudaVideoCodec_H264;
    videoDecodeCreateInfo.ChromaFormat = cudaVideoChromaFormat_420;
    videoDecodeCreateInfo.OutputFormat = cudaVideoSurfaceFormat_NV12;
    videoDecodeCreateInfo.bitDepthMinus8 = 0;
    videoDecodeCreateInfo.DeinterlaceMode = cudaVideoDeinterlaceMode_Weave;
    videoDecodeCreateInfo.ulNumOutputSurfaces = 2;
    videoDecodeCreateInfo.ulCreationFlags = cudaVideoCreate_PreferCUVID;
    videoDecodeCreateInfo.ulNumDecodeSurfaces = 20;
    videoDecodeCreateInfo.vidLock = ctx_lock;
    videoDecodeCreateInfo.ulWidth = 2560;
    videoDecodeCreateInfo.ulHeight = 720;

    videoDecodeCreateInfo.ulTargetWidth = 2560;
    videoDecodeCreateInfo.ulTargetHeight = 720;

    CUDA_CHECK(cuCtxPushCurrent(ctx));
    // error here with compute-sanitizer 
    CUDA_CHECK(cuvidCreateDecoder(&decoder, &videoDecodeCreateInfo));
    CUDA_CHECK(cuCtxPopCurrent(NULL));

    CUDA_CHECK(cuvidDestroyDecoder(decoder));
    CUDA_CHECK(cuCtxDestroy(ctx));
    CUDA_CHECK(cuvidCtxLockDestroy(ctx_lock));
}

```

The following command is reporting errors :

```auto
compute-sanitizer --leak-check full --print-level error ./cuvid_example

```

---

<div class="post-metadata">

**Author:** ![johannesrhvw](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@johannesrhvw](https://forums.developer.nvidia.com/u/johannesrhvw)\
**Post date:** [September 17, 2025, 4:27pm UTC](https://forums.developer.nvidia.com/t/errors-reported-by-compute-sanitizer-for-cuvidcreatedecoder/317461/2 "2025-09-17T16:27:04Z")

</div>

> [@gabgab](#):
>
> INVALID\_VALUE (error 1) due to “invalid argument” on CUDA API call to cuArrayGetPlane.  
> ========= Saved host backtrace up to driver entry point at error

I have the exact same issue for almost a year now, could not find any solution or cause for this.
