HW acceleration correctly chooses NVIDIA discrete GPU, but tries to use vaapi instead of NVDEC/NVENC

@Ossalingur

Are your DEBUG logs here (captures the QSV/Nvidia flapping before starting playback) ?

I can’t find them. (apologies)

@ChuckPa No I didn’t send any debug logs here.

But yeah, I’m having severe issues with the VAAPI / NVIDIA flapping. It’s causing pretty long delays, and I’m also having playback issues on Chrome which seem related.

I am using media from a pretty slow remote share that might cause extra delays on the probing. But I have no issues like this when using either Intel GPU, or CPU transcoding. It just starts really fast, and never issues.

Here’s a snippet from my logs.

# cat "Plex Media Server.log"  | grep -i testing
Jan 27, 2023 19:38:45.635 [0x7fb6bda2bb38] DEBUG - [Req#aec69/Transcode] Codecs: testing h264_nvenc (encoder)
Jan 27, 2023 19:38:45.635 [0x7fb6bda2bb38] DEBUG - [Req#aec69/Transcode] Codecs: hardware transcoding: testing API nvenc
Jan 27, 2023 19:38:46.251 [0x7fb6bda2bb38] DEBUG - [Req#aec69/Transcode] Codecs: testing h264 (decoder) with hwdevice vaapi
Jan 27, 2023 19:38:46.252 [0x7fb6bda2bb38] DEBUG - [Req#aec69/Transcode] Codecs: hardware transcoding: testing API vaapi
Jan 27, 2023 19:38:46.253 [0x7fb6bda2bb38] DEBUG - [Req#aec69/Transcode] Codecs: testing h264 (decoder) with hwdevice nvdec
Jan 27, 2023 19:38:46.253 [0x7fb6bda2bb38] DEBUG - [Req#aec69/Transcode] Codecs: hardware transcoding: testing API nvdec
Jan 27, 2023 19:38:46.432 [0x7fb6bda2bb38] DEBUG - [Req#aec69/Transcode] Codecs: Testing with profile 'High'
Jan 27, 2023 19:38:46.582 [0x7fb6bda2bb38] DEBUG - [Req#aec69/Transcode] Codecs: testing h264_nvenc (encoder)
Jan 27, 2023 19:38:46.582 [0x7fb6bda2bb38] DEBUG - [Req#aec69/Transcode] Codecs: hardware transcoding: testing API nvenc
Jan 27, 2023 19:38:47.188 [0x7fb6bda2bb38] DEBUG - [Req#aec69/Transcode] Codecs: testing h264 (decoder) with hwdevice vaapi
Jan 27, 2023 19:38:47.188 [0x7fb6bda2bb38] DEBUG - [Req#aec69/Transcode] Codecs: hardware transcoding: testing API vaapi
Jan 27, 2023 19:38:47.189 [0x7fb6bda2bb38] DEBUG - [Req#aec69/Transcode] Codecs: testing h264 (decoder) with hwdevice nvdec
Jan 27, 2023 19:38:47.189 [0x7fb6bda2bb38] DEBUG - [Req#aec69/Transcode] Codecs: hardware transcoding: testing API nvdec
Jan 27, 2023 19:38:47.351 [0x7fb6bda2bb38] DEBUG - [Req#aec69/Transcode] Codecs: Testing with profile 'High'
Jan 27, 2023 19:38:47.515 [0x7fb6bda2bb38] DEBUG - [Req#aec69/Transcode] Codecs: testing h264_nvenc (encoder)
Jan 27, 2023 19:38:47.515 [0x7fb6bda2bb38] DEBUG - [Req#aec69/Transcode] Codecs: hardware transcoding: testing API nvenc
Jan 27, 2023 19:38:48.145 [0x7fb6bda2bb38] DEBUG - [Req#aec69/Transcode] Codecs: testing h264 (decoder) with hwdevice vaapi
Jan 27, 2023 19:38:48.146 [0x7fb6bda2bb38] DEBUG - [Req#aec69/Transcode] Codecs: hardware transcoding: testing API vaapi
Jan 27, 2023 19:38:48.146 [0x7fb6bda2bb38] DEBUG - [Req#aec69/Transcode] Codecs: testing h264 (decoder) with hwdevice nvdec
Jan 27, 2023 19:38:48.147 [0x7fb6bda2bb38] DEBUG - [Req#aec69/Transcode] Codecs: hardware transcoding: testing API nvdec
Jan 27, 2023 19:38:48.429 [0x7fb6bda2bb38] DEBUG - [Req#aec69/Transcode] Codecs: Testing with profile 'High'
Jan 27, 2023 19:38:48.540 [0x7fb6bda2bb38] DEBUG - [Req#aec69/Transcode] Codecs: testing h264_nvenc (encoder)
Jan 27, 2023 19:38:48.541 [0x7fb6bda2bb38] DEBUG - [Req#aec69/Transcode] Codecs: hardware transcoding: testing API nvenc
Jan 27, 2023 19:38:49.233 [0x7fb6bda2bb38] DEBUG - [Req#aec69/Transcode] Codecs: testing h264 (decoder) with hwdevice vaapi
Jan 27, 2023 19:38:49.233 [0x7fb6bda2bb38] DEBUG - [Req#aec69/Transcode] Codecs: hardware transcoding: testing API vaapi
Jan 27, 2023 19:38:49.234 [0x7fb6bda2bb38] DEBUG - [Req#aec69/Transcode] Codecs: testing h264 (decoder) with hwdevice nvdec
Jan 27, 2023 19:38:49.234 [0x7fb6bda2bb38] DEBUG - [Req#aec69/Transcode] Codecs: hardware transcoding: testing API nvdec
Jan 27, 2023 19:38:49.477 [0x7fb6bda2bb38] DEBUG - [Req#aec69/Transcode] Codecs: Testing with profile 'High'
Jan 27, 2023 19:38:49.598 [0x7fb6bda2bb38] DEBUG - [Req#aec69/Transcode] Codecs: testing h264_nvenc (encoder)
Jan 27, 2023 19:38:49.598 [0x7fb6bda2bb38] DEBUG - [Req#aec69/Transcode] Codecs: hardware transcoding: testing API nvenc
Jan 27, 2023 19:38:50.263 [0x7fb6bda2bb38] DEBUG - [Req#aec69/Transcode] Codecs: testing h264 (decoder) with hwdevice vaapi
Jan 27, 2023 19:38:50.263 [0x7fb6bda2bb38] DEBUG - [Req#aec69/Transcode] Codecs: hardware transcoding: testing API vaapi
Jan 27, 2023 19:38:50.264 [0x7fb6bda2bb38] DEBUG - [Req#aec69/Transcode] Codecs: testing h264 (decoder) with hwdevice nvdec
Jan 27, 2023 19:38:50.264 [0x7fb6bda2bb38] DEBUG - [Req#aec69/Transcode] Codecs: hardware transcoding: testing API nvdec
Jan 27, 2023 19:38:50.456 [0x7fb6bda2bb38] DEBUG - [Req#aec69/Transcode] Codecs: Testing with profile 'High'
Jan 27, 2023 19:38:50.588 [0x7fb6bda2bb38] DEBUG - [Req#aec69/Transcode] Codecs: testing h264_nvenc (encoder)
Jan 27, 2023 19:38:50.588 [0x7fb6bda2bb38] DEBUG - [Req#aec69/Transcode] Codecs: hardware transcoding: testing API nvenc
Jan 27, 2023 19:38:51.151 [0x7fb6bda2bb38] DEBUG - [Req#aec69/Transcode] Codecs: testing h264 (decoder) with hwdevice vaapi
Jan 27, 2023 19:38:51.152 [0x7fb6bda2bb38] DEBUG - [Req#aec69/Transcode] Codecs: hardware transcoding: testing API vaapi
Jan 27, 2023 19:38:51.152 [0x7fb6bda2bb38] DEBUG - [Req#aec69/Transcode] Codecs: testing h264 (decoder) with hwdevice nvdec
Jan 27, 2023 19:38:51.153 [0x7fb6bda2bb38] DEBUG - [Req#aec69/Transcode] Codecs: hardware transcoding: testing API nvdec
Jan 27, 2023 19:38:51.332 [0x7fb6bda2bb38] DEBUG - [Req#aec69/Transcode] Codecs: Testing with profile 'High'

One can never stop being an engineer, I guess :smiley:

I don’t doubt this for a second. Sadly, when I got this laptop, a desktop gaming rig was not in my budget.

Nice! I’ve always wanted to contribute something to the Linux kernel, but alas, my C skills are practically non-existent. I’ll probably retire as a backend web developer still…

@ChuckPa I found this post just now, and since HW transcoding was working fine for me before, maybe it’s a similar issue? I’m not sure how to go about downgrading to 1.29.XX to test, since I’m working off of the Plex.tv Debian package repo. Any suggestions?

For me, the probing for VAAPI and NVENC should be done once when PMS starts. It should then remember what it has already decided and only re-probe if something fails, Or the service is re-started?

2 Likes

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.