From e7fc2ccf31c7ace40cd82e77a3cc74edd97c996d Mon Sep 17 00:00:00 2001 From: Brandon Thomas Date: Sun, 10 Jul 2022 18:06:18 -0400 Subject: [PATCH] Add script to launch workers on-prem --- tts/launch_worker_3090.sh | 60 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 60 insertions(+) create mode 100755 tts/launch_worker_3090.sh diff --git a/tts/launch_worker_3090.sh b/tts/launch_worker_3090.sh new file mode 100755 index 0000000..bd1f6ec --- /dev/null +++ b/tts/launch_worker_3090.sh @@ -0,0 +1,60 @@ +#!/bin/bash +# This script is meant to be launched on on-prem dual Nvidia GEFORCE 3090 hosts. +# +# It's meant to be provided with a numerical worker index and automatically run on +# the correct GPU and port, eg. +# +# ./launch_worker.sh 4 +# +# Once on-prem uses Kubernetes, this won't be necessary anymore. + +set -euxo pipefail + +define -r WORKER_INDEX="$1" + +# A dual 3090 can run eight jobs across two GPUs. +case "${WORKER_INDEX}" in + "1") + PORT=9001 + CUDA_VISIBLE_DEVICES=0 + ;; + "2") + PORT=9002 + CUDA_VISIBLE_DEVICES=0 + ;; + "3") + PORT=9003 + CUDA_VISIBLE_DEVICES=0 + ;; + "4") + PORT=9004 + CUDA_VISIBLE_DEVICES=0 + ;; + "5") + PORT=9005 + CUDA_VISIBLE_DEVICES=1 + ;; + "6") + PORT=9006 + CUDA_VISIBLE_DEVICES=1 + ;; + "7") + PORT=9007 + CUDA_VISIBLE_DEVICES=1 + ;; + "8") + PORT=9008 + CUDA_VISIBLE_DEVICES=1 + ;; + + *) + echo "Invalid worker index as argument: ${WORKER_INDEX}" + exit + ;; +esac + + +# NB: This is the conventional venv directory +source python/bin/activate + +CUDA_VISIBLE_DEVICES=${CUDA_VISIBLE_DEVICES} ./vocodes_server.py --port "${PORT}"