Skip to content

Commit

Permalink
Fix logic when defining enviroment variable
Browse files Browse the repository at this point in the history
  • Loading branch information
davidjurado committed Nov 28, 2023
1 parent 81aebee commit 7a5fea8
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
3 changes: 0 additions & 3 deletions mlcube/mlcube/parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -128,9 +128,6 @@ 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
3 changes: 3 additions & 0 deletions runners/mlcube_docker/mlcube_docker/docker_run.py
Original file line number Diff line number Diff line change
Expand Up @@ -266,6 +266,9 @@ def run(self) -> None:
if extra_args:
run_args += " " + extra_args

cuda_visible_devices = self.mlcube.runner["--gpus"] if "--gpus" in self.mlcube.runner else num_gpus
run_args += f" --env CUDA_VISIBLE_DEVICES={cuda_visible_devices}"

if "entrypoint" in self.mlcube.tasks[self.task]:
logger.info(
"Using custom task entrypoint: task=%s, entrypoint='%s'",
Expand Down

0 comments on commit 7a5fea8

Please sign in to comment.