Session restrictions on Tesla P4, Quadro P6000


I’m developing video transcoding program using ffmpeg based on nvenc api.
Yesterday, I got an error while getting encoding instances more than 12.
Is there restrictions getting instances on the device?

[h264_nvenc @ 0x44498c0] Failed creating CUDA context for NVENC: 0x2
[h264_nvenc @ 0x44498c0] No NVENC capable devices found
Error initializing output stream 0:0 – Error while opening encoder for output stream #0:0 - maybe incorrect parameters such as bit_rate, rate, width or height

Hello there,

What command line are you using for the FFmpeg transcode?

Show me an example.

If you can, omit all hwaccels (and use software-based decoding only) for all tasks with the example below:

ffmpeg -threads 4 -i INPUT -c:v h264_nvenc ${ENCODER_OPTS} ...

Then see if you can reproduce the problem.

The bottleneck here seems to lie at the decode side (with NVDEC), so omitting that may help offset the issues you’re observing.

Another option would be to reduce the surface count for each encoder process, as shown:

ffmpeg -threads 4 -i INPUT -c:v h264_nvenc ${ENCODER_OPTS} -surfaces 8 ...



are the arguments given to the named encoder, h264_nvenc.

See the output of:

ffmpeg -hide_banner -h encoder=h264_nvenc

For usage.