Could not load library libcudnn_cnn_infer.so.8. Error: libcuda.so: cannot open shared object file: No such file or directory
UserWarning: resource_tracker: There appear to be 56 leaked semaphore objects to clean up at shutdown
warnings.warn('resource_tracker: There appear to be %d ’
我可以通过执行下面的命令成功解决该bug
export LD_LIBRARY_PATH=/usr/local/cuda-11.8/lib64/stubs/:/usr/local/cuda-11.8/lib64:/usr/local/cuda-11.8/cudnn/lib:$LD_LIBRARY_PATH
不过可能得依据安装的cuda版本稍作修改。我这里是cuda-11.8。
export LD_LIBRARY_PATH=/usr/lib/wsl/lib:$LD_LIBRARY_PATH
只需将其添加到 .bashrc 中即可。
确保您的库位于 /usr/lib/wsl/lib 中,要查看它,您可以运行
ldconfig -p | grep cuda
(这种方法对我不起作用)
执行了以下操作来使用 conda 安装它
conda create -n vladui python=3.10.9
conda activate vladui
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
cd ~
git clone https://github.com/vladmandic/automatic
cd automatic
./webui.sh
sudo apt install nvidia-cudnn
或者
conda install -c anaconda cudnn
或
conda install -c conda-forge cudnn
希望能解决问题