Added flag for enabling nvidia gpu

This commit is contained in:
Alex Davies 2024-09-19 11:25:59 -03:00
parent a60a1784f7
commit f0fce2dc54
2 changed files with 14 additions and 0 deletions

View File

@ -24,6 +24,11 @@ LANGUAGES:
RUN_COMMAND: rosrun {{ PACKAGE_NAME }} {{ "main.py" if 'Python' in LANGUAGES else "main" if "CPP" in LANGUAGES else "yourcommandGoes here" }}
ENABLE_NVIDIA_GPU:
default: False
type: bool
help: Enabling nvidia gpus make deployment much more complicated. Ensure you have the nvidia container toolkit working properly.
HEALTHCHECK:
defualt: --start-period=60s --start-interval=1s CMD /ros_entrypoint.sh rostopic list
type: str

View File

@ -19,6 +19,15 @@ services:
nofile:
soft: 1024
hard: 524288
{% if ENABLE_GPU %}
deploy:
resources:
reservations:
devices:
- driver: cdi
device_ids:
- nvidia.com/gpu=all
{{% endif %}
networks:
sdk: