From 98467d8eb7ad3228bade5331f91ba659d2cf483e Mon Sep 17 00:00:00 2001 From: Kevin Klues Date: Wed, 1 Nov 2023 15:51:39 +0000 Subject: [PATCH] Rearrange files in the demo folder for better organization Signed-off-by: Kevin Klues --- README.md | 29 ++--- demo/DEMO.sh | 66 ------------ demo/{ => clusters/kind}/build-dra-driver.sh | 0 demo/{ => clusters/kind}/create-cluster.sh | 0 demo/{ => clusters/kind}/delete-cluster.sh | 0 .../{ => clusters/kind}/install-dra-driver.sh | 2 +- .../kind}/scripts/build-driver-image.sh | 2 +- .../kind}/scripts/build-kind-image.sh | 0 demo/{ => clusters/kind}/scripts/common.sh | 2 +- .../kind}/scripts/create-kind-cluster.sh | 0 .../kind}/scripts/delete-kind-cluster.sh | 0 .../kind}/scripts/kind-cluster-config.yaml | 0 .../scripts/load-driver-image-into-kind.sh | 0 demo/specs/mig+mps/README.md | 100 ++++++++++++++++++ demo/specs/mig+mps/sharing-demo-claims-1.yaml | 12 +++ .../mig+mps}/sharing-demo-claims.yaml | 0 demo/specs/mig+mps/sharing-demo-envs.sh | 15 +++ demo/specs/mig+mps/sharing-demo-job-1.yaml | 22 ++++ .../{ => specs/mig+mps}/sharing-demo-job.yaml | 12 +-- .../sharing-demo-mig-parted-config.yaml | 0 .../mig+mps/sharing-demo-parameters-1.yaml | 10 ++ .../mig+mps}/sharing-demo-parameters.yaml | 0 demo/specs/quickstart/README.md | 78 ++++++++++++++ demo/{ => specs/quickstart}/gpu-test-mps.yaml | 0 demo/{ => specs/quickstart}/gpu-test1.yaml | 0 demo/{ => specs/quickstart}/gpu-test2.yaml | 0 demo/{ => specs/quickstart}/gpu-test3.yaml | 0 demo/{ => specs/quickstart}/gpu-test4.yaml | 0 demo/{ => specs/quickstart}/gpu-test5.yaml | 0 demo/{ => specs/quickstart}/gpu-test6.yaml | 0 30 files changed, 259 insertions(+), 91 deletions(-) delete mode 100644 demo/DEMO.sh rename demo/{ => clusters/kind}/build-dra-driver.sh (100%) rename demo/{ => clusters/kind}/create-cluster.sh (100%) rename demo/{ => clusters/kind}/delete-cluster.sh (100%) rename demo/{ => clusters/kind}/install-dra-driver.sh (95%) rename demo/{ => clusters/kind}/scripts/build-driver-image.sh (98%) rename demo/{ => clusters/kind}/scripts/build-kind-image.sh (100%) rename demo/{ => clusters/kind}/scripts/common.sh (95%) rename demo/{ => clusters/kind}/scripts/create-kind-cluster.sh (100%) rename demo/{ => clusters/kind}/scripts/delete-kind-cluster.sh (100%) rename demo/{ => clusters/kind}/scripts/kind-cluster-config.yaml (100%) rename demo/{ => clusters/kind}/scripts/load-driver-image-into-kind.sh (100%) create mode 100644 demo/specs/mig+mps/README.md create mode 100644 demo/specs/mig+mps/sharing-demo-claims-1.yaml rename demo/{ => specs/mig+mps}/sharing-demo-claims.yaml (100%) create mode 100755 demo/specs/mig+mps/sharing-demo-envs.sh create mode 100644 demo/specs/mig+mps/sharing-demo-job-1.yaml rename demo/{ => specs/mig+mps}/sharing-demo-job.yaml (78%) rename demo/{ => specs/mig+mps}/sharing-demo-mig-parted-config.yaml (100%) create mode 100644 demo/specs/mig+mps/sharing-demo-parameters-1.yaml rename demo/{ => specs/mig+mps}/sharing-demo-parameters.yaml (100%) create mode 100644 demo/specs/quickstart/README.md rename demo/{ => specs/quickstart}/gpu-test-mps.yaml (100%) rename demo/{ => specs/quickstart}/gpu-test1.yaml (100%) rename demo/{ => specs/quickstart}/gpu-test2.yaml (100%) rename demo/{ => specs/quickstart}/gpu-test3.yaml (100%) rename demo/{ => specs/quickstart}/gpu-test4.yaml (100%) rename demo/{ => specs/quickstart}/gpu-test5.yaml (100%) rename demo/{ => specs/quickstart}/gpu-test6.yaml (100%) diff --git a/README.md b/README.md index 1b22000f..9a7b497b 100644 --- a/README.md +++ b/README.md @@ -32,33 +32,34 @@ First since we'll launch kind with GPU support, ensure that the following prereq Container Runtime to use volume mounts to select devices to inject into a container. -We start by first cloning this repository and `cd`ing into its `demo` -subdirectory. All of the scripts and example Pod specs used in this demo are -contained here, so take a moment to browse through the various files and see +We start by first cloning this repository and `cd`ing into it. +All of the scripts and example Pod specs used in this demo are in the `demo` +subdirectory, so take a moment to browse through the various files and see what's available: ``` git clone https://github.com/NVIDIA/k8s-dra-driver.git -cd k8s-dra-driver/demo +``` +``` +cd k8s-dra-driver ``` ### Setting up the infrastructure First, create a `kind` cluster to run the demo: ```bash -./create-cluster.sh +./demo/clusters/kind/create-cluster.sh ``` - From here we will build the image for the example resource driver: ```bash -./build-dra-driver.sh +./demo/clusters/kind/build-dra-driver.sh ``` This also makes the built images available to the `kind` cluster. We now install the NVIDIA GPU DRA driver: ``` -./install-dra-driver.sh +./demo/clusters/kind/install-dra-driver.sh ``` This should show two pods running in the `nvidia-dra-driver` namespace: @@ -70,16 +71,16 @@ nvidia-dra-driver nvidia-dra-plugin-lt7qh 1/1 Running ``` ### Run the examples by following the steps in the demo script -Finally, you can run the various examples contained in the `demo` folder. -The files `demo/DEMO.sh` shows the full script of the demo you can walk through. +Finally, you can run the various examples contained in the `demo/specs/quickstart` folder. +The `README` in that directory shows the full script of the demo you can walk through. ```console -cat demo/DEMO.sh +cat demo/specs/quickstart/README.md ... ``` Where the running the first three examples should produce output similar to the following: ```console -$ kubectl apply --filename=gpu-test{1,2,3}.yaml +$ kubectl apply --filename=demo/specs/quickstart/gpu-test{1,2,3}.yaml ... ``` @@ -112,7 +113,7 @@ GPU 0: A100-SXM4-40GB (UUID: GPU-4404041a-04cf-1ccf-9e70-f139a9b1e23c) Running ``` -$ ./delete-cluster.sh +$ ./demo/clusters/kind/delete-cluster.sh ``` will remove the cluster created in the preceding steps. @@ -155,4 +156,4 @@ half-half: mig-devices: {} EOF ``` ---> \ No newline at end of file +--> diff --git a/demo/DEMO.sh b/demo/DEMO.sh deleted file mode 100644 index cae1e9fb..00000000 --- a/demo/DEMO.sh +++ /dev/null @@ -1,66 +0,0 @@ -# Copyright 2023 NVIDIA CORPORATION -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Show current state of the cluster -kubectl get pod -A - -# Show the current MIG configuration of the machine -nvidia-smi --query-gpu=index,name,uuid,mig.mode.current --format=csv -nvidia-smi -L - -# Deploy the 4 example apps discussed in the slides -kubectl apply --filename=gpu-test{1,2,3,4}.yaml - -# Show all the pods starting up -kubectl get pod -A - -# Show the yaml files for the first 3 example apps -vim -O gpu-test1.yaml gpu-test2.yaml gpu-test3.yaml - -# Show the GPUs allocated to each -kubectl logs -n gpu-test1 -l app=pod -kubectl logs -n gpu-test2 pod --all-containers -kubectl logs -n gpu-test3 -l app=pod - -# Show the yaml file for the complicated example with MIG devices -vim -O gpu-test4.yaml - -# Show the pods running -kubectl get pod -A - -# Show the output of nvidia-smi -nvidia-smi -L - -# Show the MIG devices allocated to each pod -for pod in \ - $(kubectl get pod \ - -n gpu-test4 \ - --output=jsonpath='{.items[*].metadata.name}'); \ -do \ - echo "${pod}:" - kubectl logs -n gpu-test4 ${pod} -c ctr0 - kubectl logs -n gpu-test4 ${pod} -c ctr1 - kubectl logs -n gpu-test4 ${pod} -c ctr2 - kubectl logs -n gpu-test4 ${pod} -c ctr3 - echo "" -done - -# Delete this example -kubectl delete -f gpu-test4.yaml - -# Show the pods terminating -kubectl get pod -A - -# Show the output of nvidia-smi -nvidia-smi -L diff --git a/demo/build-dra-driver.sh b/demo/clusters/kind/build-dra-driver.sh similarity index 100% rename from demo/build-dra-driver.sh rename to demo/clusters/kind/build-dra-driver.sh diff --git a/demo/create-cluster.sh b/demo/clusters/kind/create-cluster.sh similarity index 100% rename from demo/create-cluster.sh rename to demo/clusters/kind/create-cluster.sh diff --git a/demo/delete-cluster.sh b/demo/clusters/kind/delete-cluster.sh similarity index 100% rename from demo/delete-cluster.sh rename to demo/clusters/kind/delete-cluster.sh diff --git a/demo/install-dra-driver.sh b/demo/clusters/kind/install-dra-driver.sh similarity index 95% rename from demo/install-dra-driver.sh rename to demo/clusters/kind/install-dra-driver.sh index b3924e96..d84daa5b 100755 --- a/demo/install-dra-driver.sh +++ b/demo/clusters/kind/install-dra-driver.sh @@ -25,7 +25,7 @@ source "${CURRENT_DIR}/scripts/common.sh" kubectl label node "${KIND_CLUSTER_NAME}-worker" --overwrite nvidia.com/dra.kubelet-plugin=true kubectl label node "${KIND_CLUSTER_NAME}-control-plane" --overwrite nvidia.com/dra.controller=true -helm upgrade -i --create-namespace --namespace nvidia-dra-driver nvidia ../deployments/helm/k8s-dra-driver \ +helm upgrade -i --create-namespace --namespace nvidia-dra-driver nvidia ${PROJECT_DIR}/deployments/helm/k8s-dra-driver \ ${NVIDIA_DRIVER_ROOT:+--set nvidiaDriverRoot=${NVIDIA_DRIVER_ROOT}} \ --wait diff --git a/demo/scripts/build-driver-image.sh b/demo/clusters/kind/scripts/build-driver-image.sh similarity index 98% rename from demo/scripts/build-driver-image.sh rename to demo/clusters/kind/scripts/build-driver-image.sh index 7df805fc..a43c8c20 100755 --- a/demo/scripts/build-driver-image.sh +++ b/demo/clusters/kind/scripts/build-driver-image.sh @@ -31,7 +31,7 @@ cleanup() { trap cleanup EXIT # Go back to the root directory of this repo -cd ${CURRENT_DIR}/../.. +cd ${PROJECT_DIR} # Regenerate the CRDs and build the container image # TODO: This should be part of the image name diff --git a/demo/scripts/build-kind-image.sh b/demo/clusters/kind/scripts/build-kind-image.sh similarity index 100% rename from demo/scripts/build-kind-image.sh rename to demo/clusters/kind/scripts/build-kind-image.sh diff --git a/demo/scripts/common.sh b/demo/clusters/kind/scripts/common.sh similarity index 95% rename from demo/scripts/common.sh rename to demo/clusters/kind/scripts/common.sh index 29317f4c..2398ed45 100644 --- a/demo/scripts/common.sh +++ b/demo/clusters/kind/scripts/common.sh @@ -17,7 +17,7 @@ # A reference to the current directory where this script is located SCRIPTS_DIR="$(cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd)" -PROJECT_DIR="$(cd -- "$( dirname -- "${SCRIPTS_DIR}/../../.." )" &> /dev/null && pwd)" +PROJECT_DIR="$(cd -- "$( dirname -- "${SCRIPTS_DIR}/../../../../.." )" &> /dev/null && pwd)" # We extract information from versions.mk function from_versions_mk() { diff --git a/demo/scripts/create-kind-cluster.sh b/demo/clusters/kind/scripts/create-kind-cluster.sh similarity index 100% rename from demo/scripts/create-kind-cluster.sh rename to demo/clusters/kind/scripts/create-kind-cluster.sh diff --git a/demo/scripts/delete-kind-cluster.sh b/demo/clusters/kind/scripts/delete-kind-cluster.sh similarity index 100% rename from demo/scripts/delete-kind-cluster.sh rename to demo/clusters/kind/scripts/delete-kind-cluster.sh diff --git a/demo/scripts/kind-cluster-config.yaml b/demo/clusters/kind/scripts/kind-cluster-config.yaml similarity index 100% rename from demo/scripts/kind-cluster-config.yaml rename to demo/clusters/kind/scripts/kind-cluster-config.yaml diff --git a/demo/scripts/load-driver-image-into-kind.sh b/demo/clusters/kind/scripts/load-driver-image-into-kind.sh similarity index 100% rename from demo/scripts/load-driver-image-into-kind.sh rename to demo/clusters/kind/scripts/load-driver-image-into-kind.sh diff --git a/demo/specs/mig+mps/README.md b/demo/specs/mig+mps/README.md new file mode 100644 index 00000000..9b2fdd38 --- /dev/null +++ b/demo/specs/mig+mps/README.md @@ -0,0 +1,100 @@ +#### Show the job and its claims +```console +vim -O \ + sharing-demo-job.yaml \ + sharing-demo-claims.yaml \ + sharing-demo-parameters.yaml +``` + +#### Show current state of the cluster +```console +kubectl get pod -A +``` + +#### Show the current MIG configuration of the machine +```console +nvidia-smi -L +``` + +#### Create the demo namespace and deploy the job and its claims +```console +kubectl create namespace sharing-demo +kubectl apply \ + -f sharing-demo-parameters.yaml \ + -f sharing-demo-claims.yaml \ + -f sharing-demo-job.yaml +``` + +#### Show processes starting to come up +```console +kubectl get pod -A +``` + +#### Show MIG devices and processes from all job pods executing +```console +nvidia-smi +``` + +#### Set some environment variables to help us narrow down our view of the running processes +```console +eval "$(./sharing-demo-envs.sh)" +``` + +#### View the processes for the time-sliced GPU +```console +docker run \ + --rm \ + --pid=host \ + -e NVIDIA_VISIBLE_DEVICES=${GPU_TS_SHARING_DEVICE} \ + ubuntu:22.04 nvidia-smi +``` + +#### View the processes for the MPS-shared GPU +```console +docker run \ + --rm \ + --pid=host \ + -e NVIDIA_VISIBLE_DEVICES=${GPU_MPS_SHARING_DEVICE} \ + ubuntu:22.04 nvidia-smi +``` + +#### View the processes for the time-sliced MIG Device +```console +docker run \ + --rm \ + --pid=host \ + -e NVIDIA_VISIBLE_DEVICES=${MIG_TS_SHARING_DEVICE} \ + ubuntu:22.04 nvidia-smi +``` + +#### View the processes for the MPS-shared MIG Device +```console +docker run \ + --rm \ + --pid=host \ + -e NVIDIA_VISIBLE_DEVICES=${MIG_MPS_SHARING_DEVICE} \ + ubuntu:22.04 nvidia-smi +``` + +#### Show the running job again +```console +kubectl get pod -A +``` + +#### Delete the job and its claims +```console +kubectl delete \ + -f sharing-demo-parameters.yaml \ + -f sharing-demo-claims.yaml \ + -f sharing-demo-job.yaml +``` + +#### Show processes starting to come down +```console +kubectl get pod -A +``` + +#### Show MIG devices have been deleted +```console +nvidia-smi -L +``` diff --git a/demo/specs/mig+mps/sharing-demo-claims-1.yaml b/demo/specs/mig+mps/sharing-demo-claims-1.yaml new file mode 100644 index 00000000..5fa42f55 --- /dev/null +++ b/demo/specs/mig+mps/sharing-demo-claims-1.yaml @@ -0,0 +1,12 @@ +--- +apiVersion: resource.k8s.io/v1alpha2 +kind: ResourceClaim +metadata: + namespace: sharing-demo + name: mig-mps-sharing +spec: + resourceClassName: gpu.nvidia.com + parametersRef: + apiGroup: gpu.resource.nvidia.com + kind: MigDeviceClaimParameters + name: mig-mps-sharing diff --git a/demo/sharing-demo-claims.yaml b/demo/specs/mig+mps/sharing-demo-claims.yaml similarity index 100% rename from demo/sharing-demo-claims.yaml rename to demo/specs/mig+mps/sharing-demo-claims.yaml diff --git a/demo/specs/mig+mps/sharing-demo-envs.sh b/demo/specs/mig+mps/sharing-demo-envs.sh new file mode 100755 index 00000000..cdcf8ac5 --- /dev/null +++ b/demo/specs/mig+mps/sharing-demo-envs.sh @@ -0,0 +1,15 @@ +GPU_TS_SHARING=$(nvidia-smi | awk '$3 == "N/A" && $4 == "N/A" && $6 == "C" && $7 ~ /sample/ {print $2}' | sort -u) +GPU_MPS_SHARING=$(nvidia-smi | awk '$3 == "N/A" && $4 == "N/A" && $6 == "M+C" && $7 ~ /sample/ {print $2}' | sort -u) +GI_TS_SHARING=$(nvidia-smi | awk '$3 != "N/A" && $4 != "N/A" && $6 == "C" && $7 ~ /sample/ {print $3}' | sort -u) +GI_MPS_SHARING=$(nvidia-smi | awk '$3 != "N/A" && $4 != "N/A" && $6 == "M+C" && $7 ~ /sample/ {print $3}' | sort -u) +MIG_TS_SHARING=$(nvidia-smi | awk -v gi="${GI_TS_SHARING}" '/MIG devices:/{p=1} /Processes:/{p=0} p && $3==gi {print $2 ":" $5}') +MIG_MPS_SHARING=$(nvidia-smi | awk -v gi="${GI_MPS_SHARING}" '/MIG devices:/{p=1} /Processes:/{p=0} p && $3==gi {print $2 ":" $5}') + +echo export GPU_TS_SHARING_DEVICE=${GPU_TS_SHARING} +>&2 echo export GPU_TS_SHARING_DEVICE=${GPU_TS_SHARING} +echo export GPU_MPS_SHARING_DEVICE=${GPU_MPS_SHARING} +>&2 echo export GPU_MPS_SHARING_DEVICE=${GPU_MPS_SHARING} +echo export MIG_TS_SHARING_DEVICE=${MIG_TS_SHARING} +>&2 echo export MIG_TS_SHARING_DEVICE=${MIG_TS_SHARING} +echo export MIG_MPS_SHARING_DEVICE=${MIG_MPS_SHARING} +>&2 echo export MIG_MPS_SHARING_DEVICE=${MIG_MPS_SHARING} diff --git a/demo/specs/mig+mps/sharing-demo-job-1.yaml b/demo/specs/mig+mps/sharing-demo-job-1.yaml new file mode 100644 index 00000000..39b52e0c --- /dev/null +++ b/demo/specs/mig+mps/sharing-demo-job-1.yaml @@ -0,0 +1,22 @@ +--- +apiVersion: batch/v1 +kind: Job +metadata: + namespace: sharing-demo + name: sharing-demo-job +spec: + parallelism: 4 + template: + spec: + restartPolicy: OnFailure + resourceClaims: + - name: mig-mps-sharing + source: + resourceClaimName: mig-mps-sharing + containers: + - name: mig-mps-sharing-ctr + image: nvcr.io/nvidia/k8s/cuda-sample:nbody-cuda11.7.1-ubuntu18.04 + args: ["--benchmark", "--numbodies=4226000"] + resources: + claims: + - name: mig-mps-sharing diff --git a/demo/sharing-demo-job.yaml b/demo/specs/mig+mps/sharing-demo-job.yaml similarity index 78% rename from demo/sharing-demo-job.yaml rename to demo/specs/mig+mps/sharing-demo-job.yaml index 41dc1bed..950276dc 100644 --- a/demo/sharing-demo-job.yaml +++ b/demo/specs/mig+mps/sharing-demo-job.yaml @@ -26,29 +26,25 @@ spec: containers: - name: gpu-ts-sharing-ctr image: nvcr.io/nvidia/k8s/cuda-sample:nbody-cuda11.7.1-ubuntu18.04 - command: ["sleep", "99999"] - #args: ["--benchmark", "--numbodies=4226000"] + args: ["--benchmark", "--numbodies=4226000"] resources: claims: - name: gpu-ts-sharing - name: gpu-mps-sharing-ctr image: nvcr.io/nvidia/k8s/cuda-sample:nbody-cuda11.7.1-ubuntu18.04 - command: ["sleep", "99999"] - #args: ["--benchmark", "--numbodies=4226000"] + args: ["--benchmark", "--numbodies=4226000"] resources: claims: - name: gpu-mps-sharing - name: mig-ts-sharing-ctr image: nvcr.io/nvidia/k8s/cuda-sample:nbody-cuda11.7.1-ubuntu18.04 - command: ["sleep", "99999"] - #args: ["--benchmark", "--numbodies=4226000"] + args: ["--benchmark", "--numbodies=4226000"] resources: claims: - name: mig-ts-sharing - name: mig-mps-sharing-ctr image: nvcr.io/nvidia/k8s/cuda-sample:nbody-cuda11.7.1-ubuntu18.04 - command: ["sleep", "99999"] - #args: ["--benchmark", "--numbodies=4226000"] + args: ["--benchmark", "--numbodies=4226000"] resources: claims: - name: mig-mps-sharing diff --git a/demo/sharing-demo-mig-parted-config.yaml b/demo/specs/mig+mps/sharing-demo-mig-parted-config.yaml similarity index 100% rename from demo/sharing-demo-mig-parted-config.yaml rename to demo/specs/mig+mps/sharing-demo-mig-parted-config.yaml diff --git a/demo/specs/mig+mps/sharing-demo-parameters-1.yaml b/demo/specs/mig+mps/sharing-demo-parameters-1.yaml new file mode 100644 index 00000000..174e18c4 --- /dev/null +++ b/demo/specs/mig+mps/sharing-demo-parameters-1.yaml @@ -0,0 +1,10 @@ +--- +apiVersion: gpu.resource.nvidia.com/v1alpha1 +kind: MigDeviceClaimParameters +metadata: + namespace: sharing-demo + name: mig-mps-sharing +spec: + profile: "1g.5gb" + sharing: + strategy: MPS diff --git a/demo/sharing-demo-parameters.yaml b/demo/specs/mig+mps/sharing-demo-parameters.yaml similarity index 100% rename from demo/sharing-demo-parameters.yaml rename to demo/specs/mig+mps/sharing-demo-parameters.yaml diff --git a/demo/specs/quickstart/README.md b/demo/specs/quickstart/README.md new file mode 100644 index 00000000..b7feeca5 --- /dev/null +++ b/demo/specs/quickstart/README.md @@ -0,0 +1,78 @@ +#### Show current state of the cluster +```console +kubectl get pod -A +``` + +#### Show the current MIG configuration of the machine +```console +nvidia-smi --query-gpu=index,name,uuid,mig.mode.current --format=csv +nvidia-smi -L +``` + +#### Deploy the 4 example apps discussed in the slides +```console +kubectl apply --filename=gpu-test{1,2,3,4}.yaml +``` + +#### Show all the pods starting up +```console +kubectl get pod -A +``` + +#### Show the yaml files for the first 3 example apps +```console +vim -O gpu-test1.yaml gpu-test2.yaml gpu-test3.yaml +``` + +#### Show the GPUs allocated to each +```console +kubectl logs -n gpu-test1 -l app=pod +kubectl logs -n gpu-test2 pod --all-containers +kubectl logs -n gpu-test3 -l app=pod +``` + +#### Show the yaml file for the complicated example with MIG devices +```console +vim -O gpu-test4.yaml +``` + +#### Show the pods running +```console +kubectl get pod -A +``` + +#### Show the output of nvidia-smi +```console +nvidia-smi -L +``` + +#### Show the MIG devices allocated to each pod +```console +for pod in \ + $(kubectl get pod \ + -n gpu-test4 \ + --output=jsonpath='{.items[*].metadata.name}'); \ +do \ + echo "${pod}:" + kubectl logs -n gpu-test4 ${pod} -c ctr0 + kubectl logs -n gpu-test4 ${pod} -c ctr1 + kubectl logs -n gpu-test4 ${pod} -c ctr2 + kubectl logs -n gpu-test4 ${pod} -c ctr3 + echo "" +done +``` + +#### Delete this example +```console +kubectl delete -f gpu-test4.yaml +``` + +#### Show the pods terminating +```console +kubectl get pod -A +``` + +#### Show the output of nvidia-smi +```console +nvidia-smi -L +``` diff --git a/demo/gpu-test-mps.yaml b/demo/specs/quickstart/gpu-test-mps.yaml similarity index 100% rename from demo/gpu-test-mps.yaml rename to demo/specs/quickstart/gpu-test-mps.yaml diff --git a/demo/gpu-test1.yaml b/demo/specs/quickstart/gpu-test1.yaml similarity index 100% rename from demo/gpu-test1.yaml rename to demo/specs/quickstart/gpu-test1.yaml diff --git a/demo/gpu-test2.yaml b/demo/specs/quickstart/gpu-test2.yaml similarity index 100% rename from demo/gpu-test2.yaml rename to demo/specs/quickstart/gpu-test2.yaml diff --git a/demo/gpu-test3.yaml b/demo/specs/quickstart/gpu-test3.yaml similarity index 100% rename from demo/gpu-test3.yaml rename to demo/specs/quickstart/gpu-test3.yaml diff --git a/demo/gpu-test4.yaml b/demo/specs/quickstart/gpu-test4.yaml similarity index 100% rename from demo/gpu-test4.yaml rename to demo/specs/quickstart/gpu-test4.yaml diff --git a/demo/gpu-test5.yaml b/demo/specs/quickstart/gpu-test5.yaml similarity index 100% rename from demo/gpu-test5.yaml rename to demo/specs/quickstart/gpu-test5.yaml diff --git a/demo/gpu-test6.yaml b/demo/specs/quickstart/gpu-test6.yaml similarity index 100% rename from demo/gpu-test6.yaml rename to demo/specs/quickstart/gpu-test6.yaml