Skip to content

Commit 0983f71

Browse files
RavlenRoshni Sarangadharan
andcommitted
Merge branch 'doc/k8s-gpu-update' into 'main'
Doc: Kubernetes executor GPU configuration requirements See merge request https://gitlab.com/gitlab-org/gitlab-runner/-/merge_requests/6077 Merged-by: Marcel Amirault <mamirault@gitlab.com> Approved-by: Darren Eastman <deastman@gitlab.com> Approved-by: Marcel Amirault <mamirault@gitlab.com> Approved-by: Arran Walker <ajwalker@gitlab.com> Reviewed-by: Marcel Amirault <mamirault@gitlab.com> Co-authored-by: Roshni Sarangadharan <rsarangadharan@gitlab.com>
2 parents 81b0004 + a6ca260 commit 0983f71

1 file changed

Lines changed: 23 additions & 2 deletions

File tree

docs/configuration/gpus.md

Lines changed: 23 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,29 @@ See the [documentation for the GitLab fork of Docker Machine](../executors/docke
5454

5555
## Kubernetes executor
5656

57-
No runner configuration should be needed. Be sure to check that
58-
[the node selector chooses a node with GPU support](https://kubernetes.io/docs/tasks/manage-gpus/scheduling-gpus/).
57+
Prerequisites:
58+
59+
- Ensure that [the node selector chooses a node with GPU support](https://kubernetes.io/docs/tasks/manage-gpus/scheduling-gpus/).
60+
- Enable the `FF_USE_ADVANCED_POD_SPEC_CONFIGURATION` feature flag.
61+
62+
To enable GPU support, configure the runner to request GPU resources in the pod specification. For example:
63+
64+
```toml
65+
[[runners.kubernetes.pod_spec]]
66+
name = "gpu"
67+
patch = '''
68+
containers:
69+
- name: build
70+
resources:
71+
requests:
72+
nvidia.com/gpu: 1
73+
limits:
74+
nvidia.com/gpu: 1
75+
'''
76+
patch_type = "strategic" # <--- `strategic` patch_type
77+
```
78+
79+
Adjust the GPU count in `requests` and `limits` based on your job requirements.
5980

6081
GitLab Runner has been [tested on Amazon Elastic Kubernetes Service](https://gitlab.com/gitlab-org/gitlab-runner/-/issues/4355)
6182
with [GPU-enabled instances](https://docs.aws.amazon.com/dlami/latest/devguide/gpu.html).

0 commit comments

Comments
 (0)