How to setup Nvidia in Plex docker for hardware transcoding?

  • I'm adding an Nvidia Quadro p2000 card to my NAS and would like to know how I can implement that into my Plex docker for hardware transcoding. Can it be added to an existing Plex docker, or do I have to create a whole new one?


    I followed the video from Techno Dad Life on creating the Plex Docker using the OMV docker creation GUI. https://www.youtube.com/watch?v=BNfk7ji4oh4


    I've not had any luck finding any videos on how to include Nvidia GPU though. Can anyone please help?


    Thank you!

    • Offizieller Beitrag

    This


    "Hardware acceleration users for Nvidia will need to install the container runtime provided by Nvidia on their host, instructions can be found here:
    https://github.com/NVIDIA/nvidia-docker"


    is from here:
    https://hub.docker.com/r/linuxserver/plex


    Maybe it helps.

  • I've been at it for 4-5 days and am having no luck. (OMV 5).


    That's where I started too.


    I've had a terrible time just installing Nvidia graphics drivers well enough for the docker runtime to work. I have a Reddit post looking for help, which is a sequel to a previous post (put in a handful of spots) that hasn't bore any fruit.

  • My Openmediavault System is OMV5.3.9-1 with Linux 5.4.0-0.bpo.-amd64 kernel and NVIDIA GeForce GTX1660. Plex hardware transcoding works for me based on the following (If Plex doesn't hardware transcode, check this video) :



    Step 1: Install the NVIDIA driver based on the second option (How to install NVIDIA driver by using the official nvidia.com package step by step instructions).

    (If you are installing another bpo kernel, you will need to reinstall the Nvidia driver compilation prerequisite: apt -y install linux-headers-$(uname -r) )


    Step 2: Install the Curl command-line utility:


    Code
    sudo apt install curl


    Step 3: Installing the NVIDIA Container Toolkit:


    # Add the package repositories

    Code
    distribution=$(. /etc/os-release;echo $ID$VERSION_ID)
    curl -s -L https://nvidia.github.io/nvidia-docker/gpgkey | sudo apt-key add -
    curl -s -L https://nvidia.github.io/nvidia-docker/$distribution/nvidia-docker.list | sudo tee /etc/apt/sources.list.d/nvidia-docker.list

    then

    Code
    sudo apt-get update && sudo apt-get install -y nvidia-container-toolkit 
    sudo systemctl restart docker



    Step 4: Installing nvidia-container-runtime:


    Code
    sudo apt-get install nvidia-container-runtime


    Step 5: Edit /etc/nvidia-container-runtime/config.toml eg. nano and replace "@/sbin/ldconfig" with "/sbin/ldconfig", then save the file. (Thanks to lyon667!)


    Step 6: If you want NVIDIA to be the default Docker runtime, modify the contents of /etc/docker/daemon.json to:


    Code
    {
      "runtimes": {
        "nvidia": {
          "path": "/usr/bin/nvidia-container-runtime",
          "runtimeArgs": []
        }
      },
      "default-runtime": "nvidia"
    }

    Step 7:

    Code
    sudo systemctl restart docker

    Step 8: Install linuxserver/plex


    For example, it looks like this to me:




    Maybe it helps.


  • Hello,

    just to be sure, do you have a plex license?

    https://support.plex.tv/articles/115002178853-using-hardware-accelerated-streaming/

    AMD Ryzen 5 2400G on Asus TUF B450M-PLUS - 16Gb RAM - 3 * 3To RAID5 on LSI Megaraid SAS 9260-8i and 3 SSD in Fractal Design Node 804 Black
    OS: OMV 6.3.2-1 (Shaitan)

  • Tama, thank you for the info. I'm going to be reinstalling OMV and giving it another go.


    Hello,

    just to be sure, do you have a plex license?

    https://support.plex.tv/articles/115002178853-using-hardware-accelerated-streaming/

    Yes I do have the Plex Pass. My problem is that the Nvidia driver never completely installs correctly so that docker can use the GPU.

  • After following all these steps I get the following error after running the test command for the Nvidia cuda container:

    Code
    NVIDIA-SMI couldn't find libnvidia-ml.so library in your system. Please make sure that the NVIDIA Display Driver is properly installed and present in your system.
    Please also try adding directory that contains libnvidia-ml.so to your system PATH.

    Unfortunately this is the same error I got when I first started out trying to get this stuff to work.

    FWIW, here is my nvidia-smi output. I have the same driver version as you, which is the latest. Previously I tried a 390 legacy driver but it complained that it was out of date when I ran the cuda container command.

  • After following all these steps I get the following error after running the test command for the Nvidia cuda container:

    Code
    NVIDIA-SMI couldn't find libnvidia-ml.so library in your system. Please make sure that the NVIDIA Display Driver is properly installed and present in your system.
    Please also try adding directory that contains libnvidia-ml.so to your system PATH.

    Unfortunately this is the same error I got when I first started out trying to get this stuff to work.

    FWIW, here is my nvidia-smi output. I have the same driver version as you, which is the latest. Previously I tried a 390 legacy driver but it complained that it was out of date when I ran the cuda container command.

    What is the contents of /etc/nvidia-container-runtime/config.toml, please copy and paste here.

  • What is the contents of /etc/nvidia-container-runtime/config.toml, please copy and paste here.

  • Can say that after first trying to get HW transcodes to work over a month ago that last night it actually happened for the first time!

    Transcoded streams break on the Windows application and browser but it works fine on the Android and Roku apps but that's not going to ruin my good mood.

  • So this is what I am getting, what do I do next?


    docker: Error response from daemon: OCI runtime create failed: container_linux.g o:349: starting container process caused "process_linux.go:449: container init c aused \"process_linux.go:432: running prestart hook 0 caused \\\"error running h ook: exit status 1, stdout: , stderr: nvidia-container-cli: initialization error : driver error: failed to process request\\\\n\\\"\"": unknown.

    ERRO[0026] error waiting for container: context canceled

  • So this is what I am getting, what do I do next?


    docker: Error response from daemon: OCI runtime create failed: container_linux.g o:349: starting container process caused "process_linux.go:449: container init c aused \"process_linux.go:432: running prestart hook 0 caused \\\"error running h ook: exit status 1, stdout: , stderr: nvidia-container-cli: initialization error : driver error: failed to process request\\\\n\\\"\"": unknown.

    ERRO[0026] error waiting for container: context canceled


    Login to your system via ssh as root, please run the following command lines separately and paste the results here:

    Code
    nvidia-smi 
    Code
    docker run --gpus all nvidia/cuda:10.0-base nvidia-smi
  • I think this is a network or client side error and not a hardware transcoding bug because it works on the Android app.

    Yeah I'm not sure what's going on. Transcode streams don't work at all in Firefox on my laptop or desktop. It kinda works in Edge. Doesn't work on the Plex application, kinda works in the Plex media player application (which I just figured out is different than the Plex application I have been using). Still works pretty perfectly on my Roku TV and phone. Weird stuff.

  • Login to your system via ssh as root, please run the following command lines separately and paste the results here:

    Code
    nvidia-smi 
    Code
    docker run --gpus all nvidia/cuda:10.0-base nvidia-smi

    root@openmediavault:~# nvidia-smi

    -bash: nvidia-smi: command not found

    root@openmediavault:~# docker run --gpus all nvidia/cuda:10.0-base nvidia-smi

    Unable to find image 'nvidia/cuda:10.0-base' locally

    10.0-base: Pulling from nvidia/cuda

    7ddbc47eeb70: Pull complete

    c1bbdc448b72: Pull complete

    8c3b70e39044: Pull complete

    45d437916d57: Pull complete

    d8f1569ddae6: Pull complete

    de5a2c57c41d: Pull complete

    ea6f04a00543: Pull complete

    Digest: sha256:e6e1001f286d084f8a3aea991afbcfe92cd389ad1f4883491d43631f152f175e

    Status: Downloaded newer image for nvidia/cuda:10.0-base

    docker: Error response from daemon: OCI runtime create failed: container_linux.go:349: starting container process caused "process_linux.go:449: container init caused \"process_linux.go:432: running prestart hook 0 caused \\\"error running hook: exit status 1, stdout: , stderr: nvidia-container-cli: initialization error: driver error: failed to process request\\\\n\\\"\"": unknown.

    ERRO[0021] error waiting for container: context canceled

  • root@openmediavault:~# nvidia-smi

    -bash: nvidia-smi: command not found

    The NVIDIA driver is not properly installed, please reinstall it!

    (If you install it properly, we will continue troubleshooting if any!)


    An example (OMV 5 + OMV-Extras + Docker 5:19.03.8~3-0~debian-buster + NVIDIA Linux Graphics Driver v440.64):




    Code
    apt -y install nvidia-detect


    Code
    nvidia-detect


    Code
    wget http://us.download.nvidia.com/XFree86/Linux-x86_64/440.64/NVIDIA-Linux-x86_64-440.64.run


    Code
    apt -y install linux-headers-$(uname -r) build-essential


    Code
    echo blacklist nouveau > /etc/modprobe.d/blacklist-nvidia-nouveau.conf
    Code
    systemctl set-default multi-user.target


    Code
    systemctl reboot
    Code
    bash NVIDIA-Linux-x86_64-440.64.run


    Code
    systemctl set-default graphical.target


    Code
    systemctl reboot
    Code
    nvidia-smi

Jetzt mitmachen!

Sie haben noch kein Benutzerkonto auf unserer Seite? Registrieren Sie sich kostenlos und nehmen Sie an unserer Community teil!