ffmpeg icon indicating copy to clipboard operation
ffmpeg copied to clipboard

CUDA_ERROR_COMPAT_NOT_SUPPORTED_ON_DEVICE

Open fc6666666 opened this issue 1 year ago • 2 comments

Hi Team,

thx for this great effort. We are using following cmd to try encoding with nvidia hw support.

docker run --gpus all --runtime=nvidia --rm -v $(pwd):$(pwd) -w $(pwd) jrottenberg/ffmpeg:7.0.1-nvidia2204 -i $(pwd)/t.mkv -c:v h264_nvenc -r 23.976 -g 48 -keyint_min 48 -crf 26 -c:a aac -ac 2 -ar 44100 -b:a 64k -bsf:v h264_mp4toannexb -f hls -hls_time 3 -hls_segment_size 4000000 -hls_playlist_type vod -hls_flags independent_segments $(pwd)/t.m3u8

and it always got terminated with following error:

CleanShot 2024-06-09 at 05 47 03@2x

[h264_nvenc @ 0x563d07d84580] dl_fn->cuda_dl->cuInit(0) failed -> CUDA_ERROR_COMPAT_NOT_SUPPORTED_ON_DEVICE: forward compatibility was attempted on non supported HW [vost#0:0/h264_nvenc @ 0x563d07d81600] Error while opening encoder - maybe incorrect parameters such as bit_rate, rate, width or height. [vf#0:0 @ 0x563d07d855c0] Error sending frames to consumers: Unknown error occurred [vf#0:0 @ 0x563d07d855c0] Task finished with error code: -1313558101 (Unknown error occurred) [vf#0:0 @ 0x563d07d855c0] Terminating thread with return code -1313558101 (Unknown error occurred) [vost#0:0/h264_nvenc @ 0x563d07d81600] Could not open encoder before EOF [vost#0:0/h264_nvenc @ 0x563d07d81600] Task finished with error code: -22 (Invalid argument) [vost#0:0/h264_nvenc @ 0x563d07d81600] Terminating thread with return code -22 (Invalid argument) [out#0/hls @ 0x563d07dd90c0] Nothing was written into output file, because at least one of its streams received no packets. frame= 0 fps=0.0 q=0.0 Lsize= 0KiB time=N/A bitrate=N/A speed=N/A [aac @ 0x563d08c6f540] Qavg: 183.388 Conversion failed!

the system got alreadyt nvidia-docker and driver installed

CleanShot 2024-06-09 at 05 47 56@2x

any ideas why?

fc6666666 avatar Jun 09 '24 12:06 fc6666666

see your scale output, nvidia only allow more than 256pixels outputs.

templarfelix avatar Jun 10 '24 13:06 templarfelix

This can also be due to differing versions of the Cuda between host and container.

I had the same issue and it was due to using an older (12.2.1) version of Cuda provided by my distro on my host system, while these images use a newer version of the nVidia image.

A possible fix is to clone this repo, modify the Dockerfile to base on the same major/minor nvidia:cuda -devel and -runtime images, and build your stack from there. I did this and it solved my issue. Upgrading your host's Cuda stack to match at least the version used in the images may also work.

chorca avatar Mar 16 '25 02:03 chorca