Environment and reproducibility
gpu-gate
Wait for a free GPU, claim it, and run your command.
Install
pip install gpu-gateIf you use uv, also as an isolated CLI:
uv tool install gpu-gateWhat it does
On a shared multi-GPU box without a scheduler, launching a job means watching nvidia-smi, picking a card by hand and exporting the variable. gpu-gate is that wait-pick-export-run loop, with a cooperative lock.
In action
A real recorded session of the CLI running.
Read it as text
idx name free total util 0 NVIDIA GeForce RTX 3050 Laptop GPU 3444 MiB 4096 MiB 4%
$ gpu-gate status
idx name free total util
0 NVIDIA GeForce RTX 3050 Laptop GPU 3031 MiB 4096 MiB 1%Features
- —Selection by free memory and utilization.
- —Cooperative lock so two runs do not grab the same card.
- —Exports CUDA_VISIBLE_DEVICES and runs.
- —No daemon or server; honest exit codes.