Skip to content
This repository was archived by the owner on Nov 13, 2024. It is now read-only.

Commit 32202d6

Browse files
authored
Merge pull request #91 from CeeBeeEh/master
OpenCL fix for Linux Docker
2 parents 6f28fdd + 3b3366e commit 32202d6

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

build/linux/Dockerfile

+3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
FROM nvidia/cuda:11.4.2-cudnn8-runtime-ubuntu20.04
22
WORKDIR /app
33
ARG DEBIAN_FRONTEND=noninteractive
4+
ARG NV_VER
45
RUN apt update
56
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
67
RUN apt install -y python3 python3-pip
@@ -11,6 +12,8 @@ RUN git clone https://github.com/iperov/DeepFaceLive.git
1112
RUN python -m pip install --upgrade pip
1213
RUN python -m pip install onnxruntime-gpu==1.12.1 numpy==1.21.6 h5py numexpr protobuf==3.20.1 opencv-python==4.6.0.66 opencv-contrib-python==4.6.0.66 pyqt6==6.3.1 onnx==1.12.0 torch==1.10.0 torchvision==0.11.1
1314

15+
RUN apt install -y libnvidia-compute-$NV_VER
16+
1417
WORKDIR /app/DeepFaceLive
1518
COPY example.sh example.sh
1619
CMD ./example.sh

build/linux/start.sh

+4-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
#!/bin/bash
22

3+
NV_LIB=$(locate nvidia.ko |grep $(uname -r) |grep dkms | head -1)
4+
NV_VER=$(modinfo $NV_LIB | grep ^version |awk '{print $2}'|awk -F '.' '{print $1}')
5+
36
DATA_FOLDER=$(pwd)/data/
47
declare CAM0 CAM1 CAM2 CAM3
58
printf "\n"
@@ -28,6 +31,6 @@ shift "$(($OPTIND -1))"
2831
printf "\n"
2932

3033
# Warning xhost + is overly permissive and will reduce system security. Edit as desired
31-
docker build . -t deepfacelive
34+
docker build . -t deepfacelive --build-arg NV_VER=$NV_VER
3235
xhost +
3336
docker run --ipc host --gpus all -e DISPLAY=$DISPLAY -v /tmp/.X11-unix:/tmp/.X11-unix -v $DATA_FOLDER:/data/ $CAM0 $CAM1 $CAM2 $CAM3 --rm -it deepfacelive

0 commit comments

Comments
 (0)