From 4b30919b179add181a64ce9b716baa586bd15408 Mon Sep 17 00:00:00 2001 From: pookie Date: Wed, 22 Sep 2021 14:09:22 -0700 Subject: [PATCH 1/2] dockerfile init --- build/linux/Dockerfile | 16 ++++++++++++++++ build/linux/README.md | 15 +++++++++++++++ build/linux/example.sh | 2 ++ build/linux/start.sh | 5 +++++ 4 files changed, 38 insertions(+) create mode 100644 build/linux/Dockerfile create mode 100644 build/linux/README.md create mode 100755 build/linux/example.sh create mode 100755 build/linux/start.sh diff --git a/build/linux/Dockerfile b/build/linux/Dockerfile new file mode 100644 index 0000000..d432bed --- /dev/null +++ b/build/linux/Dockerfile @@ -0,0 +1,16 @@ +FROM nvidia/cuda:11.4.2-cudnn8-devel-ubuntu20.04 +WORKDIR /app +ARG DEBIAN_FRONTEND=noninteractive +RUN apt update +RUN apt -y install libgl1-mesa-glx libegl1-mesa libxrandr2 libxrandr2 libxss1 libxcursor1 libxcomposite1 libasound2 libxi6 libxtst6 curl ffmpeg git nano gnupg2 libsm6 wget unzip libxcb-icccm4 libxkbcommon-x11-0 libxcb-keysyms1 libxcb-icccm4 libxcb-render0 libxcb-render-util0 libxcb-image0 +RUN apt install -y python3 python3-pip +RUN ln -s /usr/bin/python3 /usr/bin/python + +RUN git clone https://github.com/iperov/DeepFaceLive.git + +RUN python -m pip install --upgrade pip +RUN python -m pip install onnxruntime-gpu==1.8.1 cupy-cuda113 numpy==1.21.2 scipy==1.5.4 numexpr opencv-python==4.5.3.56 opencv-contrib-python==4.5.3.56 pyqt6==6.1.1 onnx==1.10.1 torch==1.8.1 torchvision==0.9.1 + +WORKDIR /app/DeepFaceLive +COPY example.sh example.sh +CMD ./example.sh diff --git a/build/linux/README.md b/build/linux/README.md new file mode 100644 index 0000000..a47de96 --- /dev/null +++ b/build/linux/README.md @@ -0,0 +1,15 @@ +# DeepFaceLive Docker + +### Requirements + +* nvidia-driver-470 (current) +* cuda 11.4 (current) + +### Setup + +``` +git clone DeepFaceLive +cd DeepFaceLive/build/linux/ +# start.sh builds and runs container with proper options, then example.sh will start DeepFaceLive with example options +./start.sh +``` diff --git a/build/linux/example.sh b/build/linux/example.sh new file mode 100755 index 0000000..b7c3102 --- /dev/null +++ b/build/linux/example.sh @@ -0,0 +1,2 @@ +#!/bin/bash +python main.py run DeepFaceLive --userdata-dir /data/ diff --git a/build/linux/start.sh b/build/linux/start.sh new file mode 100755 index 0000000..159983f --- /dev/null +++ b/build/linux/start.sh @@ -0,0 +1,5 @@ +#!/bin/bash +# Warning xhost + is overly permissive and will reduce system security. Edit as desired +docker build . -t deepfacelive +xhost + +docker run --ipc host --gpus all -e DISPLAY=$DISPLAY -v /tmp/.X11-unix:/tmp/.X11-unix -v $(pwd)/data/:/data/ --rm -it deepfacelive From 2c30ce9c8ef540b800cdce726c631178fff3bbdb Mon Sep 17 00:00:00 2001 From: pookie Date: Wed, 22 Sep 2021 17:55:16 -0700 Subject: [PATCH 2/2] base image update --- build/linux/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/linux/Dockerfile b/build/linux/Dockerfile index d432bed..00dc22d 100644 --- a/build/linux/Dockerfile +++ b/build/linux/Dockerfile @@ -1,4 +1,4 @@ -FROM nvidia/cuda:11.4.2-cudnn8-devel-ubuntu20.04 +FROM nvidia/cuda:11.4.2-cudnn8-runtime-ubuntu20.04 WORKDIR /app ARG DEBIAN_FRONTEND=noninteractive RUN apt update