mirror of
https://github.com/containers/podman.git
synced 2025-11-29 01:28:22 +08:00
pass down the devices specifies in the resources block so that CDI
devices in the compose file are honored.
Tested manually with the following compose file:
services:
testgpupodman_count:
image: ubuntu:latest
command: ["nvidia-smi"]
profiles: [gpu]
deploy:
resources:
reservations:
devices:
- driver: nvidia
count: 1
capabilities: [gpu]
testgpupodman_deviceid:
image: docker.io/ubuntu:latest
command: ["nvidia-smi"]
deploy:
resources:
reservations:
devices:
- driver: cdi
device_ids: ['nvidia.com/gpu=all']
capabilities: [gpu]
Closes: https://github.com/containers/podman/issues/19338
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
12 lines
288 B
Bash
12 lines
288 B
Bash
# -*- bash -*-
|
|
|
|
ctr_name="cdi_device-test-1"
|
|
|
|
podman exec "$ctr_name" sh -c 'stat -c "%t:%T" /dev-host/kmsg'
|
|
|
|
expected=$output
|
|
|
|
podman exec "$ctr_name" sh -c 'stat -c "%t:%T" /dev/kmsg1'
|
|
|
|
is "$output" "$expected" "$testname : device /dev/kmsg1 has the same rdev as /dev/kmsg on the host"
|