[Tip] Installing Faceswap for AMD in a Docker File

Installing and setting up FaceSwap


Forum rules

Read the FAQs and search the forum before posting a new topic.

Please mark any answers that fixed your problems so others can find the solutions.

Post Reply
User avatar
torzdf
Posts: 1769
Joined: Fri Jul 12, 2019 12:53 am
Answers: 134
Has thanked: 76 times
Been thanked: 354 times

[Tip] Installing Faceswap for AMD in a Docker File

Post by torzdf »

Thanks to Discord user Cyborg, the following is a method that AMD users can use to install Faceswap with the amdgpu-pro driver inside a Docker Container.

dockerfile:

Code: Select all

# sudo docker build -t faceswap/amdgpu .

FROM ubuntu:bionic
ENV DEBIAN_FRONTEND=noninteractive

RUN \
    amdgpu_version="amdgpu-pro-19.30-855429-ubuntu-18.04" \
    && url="http://support.amd.com https://drivers.amd.com/drivers/linux/${amdgpu_version}.tar.xz" \
  \
    && cd \
    && dpkg --add-architecture i386 \
    && apt-get update \
    && apt-get --no-install-recommends install -y ca-certificates curl xz-utils clinfo \
  \
    && curl -L -O --referer ${url} \
  \
    && tar -Jxvf ${amdgpu_version}.tar.xz \
    && rm ${amdgpu_version}.tar.xz \
    && bash ./${amdgpu_version}/amdgpu-pro-install -y \
    && rm -fR ${amdgpu_version} \
  \
    && apt-get install -y opencl-amdgpu-pro \
  \
    && apt-get autoremove -y \
  \
    && apt-get clean autoclean \
    && rm -fR /var/lib/{apt,dpkg}

RUN apt-get install -y python3.8 python3.8-distutils python3.8-tk python3.8-venv git

RUN curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py && python3.8 get-pip.py
RUN git clone https://github.com/deepfakes/faceswap
WORKDIR /faceswap
RUN python3.8 -m venv faceswap-venv && . faceswap-venv/bin/activate
RUN pip install -r requirements_amd.txt

# sudo docker run --rm --name AMGGPU --cpuset-cpus 4 --memory 512mb -v /tmp/.X11-unix:/tmp/.X11-unix -v /media:/media -v $HOME/Videos:$HOME/Videos -e DISPLAY=unix$DISPLAY --device=/dev/dri -ti faceswap/amdgpu python3.8 faceswap.py gui

Additional notes:

Original Discord post: https://discord.com/channels/4419893984 ... 8738269224

My word is final


Tags:

Post Reply