Add GPUs support for services
-
Please check this box if this contribution uses AI-generated content (including content generated by GitLab Duo features) as outlined in the GitLab DCO & CLA. As a benefit of being a GitLab Community Contributor, you receive complimentary access to GitLab Duo.
What does this MR do?
This MR adds support for the Docker executor to expose GPUs to services. A new service_gpus
string in the runner config allows configuring GPU exposure to services using the same syntax as the gpus
string.
Based on our feature design discussion, I've decided to go ahead and propose an implementation according to variant 2.1.
I've tested this modification on a real test project and confirm that it's working.
Why was this MR needed?
Services that require GPUs have no access to these resources at the moment. See #38513 (closed) for more details.
What's the best way to test this MR?
-
Compile the
gitlab-runner
executable from this MR. -
Register the runner using the Docker executor in a test project.
-
Add the
service_gpus
setting in theconfig.toml
file:[[runners]] (...) [runners.docker] (...) service_gpus = "all"
-
Add a test CI config in
.gitlab-ci.yml
:variables: CI_DEBUG_SERVICES: "true" test: services: - name: debian:latest command: ["nvidia-smi"] image: debian:latest script: - nvidia-smi tags: - <RUNNER_TAG>
What are the relevant issue numbers?
Closes #38513 (closed).
/cc @avonbertoldi, as we have been discussing about this feature in #38513 (closed) and as you have reviewed !5343 (merged), which is similar.