diff --git a/src/build.py b/src/build.py index 1a14893..48395b2 100644 --- a/src/build.py +++ b/src/build.py @@ -40,7 +40,7 @@ def build_generation(args: argparse.Namespace, mg: MonoGen) -> None: return logger.info(f'Building monobase generation {mg.id}...') - os.makedirs(gdir) + os.makedirs(gdir, exist_ok=True) for k, v in mg.cuda.items(): src = install_cuda(args, v) @@ -72,7 +72,7 @@ def build_generation(args: argparse.Namespace, mg: MonoGen) -> None: def build(args: argparse.Namespace) -> None: - os.makedirs(args.cache) + os.makedirs(args.cache, exist_ok=True) for mg in MONOGENS[args.environment]: if mg.id < args.min_gen_id or mg.id > args.max_gen_id: diff --git a/src/cuda.py b/src/cuda.py index 6229385..9f6069a 100644 --- a/src/cuda.py +++ b/src/cuda.py @@ -101,7 +101,7 @@ def install_cudnn(args: argparse.Namespace, version: str, cuda_major: str) -> st subprocess.run(cmd, check=True) logger.info(f'Installing CuDNN {key}...') - os.makedirs(cdir) + os.makedirs(cdir, exist_ok=True) cmd = ['tar', '-xf', file, '--strip-components=1', '--exclude=lib*.a', '-C', cdir] subprocess.run(cmd, check=True) os.remove(file)