为什么我的colab笔记本不使用GPU? [英] Why isn't my colab notebook using the GPU?

查看:293
本文介绍了为什么我的colab笔记本不使用GPU?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我在选择了GPU之后在我的colab笔记本上运行代码时,我收到一条消息,提示您已连接到GPU运行时,但未使用GPU".现在,我知道之前曾问过类似的问题,但我仍然不明白为什么.我正在数百次迭代的数据集上运行PCA,以进行多次试验.没有GPU的时间大约是笔记本电脑上的时间,这可能会超过12个小时,从而导致colab超时.colab的GPU是否仅限于像tensorflow这样的机器学习库?有没有办法解决这个问题,以便我可以利用GPU来加快分析速度?

When I run code on my colab notebook after having selected the GPU, I get a message saying "You are connected to a GPU runtime, but not utilizing the GPU". Now I understand similar questions have been asked before, but I still don't understand why. I am running PCA on a dataset over hundreds of iterations, for multiple trials. Without a GPU it takes about as long as it does on my laptop, which can be >12 hours, resulting in a time out on colab. Is colab's GPU restricted to machine learning libraries like tensorflow only? Is there a way around this so I can take advantage of the GPU to speed up my analysis?

推荐答案

Colab不仅限于Tensorflow.

Colab is not restricted to Tensorflow only.

Colab提供三种运行时:标准运行时(带有CPU),GPU运行时(包括GPU)和TPU运行时(包括TPU).

Colab offers three kinds of runtimes: a standard runtime (with a CPU), a GPU runtime (which includes a GPU) and a TPU runtime (which includes a TPU).

您已连接到GPU运行时,但未使用GPU"表示用户已连接到GPU运行时,但未利用GPU,因此,成本较低的CPU运行时将更适合.

"You are connected to a GPU runtime, but not utilizing the GPU" indicates that the user is conneted to a GPU runtime, but not utilizing the GPU, and so a less costly CPU runtime would be more suitable.

因此,您必须使用可利用GPU的软件包,例如Tensorflow或Jax.GPU运行时也有一个CPU,除非您专门使用可运行GPU的程序包,否则它将处于空闲状态.

Therefore, you have to use a package that utilizes the GPU, such as Tensorflow or Jax. GPU runtimes also have a CPU, and unless you are specifically using packages that exercise the GPU, it will sit idle.

这篇关于为什么我的colab笔记本不使用GPU?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆