Nvidia Transcoding in LXD container

Server Version#: 1.15.3.876
Player Version#: 3.83.1 (web)

Hi fellow Plex users.

I am using plex in LXD container for quite a few time. I decided to add an nvidia card (GTX 1050) in order to do hw encoding (cpu does not support it).

My card seems to be configure properly in the container and I am able to see detail

root@plex:~# nvidia-smi
Thu Apr 11 15:03:28 2019
+-----------------------------------------------------------------------------+
| NVIDIA-SMI 390.116                Driver Version: 390.116                   |
|-------------------------------+----------------------+----------------------+
| GPU  Name        Persistence-M| Bus-Id        Disp.A | Volatile Uncorr. ECC |
| Fan  Temp  Perf  Pwr:Usage/Cap|         Memory-Usage | GPU-Util  Compute M. |
|===============================+======================+======================|
|   0  GeForce GTX 1050    Off  | 00000000:03:00.0 Off |                  N/A |
| 45%   26C    P0    N/A /  75W |      0MiB /  2000MiB |      0%      Default |
+-------------------------------+----------------------+----------------------+

+-----------------------------------------------------------------------------+
| Processes:                                                       GPU Memory |
|  GPU       PID   Type   Process name                             Usage      |
|=============================================================================|
|  No running processes found                                                 |
+-----------------------------------------------------------------------------+

Unfortunatly, hardware encoding is not working properly and I get those errors in Plex log :

/mnt/Share/Services/Plex/Data/Application Support/Plex Media Server/Logs/Plex Media Server.log:Apr 11, 2019 14:49:30.441 [0x7f7fabfff700] ERROR - [FFMPEG] - The minimum required Nvidia driver for nvenc is 378.13 or newer
/mnt/Share/Services/Plex/Data/Application Support/Plex Media Server/Logs/Plex Media Server.log:Apr 11, 2019 14:49:30.441 [0x7f7fabfff700] WARN - avcodec_open2 returned -1313558101 for encoder 'h264_nvenc'

As you can see, this is telling me I need a newer nvidia driver but I am above minimum in the error msg. Also I try installing 418 driver and did the same error.

Anyone successfully made nvenc plex encoding works in LXD?

Thank You!

PS : If you need more inforamtion, please feel free to asks

1 Like

Hi again,

Finally my problem is not related to LXD at all. I installed plex directly in the host and I have the exact same error in the log file. I think it may be caused by the onboard VGA not being disable.

I’ll update later if this is it

Thank You

No good, even with onaord VGA disabled I still have the driver version error

/mnt/Share/Services/Plex/Data/Application Support/Plex Media Server/Logs/Plex Media Server.log:Apr 11, 2019 16:52:07.369 [0x7fc041ffb700] DEBUG - Codecs: testing h264_nvenc (encoder)
/mnt/Share/Services/Plex/Data/Application Support/Plex Media Server/Logs/Plex Media Server.log:Apr 11, 2019 16:52:07.370 [0x7fc041ffb700] ERROR - [FFMPEG] - The minimum required Nvidia driver for nvenc is 378.13 or newer
/mnt/Share/Services/Plex/Data/Application Support/Plex Media Server/Logs/Plex Media Server.log:Apr 11, 2019 16:52:07.370 [0x7fc041ffb700] WARN - avcodec_open2 returned -1313558101 for encoder 'h264_nvenc'

Being in the container is hard.

Not having logs from when it was on the bare host makes it almost impossible to know what’s happening.

Would you mind creating some DEBUG (not VERBOSE) logs for examination?

Hi CheckPA,

I found the issue sorry the have bothering you… When I look around nvenc error I discover this error :
Apr 11, 2019 20:12:31.530 [0x7f117d7fa700] ERROR - [FFMPEG] - Cannot load libnvidia-encode.so.1

So I installed libnvidia-encode :man_facepalming:

Thank you for your help :slight_smile:

2 Likes

Yep! That might help with the disconnect ! :smiley:

Do you have the 2-stream limitation work-around working ?

Sure,

Here I used two patches, one is to enable also decoding with gpu and the other is to disable two streams software limitation.


Here is also a script to automate driver installation/patching on ubuntu I’ve done

#!/bin/bash

# Install Nvidia drivers and tools
add-apt-repository -y ppa:graphics-drivers
apt update && apt install -y nvidia-headless-418 nvidia-utils-418 libnvidia-encode-418
wget -P /tmp https://raw.githubusercontent.com/revr3nd/plex-nvdec/master/plex-nvdec-patch.sh
wget -P /tmp https://raw.githubusercontent.com/keylase/nvidia-patch/master/patch.sh
chmod +x /tmp/*patch.sh
/tmp/plex-nvdec-patch.sh
/tmp/patch.sh
rm -rf /tmp/*patch.sh

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