updated prolog.d/10-GPU_allocate.sh

This commit is contained in:
Kasper D. Fischer 2024-08-13 14:32:19 +02:00
parent 6d1a2e9759
commit add7211f76

View File

@ -42,7 +42,7 @@ if [ -z "${NGPUS}" ] ; then
fi
# get list of installed GPU's (exit without error if nvidia-smi is not available (i. e. no GPU's installed))
[ -f /usr/bin/nvidia-smi ] && GPU_LIST=$(/usr/bin/nvidia-smi -L | cut -f1 -d":" | cut -f2 -d" " | xargs shuf -e) || exit 0
[ -f /usr/bin/nvidia-smi ] && GPU_LIST=$(/usr/bin/nvidia-smi -L | cut -f1 -d":" | cut -f2 -d" " | xargs shuf -e 2>/dev/null) || exit 0
## loop over devices and try to allocate one until enough GPU's are allocated
CUDA_VISIBLE_DEVICES=''