前言:博主按照某博主教程的教程成功安装cuda11.7和cudnn8.4.1后,按照paddle官方教程继续安装paddlepaddle,
安装一切顺利,直到最后一步验证
在输入 paddle.utils.run_check()后发生报错如下
>>> import paddle
>>> paddle.utils.run_check()
Running verify PaddlePaddle program ...
I0810 15:20:13.888904 21495 interpretercore.cc:237] New Executor is Running.
W0810 15:20:13.889133 21495 gpu_resources.cc:119] Please NOTE: device: 0, GPU Compute Capability: 8.6, Driver API Version: 12.0, Runtime API Version: 11.7
W0810 15:20:13.892621 21495 gpu_resources.cc:149] device: 0, cuDNN Version: 8.4.
W0810 15:20:15.356758 21495 dynamic_loader.cc:303] The third-party dynamic library (libcuda.so) that Paddle depends on is not configured correctly. (error code is libcuda.so: cannot open shared object file: No such file or directory)
Suggestions:
1. Check if the third-party dynamic library (e.g. CUDA, CUDNN) is installed correctly and its version is matched with paddlepaddle you installed.
2. Configure third-party dynamic library environment variables as follows:
- Linux: set LD_LIBRARY_PATH by `export LD_LIBRARY_PATH=...`
- Windows: set PATH by `set PATH=XXX;
--------------------------------------
C++ Traceback (most recent call last):
--------------------------------------
No stack trace in paddle, may be caused by external reasons.----------------------
Error Message Summary:
----------------------
FatalError: `Segmentation fault` is detected by the operating system.
[TimeInfo: *** Aborted at 1691652015 (unix time) try "date -d @1691652015" if you are using GNU date ***]
[SignalInfo: *** SIGSEGV (@0x0) received by PID 21495 (TID 0x7ff845ff8100) from PID 0 ***]Segmentation fault
其中关键信息如下 :The third-party dynamic library (libcuda.so) that Paddle depends on is not configured correctly. (error code is libcuda.so: cannot open shared object file: No such file or directory)
报错显示我们没有licuda.so库
参考之前的安装教程中添加的环境变量,我前去查看,发现果然没有libcuda.so
(按照字典序libcuda.so应该出现在这里)
于是我进行寻找
sudo find /usr -name libcuda.so*
看到第一个,我想肯定是wsl的问题,于是我添加链接将第一个位置的libcuda放入/usr/local/cuda-11.7/lib64中
sudo ln -s /usr/lib/wsl/lib/libcuda.so /usr/local/cuda-11.7/lib64
出现了,再进行一次paddle的验证
显示安装成功,搞定。