我知道这在任何意义上都不是机器学习的推荐设置,但我想使用我所拥有的。
我不是专家,有人告诉我 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。一切都没有改变。
不幸的是没有。
尽管官方规格说明“是”,但 CUDA GPU 列表并未提及 MX130 作为其列表的一部分。
(我的笔记本上也运行MX130)
参考:
绝对是的!
我假设计算能力:5.0就足够了。
我使用 conda(处理 cuda、版本兼容性等)在 Python 3.7 中安装的tensorflow-gpu 测试了我的 Geforce MX130
conda install tensorflow-gpu
就是这样!无需采取更多行动。 安装了以下版本:
tensorflow-gpu: 2.1.0
cudatoolkit: 10.1.243
cudnn: 7.6.5
...并且成功了!
安装 Cuda 和 CuDNN。为它们设置路径。要检查 TensorFlow 是否正在使用 GPU,请使用以下命令:
sess = tf.Session(config=tf.ConfigProto(log_device_placement=True))
它应该在其输出中显示您的 GPU 名称。
基于 off.byn 和 Pablo Lanza 的回答,我很困惑! “NVIDIA 提到 MX130 启用了 Cuda,但我在 Cunda wiki 页面中找不到 MX 130(无论可能与否!)”
我安装了 cuda_12.4.0_551.61_windows 但 torch.cuda.is_available() 仍然为 False 我很困惑,考虑到我有“NVIDIA GeForce MX130”GPU,我是否可以使用 PyTorch 的 GPU? 感谢您的时间和考虑 问候 西亚