ImportError: libcudart.so.10.2: cannot open shared object file: No such file or directory

一、问题描述

  • 在安装paddlepaddle-gpu版本后,check的过程中出现如下问题:
    在这里插入图片描述

二、问题分析

  • 从报错来看,应该是系统找不到libcudart.so.10.2,所以应该按照如下步骤排查:
    • 首先看安装目录下有没有libcudart.so.10.2这个文件
    • 如果没有的话,说明安装出错,需要重新去安装对应gpu版本的包
    • 如果有的话,说明是系统没找到,就应该手动添加PATH

三、解决问题

  • 查找是否存在libcudart.so.10.2:
find . -name "libcudart.so.10.2"
  • 查得在/opt/conda/envs/paddle/lib下存在libcudart.so.10.2

在这里插入图片描述

  • 于是,将/opt/conda/envs/paddle/lib添加到PATH
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/opt/conda/envs/paddle/lib
  • 最后,再check一下,大功告成:

在这里插入图片描述

猜你喜欢

转载自blog.csdn.net/wjinjie/article/details/129924786