This repository was archived by the owner on Jan 29, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 7 files changed +182
-5
lines changed
gpu-aware-scheduling/docs/example Expand file tree Collapse file tree 7 files changed +182
-5
lines changed Original file line number Diff line number Diff line change 1
- This folder has a simple example POD which uses kubernetes extended resources
1
+ This folder has simple examples which use kubernetes extended resources and other GAS features.
2
2
3
3
To deploy, you can run in this folder:
4
4
5
5
```
6
- kubectl apply -f .
6
+ kubectl apply -f <test_file_name>
7
7
```
8
8
9
9
Then you can check the GPU devices of the first pod in the deployment with:
10
10
11
11
```
12
- kubectl exec -it deploy/bb-example -- ls /dev/dri
13
- ```
12
+ kubectl exec -it deploy/<deployment name> -- ls /dev/dri
13
+ ```
14
+
15
+ Or you can use logs command to check which GPUs the pod is using:
16
+
17
+ ```
18
+ kubectl logs --all-containders=true <pod name>
19
+ ```
20
+
21
+ With describe command you can check in which GPUs GAS has scheduled the pods along with the other pod information:
22
+
23
+ ```
24
+ kubectl describe pods <deployment name>
25
+ ```
Original file line number Diff line number Diff line change
1
+ apiVersion : apps/v1
2
+ kind : Deployment
3
+ metadata :
4
+ name : allowed-gpu-list-example
5
+ spec :
6
+ replicas : 1
7
+ selector :
8
+ matchLabels :
9
+ app : allow-gpu-list-example
10
+ template :
11
+ metadata :
12
+ annotations :
13
+ # remember to enable allowlist and/or denylist via command line flags.
14
+ # --enableAllowlist true
15
+ # --enableDenylist true
16
+ gas-allow : card1,card2,card3
17
+ gas-deny : card0
18
+ labels :
19
+ app : allow-gpu-list-example
20
+ spec :
21
+ containers :
22
+ - name : &containername allow-gpu-list-example
23
+ image : busybox:1.33.1
24
+ env :
25
+ - name : MY_CONTAINER_NAME
26
+ value : *containername
27
+ command : ['sh', '-c', 'echo $MY_CONTAINER_NAME && ls -ltr /dev/dri && sleep 6000']
28
+ resources :
29
+ limits :
30
+ gpu.intel.com/i915 : 1
Original file line number Diff line number Diff line change 13
13
app : bb-example
14
14
spec :
15
15
containers :
16
- - name : gpu-resource-request
16
+ - name : bb-example
17
17
image : busybox:1.33.1
18
18
command : ['sh', '-c', 'echo The gpu resource request app is running! && sleep 6000']
19
19
resources :
Original file line number Diff line number Diff line change
1
+ apiVersion : apps/v1
2
+ kind : Deployment
3
+ metadata :
4
+ name : memory-resource-example
5
+ spec :
6
+ replicas : 1
7
+ selector :
8
+ matchLabels :
9
+ app : memory-resource-example
10
+ template :
11
+ metadata :
12
+ labels :
13
+ app : memory-resource-example
14
+ spec :
15
+ containers :
16
+ - name : &containername memory-resource-example
17
+ image : busybox:1.33.1
18
+ env :
19
+ - name : MY_CONTAINER_NAME
20
+ value : *containername
21
+ command : ['sh', '-c', 'echo $MY_CONTAINER_NAME && ls -ltr /dev/dri && sleep 6000']
22
+ resources :
23
+ limits :
24
+ gpu.intel.com/i915 : 1
25
+ gpu.intel.com/memory.max : 500M
Original file line number Diff line number Diff line change
1
+ apiVersion : apps/v1
2
+ kind : Deployment
3
+ metadata :
4
+ name : same-gpu-example
5
+ spec :
6
+ replicas : 1
7
+ selector :
8
+ matchLabels :
9
+ app : same-gpu-example
10
+ template :
11
+ metadata :
12
+ labels :
13
+ app : same-gpu-example
14
+ annotations :
15
+ # List containers that needs to be in same GPU
16
+ gas-same-gpu : same-gpu-container1,same-gpu-container3
17
+ spec :
18
+ containers :
19
+ - name : &container1 same-gpu-container1
20
+ image : busybox:1.33.1
21
+ env :
22
+ - name : MY_CONTAINER_NAME
23
+ value : *container1
24
+ command : ['sh', '-c', 'echo $MY_CONTAINER_NAME && ls -ltr /dev/dri && sleep 6000']
25
+ resources :
26
+ limits :
27
+ gpu.intel.com/i915 : 1
28
+ gpu.intel.com/millicores : 400
29
+ - name : &container2 same-gpu-container2
30
+ image : busybox:1.33.1
31
+ env :
32
+ - name : MY_CONTAINER_NAME
33
+ value : *container2
34
+ command : ['sh', '-c', 'echo $MY_CONTAINER_NAME && ls -ltr /dev/dri && sleep 6000']
35
+ resources :
36
+ limits :
37
+ gpu.intel.com/i915 : 1
38
+ gpu.intel.com/millicores : 300
39
+ - name : &container3 same-gpu-container3
40
+ image : busybox:1.33.1
41
+ env :
42
+ - name : MY_CONTAINER_NAME
43
+ value : *container3
44
+ command : ['sh', '-c', 'echo $MY_CONTAINER_NAME && ls -ltr /dev/dri && sleep 6000']
45
+ resources :
46
+ limits :
47
+ gpu.intel.com/i915 : 1
48
+ gpu.intel.com/millicores : 400
49
+ - name : &container4 same-gpu-container4
50
+ image : busybox:1.33.1
51
+ env :
52
+ - name : MY_CONTAINER_NAME
53
+ value : *container4
54
+ command : ['sh', '-c', 'echo $MY_CONTAINER_NAME && ls -ltr /dev/dri && sleep 6000']
55
+ resources :
56
+ limits :
57
+ gpu.intel.com/i915 : 1
58
+ gpu.intel.com/millicores : 300
Original file line number Diff line number Diff line change
1
+ apiVersion : apps/v1
2
+ kind : Deployment
3
+ metadata :
4
+ name : tile-resource-request-example
5
+ spec :
6
+ replicas : 1
7
+ selector :
8
+ matchLabels :
9
+ app : tile-resource-request-example
10
+ template :
11
+ metadata :
12
+ labels :
13
+ app : tile-resource-request-example
14
+ spec :
15
+ containers :
16
+ - name : &containername tile-resource-request-example
17
+ image : busybox:1.33.1
18
+ env :
19
+ - name : MY_CONTAINER_NAME
20
+ value : *containername
21
+ command : ['sh', '-c', 'echo $MY_CONTAINER_NAME && ls -ltr /dev/dri && sleep 6000']
22
+ resources :
23
+ limits :
24
+ gpu.intel.com/i915 : 1
25
+ gpu.intel.com/tiles : 1
Original file line number Diff line number Diff line change
1
+ apiVersion : apps/v1
2
+ kind : Deployment
3
+ metadata :
4
+ name : xe-link-example
5
+ spec :
6
+ replicas : 1
7
+ selector :
8
+ matchLabels :
9
+ app : xe-link-example
10
+ template :
11
+ metadata :
12
+ labels :
13
+ app : xe-link-example
14
+ annotations :
15
+ gas-allocate-xelink : ' true'
16
+ spec :
17
+ containers :
18
+ - name : &containername xe-link-example
19
+ image : busybox:1.33.1
20
+ env :
21
+ - name : MY_CONTAINER_NAME
22
+ value : *containername
23
+ command : ['sh', '-c', 'echo $MY_CONTAINER_NAME && ls -ltr /dev/dri && sleep 6000']
24
+ resources :
25
+ limits :
26
+ gpu.intel.com/i915 : 2
27
+ gpu.intel.com/tiles : 2
You can’t perform that action at this time.
0 commit comments