Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Let CUDA decide which GPU to use #49

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions DAN-msa/ErrorPredictorMSA.py
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -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
Expand Down
5 changes: 5 additions & 0 deletions run_pyrosetta_ver.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,18 @@ 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)

# Inputs:
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`

Expand Down