Créer une image à partir d'une instance Deep Learning VM existante
Restez organisé à l'aide des collections
Enregistrez et classez les contenus selon vos préférences.
L'installation de pilotes NVIDIA sur une nouvelle instance de VM peut prendre beaucoup de temps, en particulier si vous créez de nombreuses images. Pour éviter cela, vous pouvez créer votre propre image basée sur l'une des instances Deep Learning VM Image, mais sur laquelle les pilotes NVIDIA sont déjà pré-installés.
Cet article explique comment créer une image basée sur une instance Deep Learning VM Image existante.
Créer une instance
Tout d'abord, suivez les instructions de l'un des articles suivants pour créer une instance. Veillez à inclure au moins un GPU dans votre nouvelle instance.
Une fois l'instance démarrée, vérifiez que le pilote NVIDIA a été installé :
Connectez-vous en SSH à votre image :
gcloud compute ssh "DEPLOYMENT_NAME"
Exécutez la commande suivante :
nvidia-smi
Si les pilotes ont été installés, vous pouvez continuer.
Arrêter l'instance
Pour arrêter l'instance, exécutez la commande suivante :
gcloud compute instances stop "DEPLOYMENT_NAME"
Créer votre propre image
Créez maintenant votre propre image basée sur l'instance arrêtée. Exécutez la commande suivante sur la ligne de commande, en donnant à la nouvelle image un nom et un nom de famille :
Une fois la commande exécutée, vous disposez d'une nouvelle image dotée de pilotes NVIDIA pré-installés. Vous pouvez l'utiliser pour créer des instances Deep Learning VM.
Sauf indication contraire, le contenu de cette page est régi par une licence Creative Commons Attribution 4.0, et les échantillons de code sont régis par une licence Apache 2.0. Pour en savoir plus, consultez les Règles du site Google Developers. Java est une marque déposée d'Oracle et/ou de ses sociétés affiliées.
Dernière mise à jour le 2025/09/04 (UTC).
[[["Facile à comprendre","easyToUnderstand","thumb-up"],["J'ai pu résoudre mon problème","solvedMyProblem","thumb-up"],["Autre","otherUp","thumb-up"]],[["Difficile à comprendre","hardToUnderstand","thumb-down"],["Informations ou exemple de code incorrects","incorrectInformationOrSampleCode","thumb-down"],["Il n'y a pas l'information/les exemples dont j'ai besoin","missingTheInformationSamplesINeed","thumb-down"],["Problème de traduction","translationIssue","thumb-down"],["Autre","otherDown","thumb-down"]],["Dernière mise à jour le 2025/09/04 (UTC)."],[[["\u003cp\u003eThis guide outlines the process of creating a custom Deep Learning VM image with pre-installed NVIDIA drivers to save time on future setups.\u003c/p\u003e\n"],["\u003cp\u003eYou'll start by creating a new Deep Learning VM instance that includes at least one GPU, following one of the provided guides.\u003c/p\u003e\n"],["\u003cp\u003eAfter ensuring the NVIDIA drivers are installed on the instance, you will then stop the instance to create a custom image from it.\u003c/p\u003e\n"],["\u003cp\u003eThe final step is running a command to generate the custom image, complete with pre-installed NVIDIA drivers, allowing for quicker deployment of new Deep Learning VM instances.\u003c/p\u003e\n"]]],[],null,["# Create a new image from an existing Deep Learning VM instance\n\nInstalling NVIDIA drivers on a new VM instance can be\ntime consuming, especially if you are creating numerous images. One way to\nprevent this is to create your own image that is based on one of the\nDeep Learning VM images, but that already has the NVIDIA drivers\npreinstalled.\n\nThis topic describes how to create a new image based on an existing\nDeep Learning VM image.\n\nCreate a new instance\n---------------------\n\nFirst, follow the instructions in one of the following topics to create a new\ninstance. Be sure to include at least one GPU in your new instance.\n\n- [Creating a TensorFlow Deep Learning VM\n Instance](/deep-learning-vm/docs/tensorflow_start_instance)\n- [Creating a PyTorch Deep Learning VM\n Instance](/deep-learning-vm/docs/pytorch_start_instance)\n- [Creating a Deep Learning VM Instance from the Command\n Line](/deep-learning-vm/docs/cli)\n- [Creating a Deep Learning VM Instance from the Cloud\n Marketplace](/deep-learning-vm/docs/cloud-marketplace)\n\nVerify NVIDIA driver install\n----------------------------\n\nOnce the instance has booted, verify that the NVIDIA driver has been\ninstalled:\n\n1. SSH to your image: \n\n ```\n gcloud compute ssh \"DEPLOYMENT_NAME\"\n ```\n2. Run the following command: \n\n ```\n nvidia-smi\n ```\n\nIf the drivers have been installed, you can continue.\n\nStop the instance\n-----------------\n\nStop the instance by running the following command: \n\n```\ngcloud compute instances stop \"DEPLOYMENT_NAME\"\n```\n\nCreate your own image\n---------------------\n\nNow you create your own image based on the stopped instance. Run the following\nat the command line, giving the new image a name and a family name: \n\n```\ngcloud compute images create \"NEW_IMAGE_NAME\" \\\n --source-disk DEPLOYMENT_NAME \\\n --source-disk-zone ZONE \\\n --family NEW_FAMILY_NAME\n```\n\nOnce the command is finished running, you have a new image with NVIDIA drivers\npreinstalled that you can use to create new Deep Learning VM instances."]]