【问题标题】:Can I get tensorflow-gpu to work with NVIDIA GeForce MX130?我可以让 tensorflow-gpu 与 NVIDIA GeForce MX130 一起工作吗?
【发布时间】:2020-06-19 21:02:03
【问题描述】:

我知道这在任何意义上都不是机器学习的推荐设置,但我想使用我所拥有的。

不是专家,有人告诉我 tf-gpu 应该适用于 cuda 支持的任何设备。

当我跑步时:

from numba import cuda
cuda.detect()

我明白了:

Found 1 CUDA devices
id 0        b'GeForce MX130'                              [SUPPORTED]
                      compute capability: 5.0
                           pci device id: 0
                              pci bus id: 1
Summary:
    1/1 devices are supported

我可以让 GPU 处理一些基本的“矢量化”任务。

另外,正在运行:

import tensorflow as tf
tf.test.is_built_with_cuda()

将返回 True

但是,正在运行

tf.config.experimental.list_physical_devices('gpu')

将返回一个空列表。

跑步:

print("Num GPUs Available: ", len(tf.config.experimental.list_physical_devices('GPU')))

将返回:

Num GPUs Available:  0

跑步:

strategy = tf.distribute.MirroredStrategy()
print("Number of devices: {}".format(strategy.num_replicas_in_sync))

将返回:

WARNING:tensorflow:There are non-GPU devices in `tf.distribute.Strategy`, not using nccl allreduce.
INFO:tensorflow:Using MirroredStrategy with devices ('/job:localhost/replica:0/task:0/device:CPU:0',)
Number of devices: 1

我已经用非 GPU 版本的 tensorflow 训练了一些基本模型,但我不知道如何处理 tf-gpu。根据任务管理器的说法,我能够用 CuDNNLSTM 层拟合模型,但脚本没有使用 GPU。

我将不胜感激任何关于如何让它使用我的“gpu”的建议或确认它是不可能的。谢谢!

已编辑:

我卸载了 keras 和两个 tensorflow 版本,只安装了 tensorflow-gpu。没有任何改变。

【问题讨论】:

  • 你能在 Tensorflow 上使用 NVIDIA GeForce MX130 吗?我有相同的运行 Windows 10。

标签: python tensorflow jupyter-notebook gpu


【解决方案1】:

很遗憾没有。

尽管官方规格表明“是”,但 CUDA GPU 列表并未将 MX130 列为其列表的一部分。

(我也在笔记本上运行 MX130)

参考:

【讨论】:

  • 我将此标记为正确答案,因为我尝试了其他人建议的解决方案,但都没有奏效。
  • 答案不正确。如果您使用的是 Windows,请查看您的环境路径变量。在我的系统中,它指向... C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.2\bin; C:\Program Files\NVIDIA GPU 计算工具包\CUDA\v11.2\libnvvp; C:\Apps\CUDNN8.1\bin;
【解决方案2】:

绝对是的!

我假设计算能力:5.0就足够了。

我在 Python 3.7 中使用 conda(处理 cuda、版本兼容性等)安装的 tensorflow-gpu 测试了我的 Geforce MX130

conda install tensorflow-gpu

就是这样!无需采取更多行动。 安装了以下版本:

tensorflow-gpu: 2.1.0
cudatoolkit: 10.1.243
cudnn: 7.6.5

...它成功了!

【讨论】:

    【解决方案3】:

    同时安装 Cuda 和 CuDNN。为他们设置路径。要检查 TensorFlow 是否使用 GPU,请使用以下命令:

    sess = tf.Session(config=tf.ConfigProto(log_device_placement=True))

    它应该在其输出中显示您的 GPU 名称。

    【讨论】:

    • 感谢您的回答,此功能不适用于我的 tf (2.2.0) 版本
    【解决方案4】:

    是的,你可以...tensorflow-gpu 2.5.0 + CUDA 11.2 + CUDNN 8.1

    如果您使用的是 Windows,请查看您的环境路径变量。在我的系统中,它指向...

    C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.2\bin;

    C:\Program Files\NVIDIA GPU 计算工具包\CUDA\v11.2\libnvvp;

    C:\Apps\CUDNN8.1\bin;

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2021-08-10
      • 2019-08-14
      • 2019-03-17
      • 2018-01-17
      • 2019-02-15
      • 1970-01-01
      相关资源
      最近更新 更多