我先透過以下方式產生Docker映像
FROM nvidia/cuda:11.2.0-runtime-ubuntu20.04
ENV CUDNN_VERSION 8.1.1.33
LABEL com.nvidia.cudnn.version="${CUDNN_VERSION}"
RUN apt-get update && apt-get install -y --no-install-recommends \
libcudnn8=$CUDNN_VERSION-1+cuda11.2 \
&& apt-mark hold libcudnn8 && \
rm -rf /var/lib/apt/lists/*
ENV LD_LIBRARY_PATH="/usr/local/cuda-11.2/lib64:/usr/local/cuda-11.2/targets/x86_64-linux/lib:$LD_LIBRARY_PATH"
並在映像內安裝 PaddleOCR 以及 PaddlePaddle cuda 11.2 版本
pip3 install paddlepaddle-gpu==2.1.0.post112 -f https://paddlepaddle.org.cn/whl/mkl/stable.html
pip3 install paddleocr
PaddleOCR進行推理時會報錯
**(PreconditionNotMet) Cannot load cudnn shared library. Cannot invoke method cudnnGetVersion.
[Hint: cudnn_dso_handle should not be null.] (at /paddle/paddle/fluid/platform/dynload/cudnn.cc:59)**
研究了三天了都還沒解決... 有人可以幫忙的嗎?
5条答案
按热度按时间lh80um4z1#
您好,我们已经收到了您的问题,会安排技术人员尽快解答您的问题,请耐心等待。请您再次检查是否提供了清晰的问题描述、复现代码、环境&版本、报错信息等。同时,您也可以通过查看官网API文档、常见问题、历史Issue、AI社区来寻求解答。祝您生活愉快~
Hi! We've received your issue and please be patient to get responded. We will arrange technicians to answer your questions as soon as possible. Please make sure that you have posted enough message to demo your request. You may also check out the API,FAQ,Github Issue and AI community to get the answer.Have a nice day!
monwx1rj2#
看报错是找不到cudnn 库
推荐用Paddle官方镜像
registry.baidubce.com/paddlepaddle/paddle:2.1.0-gpu-cuda11.2-cudnn8
owfi6suc3#
我是用nvidia官方的,cudnn是有安裝的但Paddle找不到
https://gitlab.com/nvidia/container-images/cuda/blob/master/dist/11.2.0/ubuntu20.04-x86_64/runtime/cudnn8/Dockerfile
zzoitvuj4#
设置下CUDNN的环境变量,paddle的docker,cudnn默认安装在
/usr/lib/x86_64-linux-gnu/
可以对比下你cudnn的安装目录,
chy5wohz5#
ln -s /usr/lib/x86_64-linux-gnu/libcudnn.so.8 libcudnn.so
ln -s /usr/local/cuda-11.2/targets/x86_64-linux/lib/libcublas.so.11 libcublas.so
ln -s /usr/local/cuda-11.2/targets/x86_64-linux/lib/libcusolver.so.11 libcusolver.so
添加這三行解決了 謝謝