I've sifted through at least 50 web posts on how to install the Nvidia drivers in order to get docker to recognize the driver and make Tdarr and Plex use the GPU to transcode my videos. I became more confused the more I read. Folks tend to make things more complicated than they need to be. This will probably work for other Nvidia cards as well.
I hope this helps others.
I've narrowed my install down to 4 major steps. I am not one to re-invent the wheel and even happier when I can mostly just cut an paste code.
The instruction below worked for my setup. Your mileage may vary.
1) Install the Nvida drivers
2) Install the Nvidia Container Toolkit
3) Don't allow OMV to overwrite /etc/docker/daemon.json
4) Install Tdarr and Plex through OMV>Services>Compose>Files
1) - Check what version of Debian you are running and install the driver
You should get something like this:
root@omv6:~# lsb_release -d
Description: Debian GNU/Linux 11 (bullseye)
root@omv6:~#
- Follow the very easy instruction in the Debian wiki to install the driver. https://wiki.debian.org/Nvidia…#Debian_11_.22Bullseye.22
2) Install the Nvidia Container Toolkit following the very easy instructions on their website.
Once the driver and toolkit is installed, you should a similar output to the one below.
Screenshot 2023-11-23 183656.jpg
3) NOTE: Upon OMV reboot and updates - the /etc/docker/daemon.json will be overwritten.
To stop this:
Go into your OMV GUI /Services/Compose/Settings
In the "Docker storage" Section remove /var/library/docker and then save.
You can then reboot the server to test that the daemon.json file is not being overwritten.
Screenshot 2024-02-03 105518.png
4) Install Tdarr through OMV>Services>Compose>Files
- Be careful about format/spacing. Compose is finicky and may not start if you have a heading in the wrong space.
The original example came from the Tdarr Compose section. I just had to tweak them for my OMV setup.
Example from my system. Remember change the environment variables and volume section parameters to your OMV system.
version: "3.4"
services:
tdarr:
container_name: tdarr
image: ghcr.io/haveagitgat/tdarr:latest
restart: unless-stopped
network_mode: bridge
ports:
- 8265:8265 # webUI port
- 8266:8266 # server port
environment:
- TZ=America/New_York
- PUID=0
- PGID=0
- UMASK_SET=002
- serverIP=192.168.1.5
- serverPort=8266
- webUIPort=8265
- internalNode=true
- inContainer=true
- ffmpegVersion=6
- nodeName=MyInternalNode
- NVIDIA DRIVER CAPABILITIES=all
- NVIDIA VISIBLE DEVICES=all
volumes:
- /srv/dev-disk-by-uuid-5c2eeef7-116c-4957-8428-cd205efd1bd2/compose/tdarr/server:/app/server
- /srv/dev-disk-by-uuid-5c2eeef7-116c-4957-8428-cd205efd1bd2/compose/tdarr/configs:/app/configs
- /srv/dev-disk-by-uuid-5c2eeef7-116c-4957-8428-cd205efd1bd2/compose/tdarr/logs:/app/logs
- /srv/dev-disk-by-uuid-5c2eeef7-116c-4957-8428-cd205efd1bd2/media2:/media
- /srv/transcoder:/temp
devices:
- /dev/dri:/dev/dri
deploy:
resources:
reservations:
devices:
- driver: nvidia
count: all
capabilities: [gpu]
tdarr-node:
container_name: tdarr-node
image: ghcr.io/haveagitgat/tdarr_node:latest
restart: unless-stopped
network_mode: service:tdarr
environment:
- TZ=America/New_York
- PUID=0
- PGID=0
- UMASK_SET=002
- nodeName=MyExternalNode
- serverIP=192.168.1.5
- serverPort=8266
- inContainer=true
- ffmpegVersion=6
- NVIDIA DRIVER CAPABILITIES=all
- NVIDIA VISIBLE DEVICES=all
volumes:
- /srv/dev-disk-by-uuid-5c2eeef7-116c-4957-8428-cd205efd1bd2/compose/tdarr/configs:/app/configs
- /srv/dev-disk-by-uuid-5c2eeef7-116c-4957-8428-cd205efd1bd2/compose/tdarr/logs:/app/logs
- /srv/dev-disk-by-uuid-5c2eeef7-116c-4957-8428-cd205efd1bd2/media2:/media
- /srv/transcoder:/temp
devices:
- /dev/dri:/dev/dri
deploy:
resources:
reservations:
devices:
- driver: nvidia
count: all
capabilities: [gpu]
Alles anzeigen
- Install PLEX through OMV>Services>Compose>Files
version: "2.1"
services:
plex:
image: ghcr.io/linuxserver/plex
container_name: plex
network_mode: host
environment:
- PUID=0
- PGID=0
- VERSION=docker
- PLEX_CLAIM= #optional
- NVIDIA_VISIBLE_DEVICES=all
- NVIDIA_DRIVER_CAPABILITIES=compute,video,utility
volumes:
- /srv/dev-disk-by-uuid-5c2eeef7-116c-4957-8428-cd205efd1bd2/compose/plex:/config
- /srv/dev-disk-by-uuid-5c2eeef7-116c-4957-8428-cd205efd1bd2/media2/videos/tvshows:/tv
- /srv/dev-disk-by-uuid-5c2eeef7-116c-4957-8428-cd205efd1bd2/media2/videos/movies:/movies
- /srv/dev-disk-by-uuid-5c2eeef7-116c-4957-8428-cd205efd1bd2/media2/music/flac_clean:/music
- /srv/transcoder/plex:/transcode
devices:
- /dev/dri:/dev/dri
deploy:
resources:
reservations:
devices:
- driver: nvidia
count: all
capabilities: [gpu]
restart: unless-stopped
Alles anzeigen
If you are the kind of person that can't be satisfied with just the basics, here is the explanation of the various gpu settings that you can use in your compose yaml file.
Me, I like to set it and forget it once it all works. My server has been sitting in a closet for 8 years and I just took it out to update the eight ( 8 year old) 4TB drives in a raid 6 array that have never failed me. The drives were getting a little slow an cranky. 4 out of the 8 drives were throwing a lot of SMART errors. I also neede more space. I ended up adding five 14TB drives in a raid 6 array. I hadn't updated OMV is a while. I figured I might as well update while I am building a new array. I did not realize OMV got rid of yacht and portainer...so here I am.
Once I linked my GPU to Tdarr in the compose file, my Tdarr CPU transcode speed went from the CPU 23fps to the Nvidia GPU cranking out 8000-13,000fps.
Screenshot 2023-11-23 125131.jpg
Once I linked my GPU to the Plex container it now shows hardware (hw) transcode when needed.
Screenshot 2023-11-23 135645.jpg
Tdarr Plugin GPU Transcode Setting
Make sure to use a Tdarr GPU Plugin that uses your GPU and set the switch to use "NVENC". Here is my Tdarr plugin stack that transcodes using the GPU.