プリエンプティブルな Deep Learning VM インスタンスを作成できます。プリエンプティブル インスタンスは、通常のインスタンスよりはるかに低価格で作成、実行できるインスタンスです。ただし、他のタスクがリソースへのアクセスを必要とする場合、Compute Engine がこのインスタンスを停止(プリエンプト)する可能性があります。プリエンプティブル インスタンスは 24 時間後に必ず停止します。プリエンプティブル インスタンスの詳細については、プリエンプティブル VM インスタンスをご覧ください。
[[["わかりやすい","easyToUnderstand","thumb-up"],["問題の解決に役立った","solvedMyProblem","thumb-up"],["その他","otherUp","thumb-up"]],[["わかりにくい","hardToUnderstand","thumb-down"],["情報またはサンプルコードが不正確","incorrectInformationOrSampleCode","thumb-down"],["必要な情報 / サンプルがない","missingTheInformationSamplesINeed","thumb-down"],["翻訳に関する問題","translationIssue","thumb-down"],["その他","otherDown","thumb-down"]],["最終更新日 2025-04-21 UTC。"],[[["\u003cp\u003eThis guide outlines the process of creating a new Deep Learning VM instance using the \u003ccode\u003egcloud\u003c/code\u003e command-line tool, either with or without GPUs.\u003c/p\u003e\n"],["\u003cp\u003eBefore creating an instance, you must install and initialize the Google Cloud CLI, choosing the appropriate Deep Learning VM image based on your preferred framework and processor type.\u003c/p\u003e\n"],["\u003cp\u003eTo create a CPU-only instance, use the \u003ccode\u003egcloud compute instances create\u003c/code\u003e command with CPU-specific image families, specifying the \u003ccode\u003edeeplearning-platform-release\u003c/code\u003e image project.\u003c/p\u003e\n"],["\u003cp\u003eCreating an instance with GPUs requires using a GPU-specific image family, setting the \u003ccode\u003emaintenance-policy\u003c/code\u003e to \u003ccode\u003eTERMINATE\u003c/code\u003e, and specifying the desired GPU type and count via the \u003ccode\u003e--accelerator\u003c/code\u003e option, with a note that the \u003ccode\u003e--metadata\u003c/code\u003e flag will assist you in the installation of NVIDIA drivers.\u003c/p\u003e\n"],["\u003cp\u003eYou can create a preemptible Deep Learning VM instance, which is a lower-cost option, by adding the \u003ccode\u003e--preemptible\u003c/code\u003e flag to the \u003ccode\u003egcloud compute instances create\u003c/code\u003e command.\u003c/p\u003e\n"]]],[],null,["# Create a Deep Learning VM instance from the command line\n\nThis topic contains instructions for creating a new Deep Learning VM Images instance\nfrom the command line. You can use the `gcloud` command-line\ntool with your preferred SSH application or in Cloud Shell.\n\nBefore you begin\n----------------\n\nTo use the Google Cloud CLI to create a new Deep Learning VM\ninstance, you must first install and initialize the [Google Cloud CLI](/sdk/docs):\n\n1. Download and install the Google Cloud CLI using the instructions given on [Installing Google Cloud CLI](/sdk/downloads).\n2. Initialize the SDK using the instructions given on [Initializing Cloud\n SDK](/sdk/docs/initializing).\n\nTo use `gcloud` in Cloud Shell, first activate Cloud Shell using the\ninstructions given on [Starting Cloud Shell](/shell/docs/starting-cloud-shell).\n\nNext, choose the specific Deep Learning VM image to use. Your choice\ndepends on your preferred framework and processor type. For more information\nabout the available images, see [Choosing an\nImage](/deep-learning-vm/docs/images).\n| **Note:** If you are using GPUs with your Deep Learning VM, check the quotas page to ensure that you have enough GPUs available in your project: [Quotas](https://console.cloud.google.com/quotas). If GPUs are not listed on the quotas page or you require additional GPU quota, you can request a quota increase. See \"[Requesting additional quota](/compute/quotas#requesting_additional_quota)\" on the Compute Engine [Resource Quotas](/compute/quotas) page.\n\nCreating an instance without GPUs\n---------------------------------\n\nTo provision a Deep Learning VM instance with a CPU but no GPU: \n\n export IMAGE_FAMILY=\"tf-ent-latest-cpu\"\n export ZONE=\"us-west1-b\"\n export INSTANCE_NAME=\"my-instance\"\n\n gcloud compute instances create $INSTANCE_NAME \\\n --zone=$ZONE \\\n --image-family=$IMAGE_FAMILY \\\n --image-project=deeplearning-platform-release\n\nOptions:\n\n- `--image-family` must be one of the CPU-specific image types. For more\n information, see [Choosing an Image](/deep-learning-vm/docs/images).\n\n- `--image-project` must be `deeplearning-platform-release`.\n\nCreating an instance with one or more GPUs\n------------------------------------------\n\nCompute Engine offers the option of adding GPUs to your virtual machine\ninstances. GPUs offer faster processing for many complex data and machine\nlearning tasks. To learn more about GPUs, see [GPUs on\nCompute Engine](/compute/docs/gpus).\n\nTo provision a Deep Learning VM instance with one or more GPUs: \n\n export IMAGE_FAMILY=\"tf-ent-latest-gpu\"\n export ZONE=\"us-west1-b\"\n export INSTANCE_NAME=\"my-instance\"\n\n gcloud compute instances create $INSTANCE_NAME \\\n --zone=$ZONE \\\n --image-family=$IMAGE_FAMILY \\\n --image-project=deeplearning-platform-release \\\n --maintenance-policy=TERMINATE \\\n --accelerator=\"type=nvidia-tesla-v100,count=1\" \\\n --metadata=\"install-nvidia-driver=True\"\n\nOptions:\n\n- `--image-family` must be one of the GPU-specific image types. For more\n information, see [Choosing an Image](/deep-learning-vm/docs/images).\n\n- `--image-project` must be `deeplearning-platform-release`.\n\n- `--maintenance-policy` must be `TERMINATE`. See\n [GPU Restrictions](/compute/docs/gpus#restrictions) to learn more.\n\n- `--accelerator` specifies the GPU type to use. Must be\n specified in the format `--accelerator=\"type=TYPE,count=COUNT\"`. Supported\n values of `TYPE` are:\n\n - `nvidia-tesla-v100` (`count=1` or `8`)\n - `nvidia-tesla-p100` (`count=1`, `2`, or `4`)\n - `nvidia-tesla-p4` (`count=1`, `2`, or `4`)\n\n Not all GPU types are supported in all regions. For details, see\n [GPUs on Compute Engine](/compute/docs/gpus).\n- `--metadata` is used to specify that the NVIDIA driver should be installed\n on your behalf. The value is `install-nvidia-driver=True`. If specified,\n Compute Engine loads the latest stable driver on the first boot\n and performs the necessary steps (including a final reboot to activate the\n driver).\n\nIf you've elected to install NVIDIA drivers, allow 3-5 minutes for installation\nto complete.\n\nIt may take up to 5 minutes before your VM is fully provisioned. In this\ntime, you will be unable to SSH into your machine. When the installation is\ncomplete, to guarantee that the driver installation was successful, you can\nSSH in and run `nvidia-smi`.\n\nWhen you've configured your image, you can save a snapshot of your\nimage so that you can start derivative instances without having to wait\nfor the driver installation.\n\nCreating a preemptible instance\n-------------------------------\n\nYou can create a preemptible Deep Learning VM instance. A preemptible\ninstance is an instance you can create and run at a much lower price than\nnormal instances. However, Compute Engine might stop (preempt) these\ninstances if it requires access to those resources for other tasks.\nPreemptible instances always stop after 24 hours. To learn more about\npreemptible instances, see [Preemptible VM\nInstances](/compute/docs/instances/preemptible).\n\nTo create a preemptible Deep Learning VM instance:\n\n- Follow the instructions located above to create a new instance. To the\n `gcloud compute instances create` command, append the following:\n\n ```\n --preemptible\n ```\n\nWhat's next\n-----------\n\nFor instructions on connecting to your new Deep Learning VM instance\nthrough the Google Cloud console or command line, see [Connecting to\nInstances](/compute/docs/instances/connecting-to-instance). Your instance name\nis the **Deployment name** you specified with `-vm` appended."]]