-
Notifications
You must be signed in to change notification settings - Fork 61
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add a timeslicing sharing example to quickstart
Signed-off-by: Yuan Chen <[email protected]> Update namespace Signed-off-by: Yuan Chen <[email protected]>
- Loading branch information
1 parent
917e1ce
commit 4bb1248
Showing
2 changed files
with
92 additions
and
0 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 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,76 @@ | ||
# 1 pod, 2 containers | ||
# Access to a shared GPU via TimeSlicing | ||
|
||
--- | ||
apiVersion: v1 | ||
kind: Namespace | ||
metadata: | ||
name: timeslicing-test | ||
|
||
--- | ||
apiVersion: resource.k8s.io/v1alpha2 | ||
kind: ResourceClaim | ||
metadata: | ||
namespace: timeslicing-test | ||
name: gpu-timeslicing-0 | ||
spec: | ||
resourceClassName: gpu.nvidia.com | ||
parametersRef: | ||
apiGroup: gpu.resource.nvidia.com | ||
kind: GpuClaimParameters | ||
name: gpu-timeslicing | ||
|
||
--- | ||
apiVersion: resource.k8s.io/v1alpha2 | ||
kind: ResourceClaim | ||
metadata: | ||
namespace: timeslicing-test | ||
name: gpu-timeslicing-1 | ||
spec: | ||
resourceClassName: gpu.nvidia.com | ||
parametersRef: | ||
apiGroup: gpu.resource.nvidia.com | ||
kind: GpuClaimParameters | ||
name: gpu-timeslicing | ||
|
||
--- | ||
apiVersion: gpu.resource.nvidia.com/v1alpha1 | ||
kind: GpuClaimParameters | ||
metadata: | ||
namespace: timeslicing-test | ||
name: gpu-timeslicing | ||
spec: | ||
sharing: | ||
strategy: TimeSlicing | ||
|
||
--- | ||
apiVersion: v1 | ||
kind: Pod | ||
metadata: | ||
namespace: timeslicing-test | ||
name: gpu-pod | ||
labels: | ||
app: pod | ||
spec: | ||
containers: | ||
- name: ctr0 | ||
image: nvcr.io/nvidia/k8s/cuda-sample:nbody-cuda11.7.1-ubuntu18.04 | ||
args: ["--benchmark", "--numbodies=42260000"] | ||
resources: | ||
claims: | ||
- name: gpu0 | ||
containers: | ||
- name: ctr1 | ||
image: nvcr.io/nvidia/k8s/cuda-sample:nbody-cuda11.7.1-ubuntu18.04 | ||
args: ["--benchmark", "--numbodies=42260000"] | ||
resources: | ||
claims: | ||
- name: gpu1 | ||
resourceClaims: | ||
- name: gpu0 | ||
source: | ||
resourceClaimName: gpu-timeslicing-0 | ||
resourceClaims: | ||
- name: gpu1 | ||
source: | ||
resourceClaimName: gpu-timeslicing-1 |