快速启动roop-unleashed
要求有支持CUDA11.8的显卡+Linux Docker。
使用docker启动roop-unleashed:
docker run -d --gpus all -p 7860:7860 kevinchina/deeplearning:roop-unleashed1
访问:
制作工程使用的一些脚本
基础镜像:
FROM nvidia/cuda:11.8.0-devel-ubuntu22.04
RUN apt-get update && apt-get install -y wget git vim curl
RUN wget http://mirrors.tuna.tsinghua.edu.cn/anaconda/miniconda/Miniconda3-latest-Linux-x86_64.sh -O /tmp/conda.sh && \
bash /tmp/conda.sh -b && rm /tmp/conda.sh
ENV DEBIAN_FRONTEND=noninteractive
# 安装 tzdata 包并设置时区为上海(无交互)
RUN apt-get update && \
apt-get install -y tzdata && \
ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime && \
echo "Asia/Shanghai" > /etc/timezone
RUN ~/miniconda3/bin/conda init bash && . ~/.bashrc
RUN . ~/.bashrc && curl -s https://packagecloud.io/install/repositories/github/git-lfs/script.deb.sh | bash && \
apt-get install -y git-lfs && git-lfs install
RUN apt-get install -y python3-pip
# 打印~/.bashrc
RUN . ~/.bashrc && pip config set global.index-url https://pypi.tuna.tsinghua.edu.cn/simple
RUN . ~/.bashrc && conda create -n py3_10_c2 python=3.10 -y
#RUN . ~/.bashrc && conda activate py3_10_c2 && conda install pytorch==1.13.1 torchvision==0.14.1 torchaudio==0.13.1 pytorch-cuda=11.6 -c pytorch -c nvidia -y
启动了之后去容器里手动安装了:
sudo apt install libgl1 libglib2.0-0
git clone https://github.com/xddun/roop-unleashed.git
cd roop-unleashed
pip install -r requirements.txt
python run.py --listen
然后把容器commit成了镜像(纯纯偷懒),再加上:
FROM kevinchina/deeplearning:roop-unleashed
EXPOSE 7860
ENTRYPOINT cd /roop-unleashed && /root/miniconda3/envs/py3_10_c2/bin/python run.py --listen
这样kevinchina/deeplearning:roop-unleashed1镜像做好了。