[FFmpeg-user] When using h264_cuvid, memory allocation differs between different nvidia GPUs

Rodney Baker rodney.baker at iinet.net.au
Mon Sep 17 14:11:19 EEST 2018

On Saturday, 15 September 2018 2:16:19 ACST Panagiotis Malakoudis wrote:
> I did more tests and there is a consistent difference in VRAM usage when
> running same commands in GTX 1050 Ti and GTX 1070 Ti.
> NVENC encoding also excibits same behaviour, for example:
> ffmpeg -f mpegts -i https://samples.ffmpeg.org/V-codecs/h264/HD-h264.ts
> -vcodec h264_nvenc -c:a copy -f mpegts transcoded.ts
> all defaults, allocates 94MB in 1050 Ti but 163MB in 1070 Ti, for a
> difference of 69MB.
> Combining encoding AND decoding in one command, for example:
> ffmpeg -hwaccel cuvid -c:v h264_cuvid -f mpegts -i
> https://samples.ffmpeg.org/V-codecs/h264/HD-h264.ts -vcodec h264_nvenc -c:a
> copy -f mpegts transcoded.ts
> 1070 Ti: 269MB, 1050 Ti: 200MB.
> So we see a difference of 66MB when only decoding, 69MB when only encoding,
> 69MB when both decoding+encoding.
> I also tested two different driver versions, 384.130 and 390.77, both give
> same results.
> What is interesting is that testing in Windows gives different, lower VRAM
> values for GTX 1070 Ti but still more than GTX 1050 Ti in Linux (I couldn't
> test GTX 1050 Ti in Windows yet). For example, decoding uses 132MB when
> same command in Linux uses 153MB.
> I don't think it is a bug in ffmpeg, probably something going on in nvidia
> drivers. Where I could report this to nvidia?

Is this possibly related to the differing architecture (number of Cuda cores 
and/or the Framebuffer size) on the different cards? 768 with 4Mb FB on the 
GTX 1050 Ti , 2432 with 8MB FB on the 1070 Ti. 

I would expect the driver to need to allocate more resources to the latter...

Rodney Baker VK5ZTV
rodney.baker at iinet.net.au
CCNA #CSCO12880208

More information about the ffmpeg-user mailing list