安装paddle后使用python测试paddle是否可用
import paddle paddle.utils.run_check()
报出如下错误
Running verify PaddlePaddle program …
W0805 12:10:54.786352 5446 gpu_resources.cc:61] Please NOTE: device: 0, GPU Compute Capability: 7.5, Driver API Version: 11.7, Runtime API Version: 11.2
W0805 12:10:54.791039 5446 gpu_resources.cc:91] device: 0, cuDNN Version: 8.1.
W0805 12:10:55.927047 5446 dynamic_loader.cc:305] 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:
- Check if the third-party dynamic library (e.g. CUDA, CUDNN) is installed correctly and its version is matched with paddlepaddle you installed.
- 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;
Segmentation fault
这是paddle没有找到libcuda.so,在wsl中,该文件在/usr/lib/wsl/lib路径下。
在.bashrc下加入该路径即可。
export LD_LIBRARY_PATH=/usr/lib/wsl/lib:$LD_LIBRARY_PATH
成功。