@@ -127,7 +127,7 @@ items:
127
127
string: gpu-18db0e85-99e9-c746-8531-ffeb86328b39
128
128
capacity:
129
129
memory: 80Gi
130
- name: gpu-18db0e85-99e9-c746-8531-ffeb86328b39
130
+ name: gpu-0
131
131
- basic:
132
132
attributes:
133
133
driverVersion:
@@ -140,7 +140,7 @@ items:
140
140
string: gpu-93d37703-997c-c46f-a531-755e3e0dc2ac
141
141
capacity:
142
142
memory: 80Gi
143
- name: gpu-93d37703-997c-c46f-a531-755e3e0dc2ac
143
+ name: gpu-1
144
144
- basic:
145
145
attributes:
146
146
driverVersion:
@@ -153,7 +153,7 @@ items:
153
153
string: gpu-ee3e4b55-fcda-44b8-0605-64b7a9967744
154
154
capacity:
155
155
memory: 80Gi
156
- name: gpu-ee3e4b55-fcda-44b8-0605-64b7a9967744
156
+ name: gpu-2
157
157
- basic:
158
158
attributes:
159
159
driverVersion:
@@ -166,7 +166,7 @@ items:
166
166
string: gpu-9ede7e32-5825-a11b-fa3d-bab6d47e0243
167
167
capacity:
168
168
memory: 80Gi
169
- name: gpu-9ede7e32-5825-a11b-fa3d-bab6d47e0243
169
+ name: gpu-3
170
170
- basic:
171
171
attributes:
172
172
driverVersion:
@@ -179,7 +179,7 @@ items:
179
179
string: gpu-e7b42cb1-4fd8-91b2-bc77-352a0c1f5747
180
180
capacity:
181
181
memory: 80Gi
182
- name: gpu-e7b42cb1-4fd8-91b2-bc77-352a0c1f5747
182
+ name: gpu-4
183
183
- basic:
184
184
attributes:
185
185
driverVersion:
@@ -192,7 +192,7 @@ items:
192
192
string: gpu-f11773a1-5bfb-e48b-3d98-1beb5baaf08e
193
193
capacity:
194
194
memory: 80Gi
195
- name: gpu-f11773a1-5bfb-e48b-3d98-1beb5baaf08e
195
+ name: gpu-5
196
196
- basic:
197
197
attributes:
198
198
driverVersion:
@@ -205,7 +205,7 @@ items:
205
205
string: gpu-0159f35e-99ee-b2b5-74f1-9d18df3f22ac
206
206
capacity:
207
207
memory: 80Gi
208
- name: gpu-0159f35e-99ee-b2b5-74f1-9d18df3f22ac
208
+ name: gpu-6
209
209
- basic:
210
210
attributes:
211
211
driverVersion:
@@ -218,7 +218,7 @@ items:
218
218
string: gpu-657bd2e7-f5c2-a7f2-fbaa-0d1cdc32f81b
219
219
capacity:
220
220
memory: 80Gi
221
- name: gpu-657bd2e7-f5c2-a7f2-fbaa-0d1cdc32f81b
221
+ name: gpu-7
222
222
kind: List
223
223
metadata:
224
224
resourceVersion: ""
@@ -261,9 +261,9 @@ for example in $(seq 1 5); do \
261
261
for ctr in $( kubectl get pod -n gpu-test${example} ${pod} -o jsonpath=' {.spec.containers[*].name}' ) ; do \
262
262
echo " ${pod} ${ctr} :"
263
263
if [ " ${example} " -lt 3 ]; then
264
- kubectl logs -n gpu-test${example} ${pod} -c ${ctr} | grep -E " GPU_DEVICE_[0-9]+="
264
+ kubectl logs -n gpu-test${example} ${pod} -c ${ctr} | grep -E " GPU_DEVICE_[0-9]+=" | grep -v " RESOURCE_CLAIM "
265
265
else
266
- kubectl logs -n gpu-test${example} ${pod} -c ${ctr} | grep -E " GPU_DEVICE_[0-9]+"
266
+ kubectl logs -n gpu-test${example} ${pod} -c ${ctr} | grep -E " GPU_DEVICE_[0-9]+" | grep -v " RESOURCE_CLAIM "
267
267
fi
268
268
done
269
269
done
@@ -275,60 +275,60 @@ This should produce output similar to the following:
275
275
``` bash
276
276
gpu-test1:
277
277
pod0 ctr0:
278
- declare -x GPU_DEVICE_0 =" gpu-ee3e4b55-fcda-44b8-0605-64b7a9967744 "
278
+ declare -x GPU_DEVICE_6 =" gpu-6 "
279
279
pod1 ctr0:
280
- declare -x GPU_DEVICE_0 =" gpu-9ede7e32-5825-a11b-fa3d-bab6d47e0243 "
280
+ declare -x GPU_DEVICE_7 =" gpu-7 "
281
281
282
282
gpu-test2:
283
283
pod0 ctr0:
284
- declare -x GPU_DEVICE_0=" gpu-e7b42cb1-4fd8-91b2-bc77-352a0c1f5747 "
285
- declare -x GPU_DEVICE_1=" gpu-f11773a1-5bfb-e48b-3d98-1beb5baaf08e "
284
+ declare -x GPU_DEVICE_0=" gpu-0 "
285
+ declare -x GPU_DEVICE_1=" gpu-1 "
286
286
287
287
gpu-test3:
288
288
pod0 ctr0:
289
- declare -x GPU_DEVICE_0 =" gpu-0159f35e-99ee-b2b5-74f1-9d18df3f22ac "
290
- declare -x GPU_DEVICE_0_SHARING_STRATEGY =" TimeSlicing"
291
- declare -x GPU_DEVICE_0_TIMESLICE_INTERVAL =" Default"
289
+ declare -x GPU_DEVICE_2 =" gpu-2 "
290
+ declare -x GPU_DEVICE_2_SHARING_STRATEGY =" TimeSlicing"
291
+ declare -x GPU_DEVICE_2_TIMESLICE_INTERVAL =" Default"
292
292
pod0 ctr1:
293
- declare -x GPU_DEVICE_0 =" gpu-0159f35e-99ee-b2b5-74f1-9d18df3f22ac "
294
- declare -x GPU_DEVICE_0_SHARING_STRATEGY =" TimeSlicing"
295
- declare -x GPU_DEVICE_0_TIMESLICE_INTERVAL =" Default"
293
+ declare -x GPU_DEVICE_2 =" gpu-2 "
294
+ declare -x GPU_DEVICE_2_SHARING_STRATEGY =" TimeSlicing"
295
+ declare -x GPU_DEVICE_2_TIMESLICE_INTERVAL =" Default"
296
296
297
297
gpu-test4:
298
298
pod0 ctr0:
299
- declare -x GPU_DEVICE_0 =" gpu-657bd2e7-f5c2-a7f2-fbaa-0d1cdc32f81b "
300
- declare -x GPU_DEVICE_0_SHARING_STRATEGY =" TimeSlicing"
301
- declare -x GPU_DEVICE_0_TIMESLICE_INTERVAL =" Default"
299
+ declare -x GPU_DEVICE_3 =" gpu-3 "
300
+ declare -x GPU_DEVICE_3_SHARING_STRATEGY =" TimeSlicing"
301
+ declare -x GPU_DEVICE_3_TIMESLICE_INTERVAL =" Default"
302
302
pod1 ctr0:
303
- declare -x GPU_DEVICE_0 =" gpu-657bd2e7-f5c2-a7f2-fbaa-0d1cdc32f81b "
304
- declare -x GPU_DEVICE_0_SHARING_STRATEGY =" TimeSlicing"
305
- declare -x GPU_DEVICE_0_TIMESLICE_INTERVAL =" Default"
303
+ declare -x GPU_DEVICE_3 =" gpu-3 "
304
+ declare -x GPU_DEVICE_3_SHARING_STRATEGY =" TimeSlicing"
305
+ declare -x GPU_DEVICE_3_TIMESLICE_INTERVAL =" Default"
306
306
307
307
gpu-test5:
308
308
pod0 ts-ctr0:
309
- declare -x GPU_DEVICE_0 =" gpu-18db0e85-99e9-c746-8531-ffeb86328b39 "
310
- declare -x GPU_DEVICE_0_SHARING_STRATEGY =" TimeSlicing"
311
- declare -x GPU_DEVICE_0_TIMESLICE_INTERVAL =" Long"
309
+ declare -x GPU_DEVICE_4 =" gpu-4 "
310
+ declare -x GPU_DEVICE_4_SHARING_STRATEGY =" TimeSlicing"
311
+ declare -x GPU_DEVICE_4_TIMESLICE_INTERVAL =" Long"
312
312
pod0 ts-ctr1:
313
- declare -x GPU_DEVICE_0 =" gpu-18db0e85-99e9-c746-8531-ffeb86328b39 "
314
- declare -x GPU_DEVICE_0_SHARING_STRATEGY =" TimeSlicing"
315
- declare -x GPU_DEVICE_0_TIMESLICE_INTERVAL =" Long"
313
+ declare -x GPU_DEVICE_4 =" gpu-4 "
314
+ declare -x GPU_DEVICE_4_SHARING_STRATEGY =" TimeSlicing"
315
+ declare -x GPU_DEVICE_4_TIMESLICE_INTERVAL =" Long"
316
316
pod0 sp-ctr0:
317
- declare -x GPU_DEVICE_1 =" gpu-93d37703-997c-c46f-a531-755e3e0dc2ac "
318
- declare -x GPU_DEVICE_1_PARTITION_COUNT =" 10"
319
- declare -x GPU_DEVICE_1_SHARING_STRATEGY =" SpacePartitioning"
317
+ declare -x GPU_DEVICE_5 =" gpu-5 "
318
+ declare -x GPU_DEVICE_5_PARTITION_COUNT =" 10"
319
+ declare -x GPU_DEVICE_5_SHARING_STRATEGY =" SpacePartitioning"
320
320
pod0 sp-ctr1:
321
- declare -x GPU_DEVICE_1 =" gpu-93d37703-997c-c46f-a531-755e3e0dc2ac "
322
- declare -x GPU_DEVICE_1_PARTITION_COUNT =" 10"
323
- declare -x GPU_DEVICE_1_SHARING_STRATEGY =" SpacePartitioning"
321
+ declare -x GPU_DEVICE_5 =" gpu-5 "
322
+ declare -x GPU_DEVICE_5_PARTITION_COUNT =" 10"
323
+ declare -x GPU_DEVICE_5_SHARING_STRATEGY =" SpacePartitioning"
324
324
```
325
325
326
326
In this example resource driver, no "actual" GPUs are made available to any
327
327
containers. Instead, a set of environment variables are set in each container
328
328
to indicate which GPUs * would* have been injected into them by a real resource
329
329
driver and how they * would* have been configured.
330
330
331
- You can use the UUIDs of the GPUs as well as the GPU sharing settings set in
331
+ You can use the IDs of the GPUs as well as the GPU sharing settings set in
332
332
these environment variables to verify that they were handed out in a way
333
333
consistent with the semantics shown in the figure above.
334
334
0 commit comments