Bug #5417
open
Each time the channel is changed, the memory is more occupied by the GPU -> NVENC -> Transcode
Added by Ronny M. over 6 years ago.
Updated almost 4 years ago.
Description
Hallo @all,
with each channel change (with HW Transcode at NVENC) the memory is occupied more by the GPU -> NVENC since when this is so, unfortunately not known, since I tested this release last year ago with other hardware.
In the version 4.2.7 one can observe clearly that the GPU Ram is released after a switching process again.
At about 2500 MB occupancy comes in the TVH log the following message
"libav: AVHWDeviceContext: Failed to initialize VAAPI connection: -1 (unknown libva error)."
Until the restart of TVH no transcode is possible.
In my opinion, only the "every old" transcode process is not closed properly.
Thanks and greetings
Enclosed an output from nvidia-smi
Tue Dec 11 18:01:36 2018
+-----------------------------------------------------------------------------+
| NVIDIA-SMI 390.77 Driver Version: 390.77 |
|-------------------------------+----------------------+----------------------+
| GPU Name Persistence-M| Bus-Id Disp.A | Volatile Uncorr. ECC |
| Fan Temp Perf Pwr:Usage/Cap| Memory-Usage | GPU-Util Compute M. |
|===============================+======================+======================|
| 0 Quadro P5000 Off | 00000000:65:00.0 Off | Off |
| 34% 56C P0 46W / 180W | 1499MiB / 16278MiB | 1% Default |
+-------------------------------+----------------------+----------------------+
+-----------------------------------------------------------------------------+
| Processes: GPU Memory |
| GPU PID Type Process name Usage |
|=============================================================================|
| 0 66068 C /usr/bin/tvheadend 1487MiB |
+-----------------------------------------------------------------------------+
Tue Dec 11 18:01:43 2018
+-----------------------------------------------------------------------------+
| NVIDIA-SMI 390.77 Driver Version: 390.77 |
|-------------------------------+----------------------+----------------------+
| GPU Name Persistence-M| Bus-Id Disp.A | Volatile Uncorr. ECC |
| Fan Temp Perf Pwr:Usage/Cap| Memory-Usage | GPU-Util Compute M. |
|===============================+======================+======================|
| 0 Quadro P5000 Off | 00000000:65:00.0 Off | Off |
| 34% 56C P0 44W / 180W | 1507MiB / 16278MiB | 0% Default |
+-------------------------------+----------------------+----------------------+
+-----------------------------------------------------------------------------+
| Processes: GPU Memory |
| GPU PID Type Process name Usage |
|=============================================================================|
| 0 66068 C /usr/bin/tvheadend 1495MiB |
+-----------------------------------------------------------------------------+
Tue Dec 11 18:01:44 2018
+-----------------------------------------------------------------------------+
| NVIDIA-SMI 390.77 Driver Version: 390.77 |
|-------------------------------+----------------------+----------------------+
| GPU Name Persistence-M| Bus-Id Disp.A | Volatile Uncorr. ECC |
| Fan Temp Perf Pwr:Usage/Cap| Memory-Usage | GPU-Util Compute M. |
|===============================+======================+======================|
| 0 Quadro P5000 Off | 00000000:65:00.0 Off | Off |
| 34% 56C P0 44W / 180W | 1640MiB / 16278MiB | 0% Default |
+-------------------------------+----------------------+----------------------+
+-----------------------------------------------------------------------------+
| Processes: GPU Memory |
| GPU PID Type Process name Usage |
|=============================================================================|
| 0 66068 C /usr/bin/tvheadend 1628MiB |
+-----------------------------------------------------------------------------+
Files
fix (1.76 KB)
fix |
|
Ronny M., 2021-04-24 17:32
|
|
Hello John,
its been a year - and I have still the same issue.
On using htsp client memory is not freed up when stop streaming the channels but is stacks until the server goes down.
On M3U playlist + simple-XML it works like a charm.
Any Ideas? If you need more info - do not hesitate to come back to me.
BR,
Ronny
John was last active 2015, I'd assume that he's not working on this.
Also I can't reproduce this issue here.
I think that's just an overlay to the "normal" nvdia sources,
"Please note that NvPipe acts as a lightweight synchronous convenience layer around the NVIDIA Video Codec SDK and doesn't offer all high-performance capabilities. If you're looking for ultimate encode/decode performance, you may want to consider using NvCodec directly."
Therefore, normal IPTV: destroy -> a -> no problem
HTPS IPTV: destroy -> b -> not complete -> problem
in version 4.2, a new subprocess has been built for each stream.
I found this better because Sub destroy and done.
BR
Ronny
PLS Someone must solve the Problem
Rene Wagler wrote:
PLS Someone must solve the Problem
Please go ahead and do it then.
Nope, im not a programmer. But someone is working on 4.3
Sorry to disappoint you but nobody is actively working on tvheadend at the moment, there are a few changes now and then but other than that there is not much work being done.
But TVH is the one and only DVB Server, isnt it? Why nobody cares about it? Cant understand this
Let's start with yourself: Why don't you care? Why are you not spending time to investigate this issue? Seems like this issue is not that important if you don't put effort in it, totally fine with me but if your issue isn't important to yourself it's not important to me either (especially since I can't reproduce it and I am not affected by it at all).
Are u using nvenc with TVH? i think not, so u cant reproduce it. The Problem is i dont know witch source file is responsible for transcoding and channel switching
Yes I am using nvenc on the latest tvheadend version.
and what happens it you stop live tv in the nvidia-smi ? Is the transcoding tread gone as it should ?
Yes, Tvheadend completely disappears from that list when i stop the stream.
ok.. are u using cuda or only nvenc and cuvid?
I am using nvenc and enabled Hardware acceleration, cuda is not really used in Tvheadend as far as I know.
NVENC is part of CUDA instructions
/can be seen with "netstat" command/
@ Rene Wagler update drivers
i have 440.xx its actual enough. you can compile TVH with and without CUDA. NVENC and CUVID are seperate compile-options
- Assignee deleted (
John Törnblom)
- Target version set to 999
If you don't even want to spend the time to update to the latest version you really shouldn't complain that nobody is working on it. You don't even try to fix the issue, so I won't either.
Also no accurate Tvheadend version or debug log was presented either....
I cant switch to newest driver. Cause i use TVH in docker. And the driver is not the Problem!!
- Status changed from New to Invalid
Old driver is used, Tvheadend is used in Docker. Once someone can reproduce this on the latest Tvheadend version with the latest Nvidia Driver on a native System I can consider reopening this.
Flole Systems can u post your transcoding settings ?
what codec are u using? 264 or 265 ??
Rene Wagler wrote:
what codec are u using? 264 or 265 ??
both codec´s have the same Problem, i dosn´t think this is a Problem with the Codec, i think this is a Problem with the Opening and Close from the Sub-Process.
Kind Regards
Ronny
Ronny M. wrote:
both codec´s have the same Problem, i dosn´t think this is a Problem with the Codec, i think this is a Problem with the Opening and Close from the Sub-Process.
Kind Regards
Ronny
+1
Flushing unneeded memory need to be debugged.
glad im not alone.. but why Flole Systems does not have this bug ?
Rene Wagler wrote:
glad im not alone.. but why Flole Systems does not have this bug ?
Because no one report bugs corectly
What OS/Kernel is used
What hardware platform
What devices/driver used
etc.
Valgrind debugging for example
what hardware are u using? me: runnign tvh in an unraid nvidia docker conatainer build with newest ffmpeg
saen acro wrote:
Rene Wagler wrote:
glad im not alone.. but why Flole Systems does not have this bug ?
Because no one report bugs corectly
What OS/Kernel is used
What hardware platform
What devices/driver used
etc.
Valgrind debugging for example
OS: Debian (10.5)
Kernel: 4.19.132-1
Hardware: Motherboard Supermicro, CPU Intel(R) Xeon(R) Silver 4110
GPU: Nvidia Quadro P5000
Driver Version: 450.57
NVIDIA-SMI: 450.57
Cuda Version: 11.0
Docker: No
ffmpeg: Static from TVH Build
TVH Version: 4.3-1857
Debug: show the first Post.
Ronny M. wrote:
Hallo @all,
with each channel change (with HW Transcode at NVENC) the memory is occupied more by the GPU -> NVENC since when this is so, unfortunately not known, since I tested this release last year ago with other hardware.
In the version 4.2.7 one can observe clearly that the GPU Ram is released after a switching process again.
At about 2500 MB occupancy comes in the TVH log the following message
"libav: AVHWDeviceContext: Failed to initialize VAAPI connection: -1 (unknown libva error)."
Until the restart of TVH no transcode is possible.
In my opinion, only the "every old" transcode process is not closed properly.
Thanks and greetings
Enclosed an output from nvidia-smi
[...]
Ronny M. wrote:
saen acro wrote:
Rene Wagler wrote:
glad im not alone.. but why Flole Systems does not have this bug ?
Because no one report bugs corectly
What OS/Kernel is used
What hardware platform
What devices/driver used
etc.
Valgrind debugging for example
OS: Debian (10.5)
Kernel: 4.19.132-1
Hardware: Motherboard Supermicro, CPU Intel(R) Xeon(R) Silver 4110
GPU: Nvidia Quadro P5000
Driver Version: 450.57
NVIDIA-SMI: 450.57
Cuda Version: 11.0
Docker: No
ffmpeg: Static from TVH Build
TVH Version: 4.3-1857
Debug: show the first Post.
Hello Ronny
did you find any solutions for this ?
Im have the same problem
OS: Ubuntu 20.04
Kernel: 5.4.0-58-generic
Hardware Motorbord MSI: CPU Core i7
GPU: Nvidia Quadro p2000
Driver 460.27.04
Nvidia-smi: 460.27.04
Cuda: 11.2
Docker: no
FFMPEG: Static self build
TVH Version: 4.3-1919
Hallo @Leon,
no, i have only a not so Wonderful Workaround ....
a Cronjob restart at 5:00 AM o'clock the TVHeadend Service ;-(
Sorry!
It's not a proper fix (the bottom half of it needs to stay the old version) and the bug report will stay open until it's merged ;)
okay we renamed is to
Worked but not correctly
or
a quick and dirty workaround ;-)
- Status changed from Invalid to Resolved
bonjour
même problème pour moi.
OS: Ubuntu 21.04 server
Hardware CPU bi-xeon
GPU: Nvidia Quadro p2000
Driver 460.80
Nvidia-smi: 460.80
Cuda: 11.2
TVH Version: HTS Tvheadend 4.3.0~pre+202105051438-0
Use english language and as you're not using an official build please contact the maintainer of your build for support.
Also available in: Atom
PDF