Skip to content

Commit

Permalink
adds cdi driver support for GPUs
Browse files Browse the repository at this point in the history
  • Loading branch information
ironicbadger committed Sep 9, 2024
1 parent 447db55 commit a80f0ae
Showing 1 changed file with 16 additions and 3 deletions.
19 changes: 16 additions & 3 deletions templates/docker-compose.yml.j2
Original file line number Diff line number Diff line change
Expand Up @@ -185,9 +185,22 @@ services:
resources:
reservations:
devices:
- driver: nvidia
count: {{ container.deploy.resources.reservations.devices.driver.count | default("1") }}
capabilities: [gpu]
{% for device in container.deploy.resources.reservations.devices %}
- driver: {{ device.driver }}
{% if device.device_ids is defined %}
device_ids:
{% for device_id in device.device_ids %}
- {{ device_id }}
{% endfor %}
{% endif %}
{% endfor %}
{% else %}
deploy:
resources:
reservations:
devices:
- count: {{ container.deploy.resources.reservations.devices[0].driver.count | default("1") }}
capabilities: [gpu]
{% endif %}
{% if container.restart is defined %}
restart: {{ container.restart }}
Expand Down

0 comments on commit a80f0ae

Please sign in to comment.