小编phe*_*ath的帖子

在 Ubuntu 20.04 上使用 GPU 设置 Tensorflow 2.4,无需 sudo

我可以访问具有 Ubuntu 20.04 设置和 GPU 的虚拟机。系统管理员已经安装了最新的 Cuda 驱动程序,但不幸的是,这还不足以在 Tensorflow 中使用 GPU,因为每个版本的 TF 在涉及特定的 Cuda Toolkit + CuDNN 版本集时都可能非常挑剔。我没有 sudo 权限,所以我需要在本地安装所有内容。

nvidia-smi
Run Code Online (Sandbox Code Playgroud)

返回驱动程序版本:465.19.01 CUDA 版本:11.3

python -c "import tensorflow as tf, logging; logging.basicConfig(level=logging.INFO, format='%(asctime)s %(message)s'); tf.config.list_physical_devices('GPU');"
Run Code Online (Sandbox Code Playgroud)

回报

2021-05-11 10:56:26.737279:W tensorflow/stream_executor/platform/default/dso_loader.cc:60] 无法加载动态库“libcudart.so.11.0”;dlerror: libcudart.so.11.0: 无法打开共享对象文件: 没有这样的文件或目录
2021-05-11 10:56:26.737338: I tensorflow/stream_executor/cuda/cudart_stub.cc:29] 如果这样做,请忽略上面的 cudart dlerror您的机器上没有设置 GPU。
2021-05-11 10:56:28.313896:我tensorflow/compiler/jit/xla_cpu_device.cc:41]不创建XLA设备,tf_xla_enable_xla_devices未设置
2021-05-11 10:56:28.315540:我tensorflow/stream_executor/platform/ default/dso_loader.cc:49] 成功打开动态库 libcuda.so.1
2021-05-11 10:56:28.324232: I tensorflow/stream_executor/cuda/cuda_gpu_executor.cc:941] 从 SysFS 读取的成功 NUMA 节点具有负值(-1),但必须至少有一个 NUMA 节点,因此返回 NUMA 节点零
2021-05-11 10:56:28.324707: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1720] Found device 0 with属性:
pciBusID:0000:00:05.0 …

python ubuntu tensorflow ubuntu-20.04

2
推荐指数
1
解决办法
3871
查看次数

标签 统计

python ×1

tensorflow ×1

ubuntu ×1

ubuntu-20.04 ×1