'nvEncRestoreEncoderState' returns error code always

My envirionment is:

  • GPU : NVIDIA RTX 4090
  • OS : Ubuntu 20.04 LTS
  • Driver version: 530.30.02
  • CUDA version: 12.1

I have conducted tests on various cases, but I consistently encounter an error when using the ‘nvEncRestoreEncoderState’ function. The error code returned is 8, which indicates an invalid argument. And unfortunately, the text encoding of the output error string is undeterminable.(which is fetched from ‘nvEncGetLastErrorString’ function)

char error_str[] = {88, 36, -91, -109, 58, 21, 52, -15, -76, -66, 104, 86, -70, 19, 46, -67, -64, -71, 72, 65, 76, 35, -51, 111, -46, -77, 49, -95, -53, -103, -57, -34, -39, -12, 61, 73, -57, 1, -21, 12, 103, 110, -2, -38, 54, 33, -115, 106, 5, -67, 0};

In my code, I called the function in the following manner:

NV_ENC_RESTORE_ENCODER_STATE_PARAMS restore_params = {};
restore_params.version = NV_ENC_RESTORE_ENCODER_STATE_PARAMS_VER;
restore_params.bufferIdx = index_choice;
restore_params.state = NV_ENC_STATE_RESTORE_FULL;

auto status = nvenc_api.nvEncRestoreEncoderState(nvenc_hdl, &restore_params);

It was my fault. my nvEncodeAPI.h was corrupted.

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.