From 6c418d5a43e4fbb80e828e49f14c2e31bb2aa729 Mon Sep 17 00:00:00 2001 From: thomas Date: Wed, 23 Mar 2022 14:17:49 +0100 Subject: [PATCH] gpu-setup: Add policy a100_split_2 Add policy to create two 3g.20gb instances on a A100. --- helper/gpu-setup | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/helper/gpu-setup b/helper/gpu-setup index d1ef1881..9fc50e12 100755 --- a/helper/gpu-setup +++ b/helper/gpu-setup @@ -119,6 +119,26 @@ policy_a100_split_3() { common_setup_a100_complete $gpu_uuid } +policy_a100_split_2() { + + # This policy splits a single A100 with 40 GB into 2 3g.20gb gpu instances each with a + # single default compute instance. + # + # The ID of the 2g.10gb profile is 9 (see `nvidia-smi mig -lgip`). + # The placements for profile 9 are 0,4 (see `nvidia-smi mig -lgipp`). + + gpu_uuid=$(nvidia-smi --query-gpu=uuid --format=csv,noheader,nounits) + test "$gpu_uuid" || die "GPU not found!" + + common_setup_a100 $gpu_uuid + + for i in 0 4;do + nvidia-smi mig --id $gpu_uuid --create-gpu-instance 3g.20gb:$i --default-compute-instance + done + + common_setup_a100_complete $gpu_uuid +} + policy_phys_gpus() { # This policy just enumrate the physical GPUs and reserved them @@ -172,6 +192,9 @@ init() { a100-split-3) policy_a100_split_3 ;; + a100-split-2) + policy_a100_split_2 + ;; phys-gpus) policy_phys_gpus ;;