App "Face Recognition" cannot be installed (pdlib is not available)

Hi folks,

I’m a bit new to Nextcloud and running some tests. My install is running on the VM from Hansson IT. I’m trying to install the Face Recognition app, and getting the message below. Any ideas on how to resolve this?

An error occured during the request. Unable to proceed.
App “Face Recognition” cannot be installed because the following dependencies are not fulfilled: The library pdlib is not available.:heavy_multiplication_x:

If something is missing, you need to install it :wink: Install and activate the php7.x-pdlib module on your server which should also install the underlying pdlib library itself.

Ok, I guess I really need to spend some time learning Linux better. I’m in the process of migrating off Big Tech, so, no more MS Windows. I’ll have to research how to install pdlib.

Hi @DadOfRCA,

If your VM is running Ubuntu focal (20.04), those instructions should work for you:

I hope it helps!

1 Like

Thank you.
Yes, this helps. I’ll play around with this.

I’m having the same issue but now I’m getting “permission denied” when I go to run:

`echo "deb https://repo.delellis.com.ar focal focal" > /etc/apt/sources.list.d/20-pdlib.list`

I downloaded the VM from https://www.hanssonit.se/nextcloud-vm and imported into VMWare. I ran the first setup menu and have NextCloud running but can’t install App “Face Recognition because of this error.

Hey @GetCart3r if you are still on NC20, you can try this script which should make the whole install process much easier :slight_smile:

THanks for the quick reply @szaimen

Sadly this is where my coding/Linux experience is lacking. I went to the link but now sure what I need to do.

Also this issue is on both a dedicated laptop that’s running NextCloud and the VM that I downloaded today. Laptop is v.21 and I thought the VM was21 after updates.

Unfortunately, the facerecognition app isn’t compatible with NC21, yet. So the installation of the app will fail.
If you still had NC20 installed, it would be a simple:

wget https://raw.githubusercontent.com/nextcloud/vm/enh/facerecognition/apps/face-recognition.sh
sudo bash face-recognition.sh

Ahh ok thanks! So the latest VM must also be 21. I will see about downloading an older VM with 20 and give it a try.

1 Like

I’m now at a total loss. I’m running version 20 VM and still when I run either of the commands all I get is "permission denied”

Which commands did you run?

1 Like

Thanks @szaimen finally got it installed. I was getting errors but then selected to uninstall Face Recognition then reinstall and that cleaned it up.

Not sure how long it will take but will see what happens over night.

Thanks!

1 Like

Hi all,
After tinkering around for 7 days to make my nextcloud instance working with Face Recognition and Memories, finally I make it, just want to share my configuration here

It is newest nextcloud (nextcloud 16) and I’m using docker with pdlib and hardware acceleration working. (i5 7600 without any vga card)

Docker compose

version: '3'

services:
  nextcloud:
    build:
      context: ./volumes/nextcloud
      dockerfile: Dockerfile
    container_name: nextcloud
    ports:
      - 8080:80
    volumes:
      - ./volumes/nextcloud/data:/var/www/html/data:rw
      - ./volumes/nextcloud/app:/var/www/html
      - ./volumes/nextcloud/nextcloud.ini:/usr/local/etc/php/conf.d/nextcloud.ini # to make config easier
      - ./volumes/nextcloud/start.sh:/start.sh # for permission on hardware acceleration, ONLY RUN ONCE
      - /dev/dri:/dev/dri # intel/AMD driver
    restart: unless-stopped

Dockerfile

FROM nextcloud:26-apache

RUN apt-get update \
 && apt-get install -y \
    cmake \
    ffmpeg \
    ghostscript \
    git \
    imagemagick \ 
    libbz2-dev \
    liblapack-dev \
    libopenblas-dev \
    libx11-dev \
    sudo \
    nano \
 && apt-get clean

RUN apt-get update && \
    apt-get install -y software-properties-common && \
    apt-add-repository -y non-free && \
    apt-get update && \
    apt-get install -y intel-media-va-driver-non-free ffmpeg

RUN git clone https://github.com/davisking/dlib.git \
 && cd dlib/dlib \
 && mkdir build \
 && cd build \
 && cmake -DBUILD_SHARED_LIBS=ON .. \
 && make \
 && make install

RUN git clone https://github.com/goodspb/pdlib.git /usr/src/php/ext/pdlib

RUN docker-php-ext-install pdlib

RUN docker-php-ext-install bz2

RUN echo '12 * * * * php /var/www/html/occ face:background_job' >> /var/spool/cron/crontabs/www-data

RUN echo '37 * * * * php /var/www/html/occ preview:pre-generate' >> /var/spool/cron/crontabs/www-data

nextcloud.ini (create first before building)

memory_limit = 10G
upload_max_filesize= 10G
post_max_size = 10G
max_execution_time = 3600
max_input_time = 3600

start.sh - run this manually after complete building

#!/bin/bash

GID=`stat -c "%g" /dev/dri/renderD128`
GROUP=$(getent group $GID | cut -d: -f1)
if [ -z "$GROUP" ]; then
    groupadd -g $GID render
    usermod -aG render www-data
fi

then

docker-compose up -d --build

Install your nextcloud first, and add Face recognition apps and Memories (optional)
for post installation, go inside the container

docker exec -it nextcloud bash

Run the start.sh

/bin/sh /start.sh

configure Face Recoginition memory

sudo -u www-data php occ face:setup --memory 10GB

add/update your nextcloud config/config.php inside the array

  'memories.exiftool' => '/var/www/html/custom_apps/memories/exiftool-bin/exiftool-amd64-glibc',
  'memories.vod.path' => '/var/www/html/custom_apps/memories/exiftool-bin/go-vod-amd64',
  'memories.vod.ffmpeg' => '/usr/bin/ffmpeg',
  'memories.vod.ffprobe' => '/usr/bin/ffprobe',
  'memories.vod.bind' => '127.0.0.1:47788',
  'memories.vod.connect' => '127.0.0.1:47788',
  'memories.exiftool_no_local' => true,
  'memories.vod.disable' => false,
  'memories.vod.vaapi' => true,
  'memories.vod.vaapi.low_power' => true,

to verify if you have qsv (QuickSync Video), run this command, and verify if you have h.264_qsv, h.265_qsv, etc working

ffmpeg -decoders | grep qsv
ffmpeg -encoders | grep qsv

And then restart your container

docker-compose restart nextcloud

I hope this helps everyone who wants to create their own nextcloud with face recognition.
PS: I’m not docker expert