简体   繁体   English

google colab 使用本地运行时并且不检测本地 gpu

[英]google colab using local runtime and doesn't detect local gpu

Google colab is connected to local runtime Google colab 连接到本地运行时

Local GPU Settings were configured using the following steps:使用以下步骤配置本地 GPU 设置:

Edit -> Notebook settings -> Hardware accelerator (GPU)编辑 -> 笔记本设置 -> 硬件加速器 (GPU)

Runtime -> change runtime type -> Hardware accelerator (GPU)运行时 -> 更改运行时类型 -> 硬件加速器 (GPU)

Connected(Local)已连接(本地)

The following piece of code was then used to check if colab running on local runtime was using the local GPU然后使用以下代码检查在本地运行时运行的 colab 是否使用本地 GPU

import torch
torch.cuda.is_available()

The above statement returned False上面的语句返回 False

NOTE: The local computer system uses an NVDIA GeForce 940M GPU注意:本地计算机系统使用 NVDIA GeForce 940M GPU

According to the Pytorch tutorial for Vulkan backend ,根据Vulkan 后端Pytorch 教程

Vulkan backend is not included by default in Pytorch.默认情况下,Pytorch 中不包含 Vulkan 后端。

In order to use PyTorch with Vulkan backend, you need to build it from source with additional settings.为了将 PyTorch 与 Vulkan 后端一起使用,您需要使用其他设置从源代码构建它。 Maybe you will be better off doing that locally instead of Colab.也许你最好在本地而不是 Colab 这样做。

Pytorch already have support for CUDA and other GPU accelerators so unless you intend to use it for inference on your project, it is better to use as it is. Pytorch 已经支持 CUDA 和其他 GPU 加速器,因此除非您打算将其用于项目推理,否则最好按原样使用。

If you do intend to use the Vulkan backend, this github project has a DockerFile and all scripts you need to build Pytorch as well Pytorch-Android .aar files如果你打算使用 Vulkan 后端,这个 github 项目有一个 DockerFile 和你需要构建 Pytorch 的所有脚本以及 Pytorch-Android .aar 文件

Github Pytorch Android Example Github Pytorch Android 示例

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM