LoadNvEncApi error!

I use jetson nano to encode YUV420 to H264. I try to run the AppEncGL.cpp in video_codec_sdk_10.0.26. But when i load the function of LoadNvEncApi(), it returned error. the function is below here:

void NvEncoder::LoadNvEncApi()

    uint32_t version = 0;
    uint32_t currentVersion = (NVENCAPI_MAJOR_VERSION << 4) | NVENCAPI_MINOR_VERSION;
    if (currentVersion > version)
        NVENC_THROW_ERROR("Current Driver Version does not support this NvEncodeAPI version, please upgrade driver", NV_ENC_ERR_INVALID_VERSION);



    #define NVENC_API_CALL( nvencAPI )                                                                                 \
        do                                                                                                             \
        {                                                                                                              \
            NVENCSTATUS errorCode = nvencAPI;                                                                          \
            if( errorCode != NV_ENC_SUCCESS)                                                                           \
            {                                                                                                          \
                std::ostringstream errorLog;                                                                           \
                errorLog << #nvencAPI << " returned error " << errorCode;                                              \
                throw NVENCException::makeNVENCException(errorLog.str(), errorCode, __FUNCTION__, __FILE__, __LINE__); \
            }                                                                                                          \
        } while (0)
// NvEncodeAPIGetMaxSupportedVersion


  • \brief Get the largest NvEncodeAPI version supported by the driver.
  • This function can be used by clients to determine if the driver supports
  • the NvEncodeAPI header the application was compiled with.
  • \param [out] version
  • Pointer to the requested value. The 4 least significant bits in the returned
  • indicate the minor version and the rest of the bits indicate the major
  • version of the largest supported version.
  • \return
    NVENCSTATUS NVENCAPI NvEncodeAPIGetMaxSupportedVersion (uint32_t

According to the return, I got a errno of NV_ENC_ERR_INVALID_PTR. But I do not know how I pass a wrong pointer.

Additionally, I have setup the cuda10.0 and openGL lib.

Any help will be grateful.


I use jetson nano to encode YUV420 to H264. I try to run the AppEncGL.cpp in video_codec_sdk_10.0.26

On Jetson, NVIDIA Video Codec SDK is not supported on Tegra iGPU, and is only supported on the dGPU.
Are you using dGPU to encode? Which dGPU driver is installed on the system? Can you attach gdb and confirm which libnvidia-encode.so library is being used.

We will need more accurate reproduction setup details to reproduce this internally.