Skip to content

Instantly share code, notes, and snippets.

@digitalformula
Forked from miooochi/qnap_emby_nvidia.md
Created November 24, 2023 05:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save digitalformula/0c2f9e29fc37e180fc5dd79c1207f50a to your computer and use it in GitHub Desktop.
Save digitalformula/0c2f9e29fc37e180fc5dd79c1207f50a to your computer and use it in GitHub Desktop.
Some hacks around using NVIDIA GPU for Emby Container with QNAP

Hacks

Some hacks around using NVIDIA GPU for Emby Container with QNAP

Make sure you have NVIDIA driver installed already

Check NVIDIA Driver Path

find /share/ -name "NVIDIA_GPU_DRV"
# /share/ZFS530_DATA/.qpkg/NVIDIA_GPU_DRV

Install Portainer (Recommended)

mkdir -p /share/Container/portainer
docker run -d --restart=unless-stopped -p 9999:9000 -v /var/run/docker.sock:/var/run/docker.sock --name portainer-ce -v /share/Container/portainer:/data portainer/portainer-ce:latest

Prep

mkdir /share/Container/emby
mkdir -p /share/Container/emby/overlay/{upper,work}
# docker-compose.yml
---
version: "3.4"

volumes:
  emby_usr:
    driver: local
    driver_opts:
      type: overlay
      device: overlay
      # modify the nvidia driver path based on your own case
      o: lowerdir=/share/ZFS530_DATA/.qpkg/NVIDIA_GPU_DRV/usr,upperdir=/share/Container/emby/overlay/upper,workdir=/share/Container/emby/overlay/work

services:
  emby-nvidia-init:
    image: linuxserver/emby
    container_name: emby-prep
    environment:
      - PUID=3001       # Change these values as necessary for your own containers
      - PGID=100
      - UMASK=022
      - TZ=Asia/Shanghai
    labels:
      - wud.watch=false
    volumes:
      - emby_usr:/emby_usr
      - /share/ZFS530_DATA/.qpkg/NVIDIA_GPU_DRV/usr/:/nvidia:ro
    entrypoint: /bin/bash -x -c "cp -Rv /usr/* /emby_usr/"
    restart: "no" # only needs to run once
    
  emby:
    image: lscr.io/linuxserver/emby
    container_name: emby
    networks:
      - emby-internal
    environment:
      - PUID=3001
      - PGID=3001
      - TZ=Asia/Shanghai
    volumes:
      - emby_usr:/usr
      - /share/Container/emby:/config
      - /share/Media:/Media
    ports:
      - 8096:8096
    devices:
      - /dev/nvidia0      # optional
      - /dev/nvidiactl    # optional
      - /dev/nvidia-uvm   # optional
    restart: always

  embystat:
    image: lscr.io/linuxserver/embystat
    container_name: embystat
    networks:
      - emby-internal
    environment:
      - PUID=3001
      - PGID=3001
      - TZ=Asia/Shanghai
    ports:
      - 6555:6555
    volumes:
      - /share/Container/emby-stat:/config
    restart: always
    
networks:
  emby-internal:
    name: emby-internal
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment