stable_diffusion_webui docker环境配置

1.新建docker环境

复制代码
docker  run -tid --name  e_commerce_sd --net host --runtime=nvidia  nvidia/cuda:11.1-cudnn8-devel-cent                                                                      os7-ssh /bin/bash

docker exec -ti e_commerce_sd /bin/bash
echo 'export PS1="DOCKER[\u@\h \w]\$"' > ~/.bashrc
exit
docker exec -ti e_commerce_sd /bin/bash
exit
docker cp e_commerce_sd.zip e_commerce_sd:/root
docker exec -ti e_commerce_sd /bin/bash

docker commit e_commerce e_commerce_sd_sam:v1.0

docker images
docker rmi IMAGE ID[:3](前三个数字)

2.安装miniconda

复制代码
yum install wget
wget -c https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh
sh Miniconda3-latest-Linux-x86_64.sh
source ~/.bashrc

conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main/
conda config --set show_channel_urls yes
python -m pip config set global.index-url https://mirrors.aliyun.com/pypi/simple
python -m pip config set global.index-url https://pypi.tuna.tsinghua.edu.cn/simple

conda create -n py38 python==3.8
conda activate py38

3.配置stable_diffusion_webui

直接使用stable_difffusion_webui下的launch.py可能会有些问题,建议

复制代码
pip install open_clip-bb6e834e9c70d9c27d0dc3ecedeebeaeb1ffad6b.zip
pip install CLIP-d50d76daa670286dd6cacf3bcd80b5e4823fc8e1.zip
pip install GFPGAN-8d2447a2d918f8eba5a4a01463fd48e45126a379.zip
pip install -r requirements_versions.txt
pip install opencv-python-headless
pip install gdown

4.安装tensorrt

复制代码
tar -xzvf TensorRT-8.6.1.6.Linux.x86_64-gnu.cuda-11.8.tar.gz

1.利用vim进入~/.bashrc文档,摁住ctrl+g,直接跳到最后一行,摁一下i键,进入插入模式,现在可以编辑文档了。 2.跳到最后一个字符,摁一下换行,可以在下一行输入命令。 3.一般来说在Ubuntu的终端中,ctrl+shift+c是复制,Ctrl+shift+v是粘贴,可以先写好直接粘贴; 4.我们输入第一个环境变量配置:

复制代码
export LD_LIBRARY_PATH=/home/TensorRT-8.6.1.6/lib${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}}
export PATH=/home/TensorRT-8.6.1.6/bin${PATH:+:${PATH}}

5.路径添加好了,该关闭~/.bashrc了,摁一下esc键,退出插入模式; 6.输入冒号:wq,关闭bashrc; 7.这时候还没有生效!需要source一下

复制代码
source ~/.bashrc

cd python
pip install tensorrt-8.6.1-cp38-none-linux_x86_64.whl

安装pycuda

复制代码
pip install pycuda==2019.1

export CUDA_VISIBLE_DEVICES=3
相关推荐
_运维那些事儿17 小时前
VM环境的CI/CD
linux·运维·网络·阿里云·ci/cd·docker·云计算
lpruoyu20 小时前
【Docker进阶-05】Docker网络
网络·docker·容器
三块钱07941 天前
群晖docker部署Mattermost,对接openclaw
运维·docker·容器
苦逼IT运维1 天前
从 0 到 1 理解 Kubernetes:一次“破坏式”学习实践(一)
linux·学习·docker·容器·kubernetes
萧曵 丶1 天前
Docker 面试题
运维·docker·容器
为什么不问问神奇的海螺呢丶1 天前
n9e categraf docker 监控配置
运维·docker·容器
青树寒鸦1 天前
wsl的docker备份mongo和迁移
运维·mongodb·docker·容器
hopsky1 天前
Docker Desktop 报 500
运维·docker·容器
曦云沐1 天前
一键部署ROS2开发环境!Docker run命令详解与实战
docker·容器·ros2
H Journey1 天前
Docker swarm 集群搭建实战
运维·docker·容器