如何在Google计算引擎上运行Tensorflow GPU容器?

我正在尝试使用GPU加速器在Google计算引擎上运行一个tensorflow容器。

尝试过命令

gcloud compute instances create-with-container job-name \
  --machine-type=n1-standard-4 \
  --accelerator=type=nvidia-tesla-k80 \
  --image-project=deeplearning-platform-release \
  --image-family=common-container \
  --container image gcr/io/my-container \
  --container-arg="--container-arguments=xxxx"

但是得到警告

  

警告:此容器部署机制需要经过容器优化的OS映像才能工作。从cos-cloud项目中选择一个映像(成本稳定,cos-beta,cos-dev映像系列)。

我还尝试了cos-cloud项目中的系统映像,该项目似乎没有CUDA驱动程序,因为tensorflow记录了警告cuInit failed

想知道在具有GPU支持的Google计算引擎上运行tensorflow容器的正确方法是什么吗?

vman20082009 回答:如何在Google计算引擎上运行Tensorflow GPU容器?

您考虑使用Cloud TPU on GKE吗?

page描述了如何使用GPU设置GKE集群

,

您可以在docker run的{​​{1}}中startup-script放置容器。

deeplearningvm

由于安装nvidia驱动程序需要几分钟,因此必须等到安装后才能启动容器。 https://cloud.google.com/ai-platform/deep-learning-vm/docs/tensorflow_start_instance#creating_a_tensorflow_instance_from_the_command_line

  

Compute Engine会在首次启动时加载最新的稳定驱动程序,并执行必要的步骤(包括最终重新启动以激活驱动程序)。完全配置VM最多可能需要5分钟。此时,您将无法通过SSH进入计算机。安装完成后,为确保驱动程序安装成功,您可以使用SSH并运行nvidia-smi。

本文链接:https://www.f2er.com/3158217.html

大家都在问