NVJPEG - estimation of V-RAM consumption

Is there any way to estimate how much V-RAM I need to use nvjpegEncodeImage and nvjpegEncodeRetrieveBitstream?
The problem is that when the graphics card doesn’t have enough memory, encoding will be much slower (2x) than encoding using OpenCV on the CPU side.
Since I will have large images (for example 11664 x 8750) and my application will run on different machines, I need to check if the V-RAM of that graphics card is enough to encode my image. If it’s too small, I’ll use CPU processing.

I’m using NVIDIA GPU Computing Toolkit v12.2.

1 Like