Skip to content

Commit

Permalink
[k8s] Use default runtime on k3s for CPU tasks (#3918)
Browse files Browse the repository at this point in the history
* fix

* lint
  • Loading branch information
romilbhardwaj authored Sep 10, 2024
1 parent db9aeb0 commit 8d795b7
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion sky/provision/kubernetes/instance.py
Original file line number Diff line number Diff line change
Expand Up @@ -530,7 +530,9 @@ def _create_pods(region: str, cluster_name_on_cloud: str,
'override runtimeClassName in ~/.sky/config.yaml. '
'For more details, refer to https://skypilot.readthedocs.io/en/latest/reference/config.html') # pylint: disable=line-too-long

if nvidia_runtime_exists:
needs_gpus = (pod_spec['spec']['containers'][0].get('resources', {}).get(
'limits', {}).get('nvidia.com/gpu', 0) > 0)
if nvidia_runtime_exists and needs_gpus:
pod_spec['spec']['runtimeClassName'] = 'nvidia'

created_pods = {}
Expand Down

0 comments on commit 8d795b7

Please sign in to comment.