yum update -ysystemctl disable firewalld --now
systemctl disable postfix(如对外服务请自行配置安全组/防火墙)
echo "* soft nofile 65535" >> /etc/security/limits.conf
echo "* hard nofile 65535" >> /etc/security/limits.confecho 2048 > /proc/sys/vm/nr_hugepagesyum install -y gcc kernel-devel
sh NVIDIA-Linux-x86_64-*.run验证:
nvidia-smipip install torch torchvision --index-url https://download.pytorch.org/whl/cu118nvidia-smi -pm 1python -m venv sd-env
source sd-env/bin/activatepip install xformers--xformers--medvram # 中等显存
--lowvram # 低显存
--precision full # 稳定性
--no-half # 老显卡--api结合:
FROM nvidia/cuda:12.1-runtimemodels/Stable-diffusion| 优化项 | 提升 |
|---|---|
| xformers | 30–50% |
| --medvram | 显存省 30% |
| CUDA 12 | 5–15% |
| API 模式 | 并发更稳定 |
✅ 最佳实践
如果你愿意,我可以:
你目前是 哪张显卡 + 什么用途(绘画 / 接口 / 批量)?