#!/usr/bin/env bash
# Wait until the GPU has at least $1 GB free, then return (a job that needs more than the queue's 6 GB guard starts with this).
need=$(( $1 * 1024 ))
until [ "$(nvidia-smi --query-gpu=memory.free --format=csv,noheader,nounits | head -1)" -ge "$need" ]; do sleep 120; done
