Skip to content

Commit

Permalink
Add CUDA_VISIBLE_DEVICES enviroment variable when using the --gpus flag
Browse files Browse the repository at this point in the history
  • Loading branch information
davidjurado committed Nov 15, 2023
1 parent 755d388 commit 81aebee
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions mlcube/mlcube/parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,9 @@ def parse_extra_arg(
if parsed_args.get("gpus", None):
if platform == "docker":
runner_run_args["--gpus"] = parsed_args["gpus"]
os.environ["CUDA_VISIBLE_DEVICES"] = parsed_args[
"gpus"
]
else:
runner_run_args["--nv"] = ""
os.environ["SINGULARITYENV_CUDA_VISIBLE_DEVICES"] = parsed_args[
Expand Down

0 comments on commit 81aebee

Please sign in to comment.