Repository navigation
fix(helm): request the fl-client GPU from the device plugin - #1767
Merged
Merged
Conversation
flClient.gpu.enabled rendered only an annotation, a toleration and NVIDIA_VISIBLE_DEVICES=0, so Kubernetes reserved nothing. On a cluster whose GPUs the NVIDIA device plugin hands out, the pod could land on a node with no GPU, or take physical GPU 0 from another workload. flClient.gpu.allocation (default devicePlugin) now makes the container request nvidia.com/gpu, merged into flClient.resources.limits, and leaves NVIDIA_VISIBLE_DEVICES to the plugin. allocation=runtime keeps the old shape for a single node with no device plugin and nvidia as its default runtime. Signed-off-by: R. Garcia-Dias <rafaelagd@gmail.com>
atriaybagur
approved these changes
Nov 2, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
flClient.gpu.enabled=truedid not allocate a GPU through Kubernetes. It rendered only annvidia.com/gpuannotation, a toleration andNVIDIA_VISIBLE_DEVICES=0, with no resource request. That only works where the node's default container runtime isnvidia, and even there the pod takes physical GPU 0, which nothing reserves. On a cluster whose GPUs come from the NVIDIA device plugin or the GPU Operator (the setup the chart docs require), the client could be scheduled onto a node with no GPU, or share GPU 0 with another workload. That is the case for the GSTT trust in #1766, which runs on an 8-GPU cluster.This PR adds
flClient.gpu.allocation:devicePlugin(default): the fl-client container requestsnvidia.com/gpu: <count>, merged intoflClient.resources.limitsthe way monailabel already does it. The device plugin picks the device and setsNVIDIA_VISIBLE_DEVICESitself, so the chart no longer sets it; a value in the pod spec would override the plugin's choice.CUDA_VISIBLE_DEVICES=0stays, since the pod's one GPU is index 0 inside the container.runtime: the previous shape, with no request andNVIDIA_VISIBLE_DEVICES=0. It is for a single node with no device plugin anddefault-runtime: nvidia, for example a k3s workstation.An unknown value is refused, both by
values.schema.jsonand by the template, which covers a render without schema validation.The docs (chart README, troubleshooting list and the Kubernetes trust page) also gain the symptom from #1766: a trust left at
flClient.gpu.enabled=falseoffers FLARE 0 GPUs, so every job that asks for one waits and then fails. They point multi-GPU clusters at NVFLARE job pods (flClient.nvflare.jobPods), which allocate a GPU per job.Linked Issues
Relates to #1766. That issue also covers operational work on the GSTT cluster that this PR does not do.
Checklist
Type of Change
make -C docs/ docs.Upgrade note: a release with
flClient.gpu.enabled=trueon a node that has no device plugin (single-node k3s relying ondefault-runtime: nvidia) must addflClient.gpu.allocation: runtimebefore upgrading. Without it the fl-client requestsnvidia.com/gpu, which that node does not advertise, and the pod stays Pending. Releases with the GPU disabled are unaffected.Testing
I did the following tests to verify my changes:
tests/templates/test_fl_client_gpu_render.py(new) fails ondevelopand passes here. It covers:NVIDIA_VISIBLE_DEVICESis left to the plugin;runtimeshape;uv run --no-project --with pytest --with pyyaml pytest trust/deploy/helm/tests(538 passed).make -C trust/deploy/helm test(lint, template, validate), pluskubeconform -strictover a GPU-enabled render (56 resources valid).ruff check/ruff format --checkon the new test.Additional Notes
Job-pod mode (
flClient.nvflare.jobPods) already requestsnvidia.com/gpuper job and is unchanged.