Skip to content

Commit a6ca260

Browse files
Roshni SarangadharanRavlen
authored andcommitted
Add gpu limit using a patch
1 parent 15b7bfd commit a6ca260

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)