驱动安装:
1.屏蔽显卡驱动:
vi /etc/modprobe.d/blacklist-nouveau.conf
添加以下两行
blacklist nouveau
options nouveau modeset=0
保存退出接着执行
update-initramfs -u
reboot
重启后执行:
lsmod | grep nouveau
没有输出即屏蔽了
2.下载驱动:
https://www.nvidia.cn/drivers/details/225542/
chmod 777
运行安装 make gcc等
3.安装torch
pip install torch==1.12.1+cu102 torchvision==0.13.1+cu102 torchaudio==0.12.1 --extra-index-url https://download.pytorch.org/whl/cu102
运行stable diffusion
在虚拟环境运行python lanch.py
由于国内访问hugging face原因安装openai/clip-vit-large-patch14报错
使用国内网站https://hf-mirror.com/openai/clip-vit-large-patch14/tree/main
git clone https://hf-mirror.com/openai/clip-vit-large-patch14 创建在主目录个openai文件夹然后丢进去 修改module.py文件内的地址改成本地刚创建地址即可