Error Initializing nvEncoder

Hello All,

I’m encountering an exception error when initializing the NvEncoder::CreateEncoder. nvEncInitializeEncoder return error code 8.

Video Input Information
Codec : AVC/H.264
Frame rate : 0/0 = -nan(ind) fps
Sequence : Progressive
Coded size : [1280, 720]
Display area : [0, 0, 1280, 720]
Chroma : YUV 420
Bit depth : 8
Video Decoding Params:
Num Surfaces : 20
Crop : [0, 0, 0, 0]
Resize : 1280x720
Deinterlace : Weave

Here are my Encoding Parameters:

[INFO ][13:00:41] Encoding Parameters:
codec : h264
preset : default
profile : (default)
chroma : yuv420
bitdepth : 8
rc : cbr_hq
fps : 60/1
gop : INF
bf : 0
size : 1280x720
bitrate : 1000000000
maxbitrate : 0
vbvbufsize : 0
vbvinit : 0
aq : disabled
temporalaq : disabled
lookahead : disabled
cq :
qmin : P,B,I=0,0,0
qmax : P,B,I=0,0,0
initqp : P,B,I=0

Encoder Capability

GPU H264 H264_444 H264_ME H264_WxH HEVC HEVC_Main10 HEVC_Lossless HEVC_SAO HEVC_444 HEVC_ME HEVC_WxH

0 Tesla T4 + + + 4096x4096 + + + + + + 8192x8192

±----------------------------------------------------------------------------+
| NVIDIA-SMI 451.48 Driver Version: 451.48 CUDA Version: 11.6 |
|-------------------------------±---------------------±---------------------+
| GPU Name TCC/WDDM | Bus-Id Disp.A | Volatile Uncorr. ECC |
| Fan Temp Perf Pwr:Usage/Cap| Memory-Usage | GPU-Util Compute M. |
|===============================+======================+======================|
| 0 Tesla T4 TCC | 00000000:B1:00.0 Off | 0 |
| N/A 36C P8 11W / 70W | 1MiB / 15205MiB | 0% Default |
±------------------------------±---------------------±---------------------+

±----------------------------------------------------------------------------+
| Processes: |
| GPU GI CI PID Type Process name GPU Memory |
| ID ID Usage |
|=============================================================================|
| No running processes found |
±----------------------------------------------------------------------------+

Any ideas as to what could be causing this issues?

Hello @tim.wooldridge and welcome to the NVIDIA developer forums!

Error code 8 corresponds to NV_ENC_ERR_INVALID_PARAM which would indicate that one of your parameters in NvEncoder::CreateEncoder() is incorrect. Please check with the sample code and see if there might be some mismatch.

I hope this helps!

Hi Markus, thanks for your feedback. What confusing is this code works fine on the RTX 2080. However, when I run the code on a T4, I encounter the error 8.

Now you have me intrigued.

Would it be possible for you to upgrade the NVIDIA driver version?

And could you share the part of your code where you encounter the error? And ideally a stacktrace in case you have debugging capabilities? To analyse further we would need some idea of what the passed values are in the function that fails.