saen acro wrote:
> Andre-Guy Otis wrote:
> > @Flole Systems, sorry I was so busy with my work and it took me sometimes to try out our last commit. The NVENC transcoding is indeed working but I'm hitting another bug.
> >
> > For odd reason, the GPU run out of memory if I switch channel several time. It seems TVH or maybe FFMPEG create a new NVENC stream everytime I switch channel but doesn't remove the old one. Here an example below:
> >
> > 2021-02-26 04:47:44.170 libav: AVCodecContext: dl_fn->cuda_dl->cuCtxCreate(&ctx->cu_context_internal, 0, cu_device) failed
> > 2021-02-26 04:47:44.170 libav: AVCodecContext: -> CUDA_ERROR_OUT_OF_MEMORY: out of memory
> > 2021-02-26 04:47:44.170 libav: AVCodecContext:
> > 2021-02-26 04:47:44.170 libav: AVCodecContext: No capable devices found
> >
> [...]
> Try in place of nvidia-smi to use "
NVTOP"
>
https://github.com/Syllo/nvtop/blob/master/screenshot/NVTOP_ex1.png?raw=true
> you can kill zombie transcode process there
I run my tvheadend on a headless server and this is the only process that use the GPU. For some reason, TVH create a new nvenc session on the GPU everytime I switch channel but doesn't flush the older session from the GPU, I end up to run out of memory and I had to restart TVH to clear that out.
I'm using a GTX 1650ti which is limited to 3 nvenc sessions by default so I got this out of memory error only after switching my channel 4 times but on the log files, I got no detail, here's an example.
libav: AVCodecContext: out of memory: (no detail)
libav: AVCodecContext: No capable devices found
You can unlock this nvenc sessions limit by just apply a patch on the driver with this tool: https://github.com/keylase/nvidia-patch. I was now able to switch channel more than 4 times but I noticed the GPU memory just keep increasing everytime I switch to a new channel. For testing, I keep doing it until a reach out the max memory and I finally got the cuda error above.
@dorin ilut, like Flole Systems said, the hardware acceleration is for decoding only. You can rely on your CPU for decoding and your GPU for encoding which I'm currently doing. If your nvenc still doesn't work, I can help you out. Please let me know what is your nvidia driver version, your linux distro and the error you get from the logs.
@Flole An other thing I found out is the scaling doesn't work. My ATSC signal is 1080p and I tried to scale it down to 720p but it still showing in 1080p when I watch it over Kodi. That's not a big deal for me but may matter for others.