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
相关推荐
Starry-sky(jing)1 小时前
crane 下载镜像:不连接 Docker,3 步准备并校验 ARM64 离线包
运维·docker·arm64·crane
对象存储与RustFS2 小时前
GPU 在空转等数据?PyTorch 训练集进 RustFS 的三种接法
后端·docker·云原生
可涵不会debug6 小时前
超级马里奥常驻极空间以后怎么打开?Docker运行游戏页面,手机电脑都能从浏览器进入
游戏·docker·智能手机
姜鱼问生1 天前
网页一片白?Docker 跑 Nginx 读不到文件,403 Forbidden 排查实录
nginx·docker·容器
ms72wx1 天前
Docker 命令学习笔记:从入门到进阶的实战指南
笔记·学习·docker
java_logo1 天前
Docker 部署 Excalidraw:轻松搭建手绘风格白板
运维·docker·容器·excalidraw·白板·轩辕镜像
海的透彻1 天前
如何让docker容器启动时用自定义的用户
java·docker·dubbo
程序员清风1 天前
LibreChat 实战:用 Docker 搭建可扩展的多模型对话平台
运维·docker·容器
Web3&Basketball1 天前
从0到1落地AI Agent沙箱隔离Docker实战:踩坑全记录
运维·docker·容器·agent·容器安全·沙箱隔离
bluebonnet271 天前
【docker】使用regctl免安装docker下载镜像
运维·docker·容器