diff --git a/defaults/main.yml b/defaults/main.yml index 4e960c7..637331e 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -85,4 +85,15 @@ photoprism: user: "photoprism" # MariaDB or MySQL database user name password: "insecure" # MariaDB or MySQL database user password root_password: "insecure" # MariaDB or MySQL database ROOT password - name: "photoprism" # MariaDB or MySQL database schema name \ No newline at end of file + name: "photoprism" # MariaDB or MySQL database schema name + + ## Share hardware devices with FFmpeg and TensorFlow (optional): + devices: [] + # - "/dev/dri:/dev/dri" # Intel QSV + # - "/dev/nvidia0:/dev/nvidia0" # Nvidia CUDA + # - "/dev/nvidiactl:/dev/nvidiactl" + # - "/dev/nvidia-modeset:/dev/nvidia-modeset" + # - "/dev/nvidia-nvswitchctl:/dev/nvidia-nvswitchctl" + # - "/dev/nvidia-uvm:/dev/nvidia-uvm" + # - "/dev/nvidia-uvm-tools:/dev/nvidia-uvm-tools" + # - "/dev/video11:/dev/video11" # Video4Linux Video Encode Device (h264_v4l2m2m) diff --git a/templates/photoprism/docker-compose.yml.j2 b/templates/photoprism/docker-compose.yml.j2 index 0d96e1f..b12d5e6 100644 --- a/templates/photoprism/docker-compose.yml.j2 +++ b/templates/photoprism/docker-compose.yml.j2 @@ -65,16 +65,13 @@ services: # - "/example/family:/photoprism/originals/family" # *Additional* media folders can be mounted like this # - "~/Import:/photoprism/import" # *Optional* base folder from which files can be imported to originals - "./storage:/photoprism/storage" # *Writable* storage folder for cache, database, and sidecar files (DO NOT REMOVE) - ## Share hardware devices with FFmpeg and TensorFlow (optional): - # devices: - # - "/dev/dri:/dev/dri" # Intel QSV - # - "/dev/nvidia0:/dev/nvidia0" # Nvidia CUDA - # - "/dev/nvidiactl:/dev/nvidiactl" - # - "/dev/nvidia-modeset:/dev/nvidia-modeset" - # - "/dev/nvidia-nvswitchctl:/dev/nvidia-nvswitchctl" - # - "/dev/nvidia-uvm:/dev/nvidia-uvm" - # - "/dev/nvidia-uvm-tools:/dev/nvidia-uvm-tools" - # - "/dev/video11:/dev/video11" # Video4Linux Video Encode Device (h264_v4l2m2m) + +{% if photoprism.devices is defined and photoprism.devices|length >= 1 %} + devices: +{% for device in photoprism.devices %} + - "{{ device }} +{% endfor %} +{% endif %} ## Database Server (recommended) ## see https://docs.photoprism.app/getting-started/faq/#should-i-use-sqlite-mariadb-or-mysql