diff --git a/DAN-msa/ErrorPredictorMSA.py b/DAN-msa/ErrorPredictorMSA.py index fb816bf..efb48b7 100755 --- a/DAN-msa/ErrorPredictorMSA.py +++ b/DAN-msa/ErrorPredictorMSA.py @@ -46,9 +46,8 @@ def main(): help="# of cpus to use for featurization (Default: 1)") parser.add_argument("--gpu", "-g", action="store", - type=int, - default=0, - help="gpu device to use (default gpu0)") + default=None, + help="specific gpu id to use, e.g. 0 for gpu0 (Default: None)") parser.add_argument("--featurize", "-f", action="store_true", @@ -114,7 +113,9 @@ def main(): # Importing larger libraries # ############################## os.environ['TF_CPP_MIN_LOG_LEVEL'] = '3' - os.environ["CUDA_VISIBLE_DEVICES"] = str(args.gpu) + if args.gpu is not None: + assert type(args.gpu) == int, 'GPU id must be specified as int, e.g. 0' + os.environ["CUDA_VISIBLE_DEVICES"] = str(args.gpu) script_dir = os.path.dirname(__file__) sys.path.insert(0, script_dir) import pyErrorPred diff --git a/run_pyrosetta_ver.sh b/run_pyrosetta_ver.sh index 53a6787..0938246 100755 --- a/run_pyrosetta_ver.sh +++ b/run_pyrosetta_ver.sh @@ -15,6 +15,7 @@ unset __conda_setup SCRIPT=`realpath -s $0` export PIPEDIR=`dirname $SCRIPT` +GPU_ID="" # which gpu to use (int), for example 0 for gpu0. if none provided, it will let CUDA decide CPU="8" # number of CPUs to use MEM="64" # max memory (in GB) @@ -22,6 +23,10 @@ MEM="64" # max memory (in GB) IN="$1" # input.fasta WDIR=`realpath -s $2` # working folder +if [ ! -z "$GPU_ID" ] + then + export CUDA_VISIBLE_DEVICES=$GPU_ID +fi LEN=`tail -n1 $IN | wc -m`