Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(PreconditionNotMet) Cannot load cudnn shared library. Cannot invoke method cudnnGetVersion. #356

Open
BUAACY opened this issue Oct 25, 2024 · 4 comments

Comments

@BUAACY
Copy link

BUAACY commented Oct 25, 2024

【处理中】开启提取视频关键帧...
【处理中】开始提取字幕信息,此步骤可能花费较长时间,请耐心等待...

(PreconditionNotMet) Cannot load cudnn shared library. Cannot invoke method cudnnGetVersion. | 0/204 [00:00<?, ?it/s]
[Hint: cudnn_dso_handle should not be null.] (at ../paddle/phi/backends/dynload/cudnn.cc:60)

0%|▋ | 1/204 [00:01<05:25, 1.60s/it]

@VeteranChauffeur
Copy link

too

@VeteranChauffeur
Copy link

python ./backend/main.py --use_gpu False --show_log True

请输入视频完整路径:/home/video-subtitle-extractor-main/1.mp4
请指定字幕区域 (ymin ymax xmin xmax):832 923 183 1280
识别字幕语言:ch
识别模式:fast
使用GPU进行加速
帧数:1200.0,帧率:30.0
V4-ch_det_fast
V4-ch_rec_fast
【处理中】开启提取视频关键帧...
16:20:29: Logging wxScroll1
16:20:29: Starting program...
16:20:29: CVideoSubFinderApp::OnInitCmdLine...
m_VC.isOpened(): 1 path: /home/video-subtitle-extractor-main/1.mp4 No such file or directory
【处理中】开始提取字幕信息,此步骤可能花费较长时间,请耐心等待...
(PreconditionNotMet) Cannot load cudnn shared library. Cannot invoke method cudnnGetVersion.
[Hint: cudnn_dso_handle should not be null.] (at ../paddle/phi/backends/dynload/cudnn.cc:64)

4%|█▊ | 53/1200 [00:04<01:38, 11.63it/s]

都指定不要GPU了,还是会走到GPU相关代码

@YaoFANGUK
Copy link
Owner

你安装的cuda和cudnn版本可以说下吗

@VeteranChauffeur
Copy link

wget https://developer.nvidia.com/downloads/compute/cudnn/secure/8.9.7/local_installers/12.x/cudnn-local-repo-rhel7-8.9.7.29-1.0-1.x86_64.rpm
yum localinstall cudnn-local-repo-rhel7-8.9.7.29-1.0-1.x86_64.rpm

rpm -ql cudnn-local-repo-rhel7-8.9.7.29.x86_64
ls /var/cudnn-local-repo-rhel7-8.9.7.29/

yum localinstall -y /var/cudnn-local-repo-rhel7-8.9.7.29/libcudnn8-8.9.7.29-1.cuda12.2.x86_64.rpm
yum localinstall -y /var/cudnn-local-repo-rhel7-8.9.7.29/libcudnn8-devel-8.9.7.29-1.cuda12.2.x86_64.rpm
yum localinstall -y /var/cudnn-local-repo-rhel7-8.9.7.29/libcudnn8-samples-8.9.7.29-1.cuda12.2.x86_64.rpm

ls /usr/local/cuda/include/ | grep cudnn
ls /usr/local/cuda/lib64/ | grep libcudnn

mkdir ~/cudnn_temp
cd ~/cudnn_temp
rpm2cpio /var/cudnn-local-repo-rhel7-8.9.7.29/libcudnn8-8.9.7.29-1.cuda12.2.x86_64.rpm | cpio -idmv
rpm2cpio /var/cudnn-local-repo-rhel7-8.9.7.29/libcudnn8-devel-8.9.7.29-1.cuda12.2.x86_64.rpm | cpio -idmv

cp usr/include/cudnn*.h /usr/local/cuda/include/
cp usr/lib64/libcudnn* /usr/local/cuda/lib64/
chmod a+r /usr/local/cuda/include/cudnn*.h /usr/local/cuda/lib64/libcudnn*

ls /usr/local/cuda/include/ | grep cudnn
ls /usr/local/cuda/lib64/ | grep libcudnn

echo 'export PATH=/usr/local/cuda/bin:$PATH' >> ~/.bashrc
echo 'export LD_LIBRARY_PATH=/usr/local/cuda/lib64:$LD_LIBRARY_PATH' >> ~/.bashrc
source ~/.bashrc

重新装cudnn就可以了

不过请教一下,大佬,后面可能需要部署cpu的版本,传--use_gpu False 是不是就不应该报Cannot invoke method cudnnGetVersion错呀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants