【WSL安装测试paddle报错】 The third-party dynamic library (libcuda.sois not configured correctly.

安装paddle后使用python测试paddle是否可用

import paddle
paddle.utils.run_check()

报出如下错误
【WSL安装测试paddle报错】 The third-party dynamic library (libcuda.sois not configured correctly._第1张图片
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:

  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;
    Segmentation fault

这是paddle没有找到libcuda.so,在wsl中,该文件在/usr/lib/wsl/lib路径下。
在.bashrc下加入该路径即可。

export LD_LIBRARY_PATH=/usr/lib/wsl/lib:$LD_LIBRARY_PATH

在这里插入图片描述
成功。

你可能感兴趣的:(机器学习,paddle,python,linux)