Skip to content

Commit

Permalink
[Docker] Add --gpus all for docker when GPU is available (#3833)
Browse files Browse the repository at this point in the history
* Add --gpus all for when GPU is available

* Get rid of --gpus all
  • Loading branch information
Michaelvll authored Aug 21, 2024
1 parent 87e55ab commit fa60f7a
Show file tree
Hide file tree
Showing 5 changed files with 1 addition and 13 deletions.
2 changes: 1 addition & 1 deletion sky/provision/docker_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -381,7 +381,7 @@ def _configure_runtime(self, run_options: List[str]) -> List[str]:
if 'nvidia-container-runtime' in runtime_output:
try:
self._run('nvidia-smi', log_err_when_fail=False)
return run_options + ['--runtime=nvidia']
return run_options + ['--runtime=nvidia', '--gpus all']
except Exception as e: # pylint: disable=broad-except
logger.debug(
'Nvidia Container Runtime is present in the docker image'
Expand Down
3 changes: 0 additions & 3 deletions sky/templates/aws-ray.yml.j2
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,6 @@ docker:
container_name: {{docker_container_name}}
run_options:
- --ulimit nofile=1048576:1048576
{%- if custom_resources is not none %}
--gpus all
{%- endif %}
{%- for run_option in docker_run_options %}
- {{run_option}}
{%- endfor %}
Expand Down
3 changes: 0 additions & 3 deletions sky/templates/azure-ray.yml.j2
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,6 @@ docker:
container_name: {{docker_container_name}}
run_options:
- --ulimit nofile=1048576:1048576
{%- if custom_resources is not none %}
--gpus all
{%- endif %}
{%- for run_option in docker_run_options %}
- {{run_option}}
{%- endfor %}
Expand Down
3 changes: 0 additions & 3 deletions sky/templates/gcp-ray.yml.j2
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,6 @@ docker:
container_name: {{docker_container_name}}
run_options:
- --ulimit nofile=1048576:1048576
{%- if gpu is not none %}
--gpus all
{%- endif %}
{%- for run_option in docker_run_options %}
- {{run_option}}
{%- endfor %}
Expand Down
3 changes: 0 additions & 3 deletions sky/templates/paperspace-ray.yml.j2
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,6 @@ docker:
container_name: {{docker_container_name}}
run_options:
- --ulimit nofile=1048576:1048576
{%- if custom_resources is not none %}
--gpus all
{%- endif %}
{%- for run_option in docker_run_options %}
- {{run_option}}
{%- endfor %}
Expand Down

0 comments on commit fa60f7a

Please sign in to comment.