<#7177 [V2] Add GPU support for sandbox via FLYTE_...
# flyte-github
a
#7177 [V2] Add GPU support for sandbox via FLYTE_SANDBOX_GPU env var Pull request opened by pingsutw Summary • Add opt-in NVIDIA GPU support for the Flyte sandbox, targeting machines like DGX Spark • When
FLYTE_SANDBOX_GPU=true
is set, the sandbox container gets
--gpus all
and auto-configures K3s with the NVIDIA container runtime and device plugin • No impact on non-GPU machines — GPU support is disabled by default Changes •
docker/sandbox-bundled/Makefile
: Add
FLYTE_SANDBOX_GPU
env var that conditionally passes
--gpus all
to Docker •
docker/sandbox-bundled/bin/k3d-entrypoint-gpu.sh
(new): Entrypoint script that, when GPU is enabled: • Configures K3s containerd to use
nvidia-container-runtime
as default runtime • Deploys NVIDIA k8s-device-plugin DaemonSet for
<http://nvidia.com/gpu|nvidia.com/gpu>
resource advertisement Usage # On GPU machine (e.g., DGX Spark) FLYTE_SANDBOX_GPU=true make start # On non-GPU machine (default) make start Test plan • Verify
make start
still works without
FLYTE_SANDBOX_GPU
(no regression on non-GPU machines) • Verify
FLYTE_SANDBOX_GPU=true make start
on a machine with NVIDIA GPU + Container Toolkit • Verify
<http://nvidia.com/gpu|nvidia.com/gpu>
resources are advertised:
kubectl describe node | grep nvidia
• Verify a pod requesting GPU can be scheduled:
kubectl run gpu-test --image=nvidia/cuda:12.0-base --restart=Never -- nvidia-smi
•
main
• #6583 • [V2] Add GPU support for sandbox via FLYTE_SANDBOX_GPU env var 👈 flyteorg/flyte