nvdec: Takes a lot of time to check supported codecs
Use case: we would like to be able to start multiple (>10) GStreamer HW-accelerated decoding pipelines at the same time, using nvdec
.
Problem: When we use the latest nvdec
, we see that starting up multiple instances suddenly takes a huge amount of time. After investigating, we found that the biggest reason seems to be the registration of the nvdec
plugin. In gst_nvdec_register()
, to find out the codecs it can support, it will create a Cuda context (and later throw it away) for each cuda device. Apparently this must take some global lock or something, because the players effectively lock each other.
Solution: I have no idea yet, since I'm not a CUDA expert. Our workaround for now is to cache the supported codecs somewhere and just comment out all the supported codec discovery code. Maybe @seungha.yang knows a better solution? :-)