在搭建Stable Diffusion WebUI中遇到的报错信息。
Could not load library libcudnn_cnn_infer.so.8.
解决方案可以参考:https://github.com/vladmandic/automatic/discussions/540
运行下面的命令即可解决。

conda install -c "nvidia/label/cuda-11.8.0" cuda-toolkit
python3 -m pip install nvidia-cudnn-cu11==8.7.0.84
mkdir -p $CONDA_PREFIX/etc/conda/activate.d
echo 'CUDNN_PATH=$(dirname $(python -c "import nvidia.cudnn;print(nvidia.cudnn.__file__)"))' >> $CONDA_PREFIX/etc/conda/activate.d/env_vars.sh
echo 'export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$CONDA_PREFIX/lib/:$CUDNN_PATH/lib' >> $CONDA_PREFIX/etc/conda/activate.d/env_vars.sh
source $CONDA_PREFIX/etc/conda/activate.d/env_vars.sh

Q.E.D.


热爱生活,热爱程序