Nvcodec sdk crashes!

I’m using Video_Codec_SDK_11.0.10 for hevc encoding

when app starts it always crashes at nvEncGetEncodePresetConfig lib func, context info as follows:

code: in CreateDefaultEncoderParams func:

NV_ENC_PRESET_CONFIG presetConfig = { NV_ENC_PRESET_CONFIG_VER, { NV_ENC_CONFIG_VER } };
LOG(INFO) << "nvEncGetEncodePresetConfig 1 " << m_hEncoder << " " << presetConfig.version << " " << presetConfig.presetCfg.version;
m_nvenc.nvEncGetEncodePresetConfig(m_hEncoder, codecGuid, presetGuid, &presetConfig);
LOG(INFO) << "nvEncGetEncodePresetConfig 2 " << m_hEncoder << " " << presetConfig.version << " " << presetConfig.presetCfg.version;
memcpy(pIntializeParams->encodeConfig, &presetConfig.presetCfg, sizeof(NV_ENC_CONFIG));

it crashes at nvEncGetEncodePresetConfig

the stack info is as follows:

#0 0x00007f6f8aa93438 in __GI_raise (sig=sig@entry=6) at …/sysdeps/unix/sysv/linux/raise.c:54
54 …/sysdeps/unix/sysv/linux/raise.c: No such file or directory.
[Current thread is 1 (Thread 0x7f6f1a7fc700 (LWP 44171))]
(gdb)
(gdb)
(gdb) bt
#0 0x00007f6f8aa93438 in __GI_raise (sig=sig@entry=6) at …/sysdeps/unix/sysv/linux/raise.c:54
#1 0x00007f6f8aa9503a in __GI_abort () at abort.c:89
#2 0x00007f6f8f464897 in corelib::SignalHandler (signum=11, siginfo=0x7f6f1a7f8930, ucontext=0x7f6f1a7f8800) at corelib/src/signals.cc:234
#3
#4 0x00007f6f8cb0f995 in ?? () from /usr/lib/x86_64-linux-gnu/libnvidia-encode.so.1
#5 0x00007f6f8cb1c7b2 in ?? () from /usr/lib/x86_64-linux-gnu/libnvidia-encode.so.1
#6 0x00007f6f8f4925ac in NvEncoder::CreateDefaultEncoderParams (this=0x7f6e80217110, pIntializeParams=0x564e64a439b0, codecGuid=…, presetGuid=…, tuningInfo=NV_ENC_TUNING_INFO_ULTRA_LOW_LATENCY)
at s_loop/src/remote_interface/camera_pusher/nvcodec/NvEncoder.cpp:128
#7 0x0000564e62b7a19f in remote_interface::camera_pusher::CameraStreamPusher::InitNvEncoder (this=0x564e64a439a0, width=1200, height=1200) at s_loop/src/remote_interface/camera_pusher/main.cc:316
#8 0x0000564e62b6620b in remote_interface::camera_pusher::CameraStreamPusher::EncoderThread (this=0x564e64a439a0) at s_loop/src/remote_interface/camera_pusher/main.cc:453
#9 0x00007f6f8b111b30 in ?? () from /home/jingchi/car_data/weride_adv/781f69989b2ca44b93915e583a66d794b9530cf9/driving/lib/libstdc++.so.6
#10 0x00007f6f8da196ba in start_thread (arg=0x7f6f1a7fc700) at pthread_create.c:333
#11 0x00007f6f8ab654dd in clone () at …/sysdeps/unix/sysv/linux/x86_64/clone.S:109
(gdb) f 6
#6 0x00007f6f8f4925ac in NvEncoder::CreateDefaultEncoderParams (this=0x7f6e80217110, pIntializeParams=0x564e64a439b0, codecGuid=…, presetGuid=…, tuningInfo=NV_ENC_TUNING_INFO_ULTRA_LOW_LATENCY)
at s_loop/src/remote_interface/camera_pusher/nvcodec/NvEncoder.cpp:128
128 s_loop/src/remote_interface/camera_pusher/nvcodec/NvEncoder.cpp: No such file or directory.
(gdb) info locals
presetConfig = {version = 4026793995, presetCfg = {version = 4026990603, profileGUID = {Data1 = 0, Data2 = 0, Data3 = 0, Data4 = “\000\000\000\000\000\000\000”}, gopLength = 0, frameIntervalP = 0,
monoChromeEncoding = 0, frameFieldMode = 0, mvPrecision = NV_ENC_MV_PRECISION_DEFAULT, rcParams = {version = 0, rateControlMode = NV_ENC_PARAMS_RC_CONSTQP, constQP = {qpInterP = 0, qpInterB = 0,
qpIntra = 0}, averageBitRate = 0, maxBitRate = 0, vbvBufferSize = 0, vbvInitialDelay = 0, enableMinQP = 0, enableMaxQP = 0, enableInitialRCQP = 0, enableAQ = 0, reservedBitField1 = 0,
enableLookahead = 0, disableIadapt = 0, disableBadapt = 0, enableTemporalAQ = 0, zeroReorderDelay = 0, enableNonRefP = 0, strictGOPTarget = 0, aqStrength = 0, reservedBitFields = 0, minQP = {
qpInterP = 0, qpInterB = 0, qpIntra = 0}, maxQP = {qpInterP = 0, qpInterB = 0, qpIntra = 0}, initialRCQP = {qpInterP = 0, qpInterB = 0, qpIntra = 0}, temporallayerIdxMask = 0,
temporalLayerQP = “\000\000\000\000\000\000\000”, targetQuality = 0 ‘\000’, targetQualityLSB = 0 ‘\000’, lookaheadDepth = 0, lowDelayKeyFrameScale = 0 ‘\000’, reserved1 = “\000\000”,
qpMapMode = NV_ENC_QP_MAP_DISABLED, multiPass = NV_ENC_MULTI_PASS_DISABLED, alphaLayerBitrateRatio = 0, reserved = {0, 0, 0, 0, 0}}, encodeCodecConfig = {h264Config = {enableTemporalSVC = 0,
enableStereoMVC = 0, hierarchicalPFrames = 0, hierarchicalBFrames = 0, outputBufferingPeriodSEI = 0, outputPictureTimingSEI = 0, outputAUD = 0, disableSPSPPS = 0, outputFramePackingSEI = 0,
outputRecoveryPointSEI = 0, enableIntraRefresh = 0, enableConstrainedEncoding = 0, repeatSPSPPS = 0, enableVFR = 0, enableLTR = 0, qpPrimeYZeroTransformBypassFlag = 0, useConstrainedIntraPred = 0,
enableFillerDataInsertion = 0, disableSVCPrefixNalu = 0, enableScalabilityInfoSEI = 0, reservedBitFields = 0, level = 0, idrPeriod = 0, separateColourPlaneFlag = 0, disableDeblockingFilterIDC = 0,
numTemporalLayers = 0, spsId = 0, ppsId = 0, adaptiveTransformMode = NV_ENC_H264_ADAPTIVE_TRANSFORM_AUTOSELECT, fmoMode = NV_ENC_H264_FMO_AUTOSELECT,
bdirectMode = NV_ENC_H264_BDIRECT_MODE_AUTOSELECT, entropyCodingMode = NV_ENC_H264_ENTROPY_CODING_MODE_AUTOSELECT, stereoMode = NV_ENC_STEREO_PACKING_MODE_NONE, intraRefreshPeriod = 0,
intraRefreshCnt = 0, maxNumRefFrames = 0, sliceMode = 0, sliceModeData = 0, h264VUIParameters = {overscanInfoPresentFlag = 0, overscanInfo = 0, videoSignalTypePresentFlag = 0, videoFormat = 0,
videoFullRangeFlag = 0, colourDescriptionPresentFlag = 0, colourPrimaries = 0, transferCharacteristics = 0, colourMatrix = 0, chromaSampleLocationFlag = 0, chromaSampleLocationTop = 0,
chromaSampleLocationBot = 0, bitstreamRestrictionFlag = 0, reserved = {0 <repeats 15 times>}}, ltrNumFrames = 0, ltrTrustMode = 0, chromaFormatIDC = 0, maxTemporalLayers = 0,
useBFramesAsRef = NV_ENC_BFRAME_REF_MODE_DISABLED, numRefL0 = NV_ENC_NUM_REF_FRAMES_AUTOSELECT, numRefL1 = NV_ENC_NUM_REF_FRAMES_AUTOSELECT, reserved1 = {0 <repeats 267 times>}, reserved2 = {
0x0 <repeats 64 times>}}, hevcConfig = {level = 0, tier = 0, minCUSize = NV_ENC_HEVC_CUSIZE_AUTOSELECT, maxCUSize = NV_ENC_HEVC_CUSIZE_AUTOSELECT, useConstrainedIntraPred = 0,
disableDeblockAcrossSliceBoundary = 0, outputBufferingPeriodSEI = 0, outputPictureTimingSEI = 0, outputAUD = 0, enableLTR = 0, disableSPSPPS = 0, repeatSPSPPS = 0, enableIntraRefresh = 0,
chromaFormatIDC = 0, pixelBitDepthMinus8 = 0, enableFillerDataInsertion = 0, enableConstrainedEncoding = 0, enableAlphaLayerEncoding = 0, reserved = 0, idrPeriod = 0, intraRefreshPeriod = 0,
intraRefreshCnt = 0, maxNumRefFramesInDPB = 0, ltrNumFrames = 0, vpsId = 0, spsId = 0, ppsId = 0, sliceMode = 0, sliceModeData = 0, maxTemporalLayersMinus1 = 0, hevcVUIParameters = {
overscanInfoPresentFlag = 0, overscanInfo = 0, videoSignalTypePresentFlag = 0, videoFormat = 0, videoFullRangeFlag = 0, colourDescriptionPresentFlag = 0, colourPrimaries = 0,
transferCharacteristics = 0, colourMatrix = 0, chromaSampleLocationFlag = 0, chromaSampleLocationTop = 0, chromaSampleLocationBot = 0, bitstreamRestrictionFlag = 0, reserved = {
0 <repeats 15 times>}}, ltrTrustMode = 0, useBFramesAsRef = NV_ENC_BFRAME_REF_MODE_DISABLED, numRefL0 = NV_ENC_NUM_REF_FRAMES_AUTOSELECT, numRefL1 = NV_ENC_NUM_REF_FRAMES_AUTOSELECT,
reserved1 = {0 <repeats 214 times>}, reserved2 = {0x0 <repeats 64 times>}}, h264MeOnlyConfig = {disablePartition16x16 = 0, disablePartition8x16 = 0, disablePartition16x8 = 0,
disablePartition8x8 = 0, disableIntraSearch = 0, bStereoEnable = 0, reserved = 0, reserved1 = {0 <repeats 255 times>}, reserved2 = {0x0 <repeats 64 times>}}, hevcMeOnlyConfig = {reserved = {
0 <repeats 256 times>}, reserved1 = {0x0 <repeats 64 times>}}, reserved = {0 <repeats 320 times>}}, reserved = {0 <repeats 278 times>}, reserved2 = {0x0 <repeats 64 times>}}, reserved1 = {
0 <repeats 255 times>}, reserved2 = {0x0 <repeats 64 times>}}
nv_mutex = {std::__mutex_base = {_M_mutex = {__data = {__lock = 2, __count = 0, __owner = 44171, __nusers = 1, __kind = 0, __spins = 0, __elision = 0, __list = {__prev = 0x0, __next = 0x0}},
__size = “\002\000\000\000\000\000\000\000\213\254\000\000\001”, ‘\000’ <repeats 26 times>, __align = 2}}, }
pEncodeConfig =
(gdb)

system info:
ubuntu 16.04 nvidia driver: libnvidia-encode.so.460.32.03
2 GPUs: GeForce RTX 2080 TI

can anyone help me out?

the relative crash location in libnvidia-encode.so.460.32.03 is:
STACKTRACE 4 >>> /usr/lib/x86_64-linux-gnu/libnvidia-encode.so.1(+0x2995) [0x7f975d79f995]
STACKTRACE 5 >>> /usr/lib/x86_64-linux-gnu/libnvidia-encode.so.1(+0xf7b2) [0x7f975d7ac7b2]

Hi,
Can you try with the latest driver?

If you still reproduce issue, is it possible for you to share application along with necessary input files and detailed command line instructions to help us reproduce this issue internally? It will help accelerate the debug.

In case you cannot share the repro setup, please rerun and reproduce issue, along with similar data you already captured also run gdb comand ‘info proc mappings’ and share its output.

Thanks.