【Deepin 20系统+Tensorflow 2】Linux系统解决Could not load dynamic library ‘libcudart.so.10.0‘

简介: 本文描述了在Deepin 20系统中使用TensorFlow 2时遇到GPU未被利用的问题,并给出了相关的调试日志信息。

问题

环境

Deepin 20系统: Debian OS
NVIDIIA 驱动: NVIDIA-SMI 455.45.01 Driver Version: 455.45.01
nvidia-smi 显示cuda版本: CUDA Version: 11.1
安装的Cuda版本:11.1
Tensorflow2.0

在使用tensorflow2跑程序时,GPU没有利用起来,通过代码查看GPU使用情况,输出日志如下

import tensorflow as tf
print(tf.test.is_gpu_available())

输出日志

2021-03-08 19:51:11.747354: I tensorflow/core/platform/cpu_feature_guard.cc:142] Your CPU supports instructions that this TensorFlow binary was not compiled to use: AVX2 FMA
2021-03-08 19:51:11.774909: I tensorflow/core/platform/profile_utils/cpu_utils.cc:94] CPU Frequency: 2899885000 Hz
2021-03-08 19:51:11.775871: I tensorflow/compiler/xla/service/service.cc:168] XLA service 0x55d501378430 executing computations on platform Host. Devices:
2021-03-08 19:51:11.775926: I tensorflow/compiler/xla/service/service.cc:175]   StreamExecutor device (0): Host, Default Version
2021-03-08 19:51:11.779414: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully opened dynamic library libcuda.so.1
2021-03-08 19:51:11.881523: I tensorflow/stream_executor/cuda/cuda_gpu_executor.cc:1006] successful NUMA node read from SysFS had negative value (-1), but there must be at least one NUMA node, so returning NUMA node zero
2021-03-08 19:51:11.882130: I tensorflow/compiler/xla/service/service.cc:168] XLA service 0x55d50140f0f0 executing computations on platform CUDA. Devices:
2021-03-08 19:51:11.882152: I tensorflow/compiler/xla/service/service.cc:175]   StreamExecutor device (0): GeForce RTX 2070, Compute Capability 7.5
2021-03-08 19:51:11.882334: I tensorflow/stream_executor/cuda/cuda_gpu_executor.cc:1006] successful NUMA node read from SysFS had negative value (-1), but there must be at least one NUMA node, so returning NUMA node zero
2021-03-08 19:51:11.882678: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1618] Found device 0 with properties: 
name: GeForce RTX 2070 major: 7 minor: 5 memoryClockRate(GHz): 1.62
pciBusID: 0000:01:00.0
2021-03-08 19:51:11.882903: W tensorflow/stream_executor/platform/default/dso_loader.cc:55] Could not load dynamic library 'libcudart.so.10.0'; dlerror: libcudart.so.10.0: cannot open shared object file: No such file or directory; LD_LIBRARY_PATH: /usr/local/cuda/lib64:/home/mgege007/cuda-11/lib64::/usr/local/cuda/extras/CUPTI/lib64
2021-03-08 19:51:11.882991: W tensorflow/stream_executor/platform/default/dso_loader.cc:55] Could not load dynamic library 'libcublas.so.10.0'; dlerror: libcublas.so.10.0: cannot open shared object file: No such file or directory; LD_LIBRARY_PATH: /usr/local/cuda/lib64:/home/mgege007/cuda-11/lib64::/usr/local/cuda/extras/CUPTI/lib64
2021-03-08 19:51:11.883060: W tensorflow/stream_executor/platform/default/dso_loader.cc:55] Could not load dynamic library 'libcufft.so.10.0'; dlerror: libcufft.so.10.0: cannot open shared object file: No such file or directory; LD_LIBRARY_PATH: /usr/local/cuda/lib64:/home/mgege007/cuda-11/lib64::/usr/local/cuda/extras/CUPTI/lib64
2021-03-08 19:51:11.883131: W tensorflow/stream_executor/platform/default/dso_loader.cc:55] Could not load dynamic library 'libcurand.so.10.0'; dlerror: libcurand.so.10.0: cannot open shared object file: No such file or directory; LD_LIBRARY_PATH: /usr/local/cuda/lib64:/home/mgege007/cuda-11/lib64::/usr/local/cuda/extras/CUPTI/lib64
2021-03-08 19:51:11.883202: W tensorflow/stream_executor/platform/default/dso_loader.cc:55] Could not load dynamic library 'libcusolver.so.10.0'; dlerror: libcusolver.so.10.0: cannot open shared object file: No such file or directory; LD_LIBRARY_PATH: /usr/local/cuda/lib64:/home/mgege007/cuda-11/lib64::/usr/local/cuda/extras/CUPTI/lib64
2021-03-08 19:51:11.883269: W tensorflow/stream_executor/platform/default/dso_loader.cc:55] Could not load dynamic library 'libcusparse.so.10.0'; dlerror: libcusparse.so.10.0: cannot open shared object file: No such file or directory; LD_LIBRARY_PATH: /usr/local/cuda/lib64:/home/mgege007/cuda-11/lib64::/usr/local/cuda/extras/CUPTI/lib64
2021-03-08 19:51:11.883334: W tensorflow/stream_executor/platform/default/dso_loader.cc:55] Could not load dynamic library 'libcudnn.so.7'; dlerror: libcudnn.so.7: cannot open shared object file: No such file or directory; LD_LIBRARY_PATH: /usr/local/cuda/lib64:/home/mgege007/cuda-11/lib64::/usr/local/cuda/extras/CUPTI/lib64
2021-03-08 19:51:11.883344: W tensorflow/core/common_runtime/gpu/gpu_device.cc:1641] Cannot dlopen some GPU libraries. Please make sure the missing libraries mentioned above are installed properly if you would like to use GPU. Follow the guide at https://www.tensorflow.org/install/gpu for how to download and setup the required libraries for your platform.
Skipping registering GPU devices...
2021-03-08 19:51:11.883362: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1159] Device interconnect StreamExecutor with strength 1 edge matrix:
2021-03-08 19:51:11.883370: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1165]      0 
2021-03-08 19:51:11.883376: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1178] 0:   N 
False

问题解决

参考资料

日志说明:正在寻找CUDA 10.0。 但是我的CUDA版本是11.1,不能使用CUDA 11.1或CUDA 11.2替代它。 仅仅需要去官网下载CUDA10.0和对应的cudnn安装即可,不需要更改NVIDIA驱动。并且注意,根据自己的文件CUDA路径,进行相应的环境变量的配置

步骤
(1)CUDA+CuDnn安装过程参考本人另一篇博客Deepin 20系统安装CUDA+cudnn
(2)更改CUDA环境变量参考本人另一篇博客Deepin 20系统切换CUDA版本

相关实践学习
在云上部署ChatGLM2-6B大模型(GPU版)
ChatGLM2-6B是由智谱AI及清华KEG实验室于2023年6月发布的中英双语对话开源大模型。通过本实验,可以学习如何配置AIGC开发环境,如何部署ChatGLM2-6B大模型。
目录
相关文章
|
1月前
|
Ubuntu Linux
计算机基础知识:linux系统怎么安装?
在虚拟机软件中创建一个新的虚拟机,并选择相应操作系统类型和硬盘空间大小等参数。将下载的 ISO 镜像文件加载到虚拟机中。启动虚拟机,进入安装界面,并按照步骤进行安装。安装完成后,可以在虚拟机中使用 Linux 系统。
|
1月前
|
缓存 监控 Linux
Linux系统清理缓存(buff/cache)的有效方法。
总结而言,在大多数情形下你不必担心Linux中buffer与cache占用过多内存在影响到其他程序运行;因为当程序请求更多内存在没有足够可用资源时,Linux会自行调整其占有量。只有当你明确知道当前环境与需求并希望立即回收这部分资源给即将运行重负载任务之前才考虑上述方法去主动干预。
706 10
|
1月前
|
安全 Linux 数据安全/隐私保护
为Linux系统的普通账户授予sudo访问权限的过程
完成上述步骤后,你提升的用户就能够使用 `sudo`命令来执行管理员级别的操作,而无需切换到root用户。这是一种更加安全和便捷的权限管理方式,因为它能够留下完整的权限使用记录,并以最小权限的方式工作。需要注意的是,随意授予sudo权限可能会使系统暴露在风险之中,尤其是在用户不了解其所执行命令可能带来的后果的情况下。所以在配置sudo权限时,必须谨慎行事。
308 0
|
1月前
|
Ubuntu Linux 开发者
国产 Linux 发行版再添新成员,CutefishOS 系统简单体验
当然,系统生态构建过程并不简单,不过为了帮助国产操作系统优化生态圈,部分企业也开始用国产操作系统替代 Windows,我们相信肯定会有越来越多的精品软件登录 Linux 平台。
106 0
|
1月前
|
Ubuntu 安全 Linux
Linux系统入门指南:从零开始学习Linux
Shell脚本是一种强大的自动化工具,可以帮助您简化重复的任务或创建复杂的脚本程序。了解Shell脚本的基本语法和常用命令,以及编写和运行Shell脚本的步骤,将使您更高效地处理日常任务。
199 0
|
1月前
|
Ubuntu Linux 图形学
Linux学习之Linux桌面系统有哪些?
Cinnamon:与MATE类似,Cinnamon 拥有 GNOME 和 Unity 等其它桌面环境所没有的种种功能,是高度可定制的桌面环境,不需要任何外部插件、窗口组件和调整工具来定制桌面。
113 0
|
1月前
|
Ubuntu 安全 Linux
十款常用Linux系统介绍
本文不是什么大盘点。市面上有好几百款发行版,每款发行版在某个方面都与众不同。不可能在此全部罗列,本文只罗列了十款最常见的Linux发行版(世界上只有两种人,一种是懂二进制的,另一种是不懂二进制的)。请宣传Linux的魅力或威力。
|
1月前
|
Ubuntu 安全 Linux
linux系统|Ubuntu 18.10 如期正式发布,新面孔新技术都来了
微软公司也终于沉不住气要在linux开源系统开疆扩土了。mscode这样的工具的确好用,虽然差第一名那么一点儿,但是最老版的公司出版的软件的确很是让人动心!
|
1月前
|
Ubuntu Linux 数据安全/隐私保护
Win10安装Linux子系统教程!如何在Win10系统中安装Ubuntu!
登录系统后,输入cd /返回上一级,然后再输入“ls”查看一下系统文件目录,看看对不对!
|
1月前
|
Web App开发 安全 Linux
Linux 比起其他系统的5 个优点和 5 个缺点
对Linux系统感兴趣的朋友,可以点击下方书籍进行学习。