FFmpeg using NVIDIA GPUs fails

Hi,

I’m going to use FFmpeg cuvid to do hardware accelerate, however, it’s failed even I followed https://developer.nvidia.com/FFmpeg guide.
My command is

“ffmpeg -hwaccel cuvid -c:v h264_cuvid -i Demo.mp4 -vf scale_npp=1280:720 -c:v h264_nvenc output.mp4”
and the log is:
ffmpeg version N-94608-gaeae628 Copyright (c) 2000-2019 the FFmpeg developers
built with gcc 5.3.1 (GCC) 20160406 (Red Hat 5.3.1-6)
configuration: --enable-cuda-nvcc --enable-cuvid --enable-nvenc --enable-nonfree --enable-libnpp --extra-cflags=-I/usr/local/cuda/include --extra-ldflags=-L/usr/local/cuda/lib64
libavutil 56. 33.100 / 56. 33.100
libavcodec 58. 55.100 / 58. 55.100
libavformat 58. 31.101 / 58. 31.101
libavdevice 58. 9.100 / 58. 9.100
libavfilter 7. 58.100 / 7. 58.100
libswscale 5. 6.100 / 5. 6.100
libswresample 3. 6.100 / 3. 6.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from ‘Demo.mp4’:
Metadata:
major_brand : isom
minor_version : 512
compatible_brands: isomiso2avc1mp41
encoder : Lavf56.40.101
Duration: 00:02:26.00, start: 0.000000, bitrate: 18065 kb/s
Stream #0:0(und): Video: h264 (High) (avc1 / 0x31637661), yuvj420p(pc), 2400x1340 [SAR 1:1 DAR 120:67], 18063 kb/s, 25 fps, 25 tbr, 12800 tbn, 50 tbc (default)
Metadata:
handler_name : VideoHandler
File ‘output.mp4’ already exists. Overwrite ? [y/N] y
[h264_cuvid @ 0x213f500] Cannot load libnvcuvid.so.1
[h264_cuvid @ 0x213f500] Failed loading nvcuvid.
Stream mapping:
Stream #0:0#0:0 (h264 (h264_cuvid) → h264 (h264_nvenc))
Error while opening decoder for input stream #0:0 : Operation not permitted

Anyone can help? Thanks in advance!

[h264_cuvid @ 0x213f500] Cannot load libnvcuvid.so.1
[h264_cuvid @ 0x213f500] Failed loading nvcuvid.

Which OS version, driver, and GPU you are using?
From the error message I suspect NVIDIA driver is not properly installed.
Can you execute nvidia-bug-report.sh as a root and attach the generated log for analysis.

Thanks.

1 Like

Did this ever get resolved? I am experiencing the same issue. Kubernetes.
Linux version 4.14.198-152.320.amzn2.x86_64 (mockbuild@ip-10-0-1-118) (gcc version 7.3.1 20180712 (Red Hat 7.3.1-9) (GCC)) #1 SMP Wed Sep 23 23:57:28 UTC 2020
Nvidia T4
jrottenberg/ffmpeg:4.3-nvidia docker image.