-
Notifications
You must be signed in to change notification settings - Fork 60
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'rearrange-demos' into 'main'
Rearrange files in the demo folder for better organization See merge request nvidia/cloud-native/k8s-dra-driver!27
- Loading branch information
Showing
30 changed files
with
259 additions
and
91 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |
File renamed without changes.
Oops, something went wrong.