Gpu Nvidia Passthrough

  • Hi All,


    New to openmediavault, Had a play around with omv 6 but cannot seem to get gpu passthrough working for plex transcoding.

    Has any body managed to do this?


    if so, am i required to CLI remove debian drivers and install the Nvidia driver?


    any tips would be great as i followed a guide that was posted on these forums but ran into a problem with a couple of the commands.


    i have successfully set this up on Ubuntu , Unraid server previously.

    • Offizieller Beitrag

    Have you seen this?


  • At the moment neither, currently have unraid setup and want to make the transition to OMV.


    I have previously tried on omv 5 and was unsuccessful at getting to work


    Wanted to ask if possible as very little info on transcoding with omv.

  • Hi there,

    Thanks for the reply.


    I would love to see an updated guide.

    I was getting and error telling me about “deb” missing on step 3.




    1: yes I have Plex pass

    2: Amd cpu and have Nvidia gtx1650.


    I have been successful with gpu encoding on Ubuntu server and unraid.

    On unraid I had to remove the included drivers and install the nvidia driver and tools.


    The reason I want to use omv is for the ease of mergerfs and snapraid.

    I have had an issue with Unraid and lost a bunch of files.


    Thanks for your help.


    Dan

  • Ok, let‘s start, Dan.


    What is the content of your /etc/apt/sources.list ?


    For OMV6 you have to change step 3 to:


    Code
    deb http://deb.debian.org/debian bullseye-backports main contrib non-free


    So add the upper line to your sources.list. And check that you have no more „buster“ parts in it


    Then:


    Code
    apt update
    apt install -t bullseye-backports nvidia-driver firmware-misc-nonfree


    Check if there aren‘t any error messages.


    If there are now errors proceed:


    Code
    apt install -t bullseye-backports nvidia-xconfig
    
    sudo nvidia-xconfig


    Rest of step 3 is the same:


    Since Docker 5.20.10.2 (I think) there was a change how docker gets access to hardware via cgroups. You need this workaround in the kernel boot parameters:


    Code

    Code
    echo 'GRUB_CMDLINE_LINUX=systemd.unified_cgroup_hierarchy=false' > /etc/default/grub.d/cgroup.cfg
    
    update-grub


    now reboot and the nvidia driver should already work.


    Check with


    Code
    nvidia-smi
  • Step 4: Install Nvidia container toolkit

    Follow the Installation guide by Nvidia:

    https://docs.nvidia.com/datace…oolkit/install-guide.html


    in detail:


    Install curl if you don't have it already:

    Code

    Code
    sudo apt install curl



    Setup the stable repository and the GPG key - all in one command! (use copy button):


    Code

    Code
    distribution=$(. /etc/os-release;echo $ID$VERSION_ID) \
          && curl -fsSL https://nvidia.github.io/libnvidia-container/gpgkey | sudo gpg --dearmor -o /usr/share/keyrings/nvidia-container-toolkit-keyring.gpg \
          && curl -s -L https://nvidia.github.io/libnvidia-container/$distribution/libnvidia-container.list | \
                sed 's#deb https://#deb [signed-by=/usr/share/keyrings/nvidia-container-toolkit-keyring.gpg] https://#g' | \
                sudo tee /etc/apt/sources.list.d/nvidia-container-toolkit.list



    Install the nvidia-docker2 package (and dependencies) after updating the package listing:

    Code

    Code
    sudo apt-get update
    
    apt install -t bullseye-backports nvidia-docker2


    Now install Nvidia encode library and nvidia-smi:

    Code

    Code
    apt install -t bullseye-backports libnvidia-encode1
    
    apt install -t bullseye-backports nvidia-smi


  • Step 5: install Nvidia container runtime:

    Code

    Code
    apt install -t bullseye-backports nvidia-container-runtime


    Step 6: some modifications:

    Change/edit the Daemon configuration file

    /etc/docker/daemon.json :


    Code
    {
        "runtimes": {
            "nvidia": {
                "path": "/usr/bin/nvidia-container-runtime",
                "runtimeArgs": []
            }
        },
        "default-runtime": "nvidia",
        "data-root": "/var/lib/docker"
    }



    and the


    /etc/nvidia-container-runtime/config.toml

    to:

    Code

    Alles anzeigen



    Restart docker:

    Cod

    Code
    sudo systemctl restart docker



    Step 7: starting Plex (in Portainer)



    Docker-image: linuxserver/plex:latest

    Docker


    in Portainer you have to add the following parameters in the "Env" tab:

    name:




    NVIDIA_DRIVER_CAPABILITIES




    Value




    compute,video,utility




    name




    NVIDIA_VISIBLE_DEVICES




    Value




    all




    nameVERSIONValueplexpass

    and in the tab "Runtime & Ressources":

    change the "Runtime" Value from runc to nvidia !!!



    No Privileged mode and no Init set.


    Check that you have set up properly the PUID and GUID values and changed the ownership of the plex config directory to that user !

  • Hi All,,


    I Keep getting the following error, any assistance would be awesome.


    The following packages have unmet dependencies:

    nvidia-driver : PreDepends: nvidia-installer-cleanup but it is not installable

    PreDepends: nvidia-legacy-check (>= 396) but it is not going to be installed

    Depends: nvidia-driver-libs (= 470.103.01-1~bpo11+1) but it is not going to be installed

    Depends: nvidia-driver-bin (= 470.103.01-1~bpo11+1) but it is not going to be installed

    Depends: xserver-xorg-video-nvidia (= 470.103.01-1~bpo11+1) but it is not going to be installed

    Depends: nvidia-vdpau-driver (= 470.103.01-1~bpo11+1) but it is not going to be installed

    Depends: nvidia-alternative (= 470.103.01-1~bpo11+1) but it is not going to be installed

    Depends: nvidia-kernel-dkms (= 470.103.01-1~bpo11+1) but it is not going to be installed or

    nvidia-kernel-470.103.01

    Depends: nvidia-support but it is not installable

    E: Unable to correct problems, you have held broken packages.


    cheers

  • Hi,


    did you purge all the old nvidia packages ?:


    Code
    apt-get purge *nvidia*
    
    apt autoremove
    
    apt autoclean


    If yes, you could try fo fix:


    Code
    sudo apt --fix-broken install
    
    sudo apt-get update --fix-missing
    
    sudo apt-get install -f
    
    sudo dpkg --configure -a


    Unfortunately I'm also not a linux-expert and I don't exactly know what the upper commands do in detail, but you could try them out without messing something up.



    But may be the best way if the upper steps don't help is to reinstall omv :(

  • you can try this for your sources.list:


  • PLEASE RECHECK STEP 6!


    I think there was a formatting problem in the config of daemon.json.

    I‘ve corrected it….









    Hm, thats unusual.


    May be try to reinstall docker and portainer via the OMV webpage.


    Did the nvidia container toolkit install corretly w/o errors ? (Step 4 and following)?


    And doublecheck step 6

  • Hey thanks again,


    It all installed without errors.

    I will try again and report back..


    Dan

Jetzt mitmachen!

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