diff --git a/tools/ingame/README.md b/tools/ingame/README.md index bd03a447..c3c7e08a 100644 --- a/tools/ingame/README.md +++ b/tools/ingame/README.md @@ -46,6 +46,11 @@ Everything after a lone `--` wraps each GPU run, for example a GPU-slot tool. options to every model choice (e.g. `l_post=own`); `--extra` on `prepare`, `use-m` or `use-l` replaces it for that choice (`--extra ''` for none), so two variants can run in one session. + Optional `gpu_slot`: `{"command": [...], "env": {...}}`, a command prefix that runs one command in a GPU slot on a + shared PC (for example a slot tool with a hard time cap, ending in its `--`). The launcher's install, repair, update, + uninstall and rollback checks run a short HIP probe on the GPU, so those verbs run through the prefix, with `env` + added. Without `gpu_slot` they run directly, and the session log says the probe ran outside a slot. + 2. Run the phases: ``` diff --git a/tools/ingame/run.py b/tools/ingame/run.py index 116f003c..ff98e04d 100644 --- a/tools/ingame/run.py +++ b/tools/ingame/run.py @@ -105,6 +105,11 @@ def _config_path(argv): S = CFG.get('settings') or {} os.makedirs(A, exist_ok=True) EXTRA = CFG.get('runtime_options_extra', '') # e.g. "l_post=own"; run.py --extra replaces it for one phase + # The launcher's install / repair / update / uninstall / rollback checks run a short HIP probe on the GPU. With + # "gpu_slot": {"command": [], "env": {...}} they run through that prefix + # (e.g. a slot tool with a hard cap); without it they run directly and the session log says so. + GPU_SLOT = CFG.get('gpu_slot') or {} +GPU_VERBS = ('install', 'repair', 'update', 'uninstall', 'rollback') def opts_extra(r): @@ -179,13 +184,22 @@ def py(self, name, args, out=None, check=True): return r.returncode def wg(self, name, verb_args): - """The candidate launcher's command line (--out / --log into ).""" + """The candidate launcher's command line (--out / --log into ). The verbs whose checks run the launcher's HIP + probe (GPU_VERBS) go through the config's gpu_slot prefix when there is one.""" cmd = [PKG_EXE] + verb_args + ['--out=' + os.path.join(self.a, name + '.json'), '--log=' + os.path.join(self.a, name + '.log')] + env = clean_env() + if verb_args[:1] and verb_args[0] in GPU_VERBS: + if GPU_SLOT.get('command'): + cmd = list(GPU_SLOT['command']) + cmd + env.update(GPU_SLOT.get('env') or {}) + else: + self.log('note: no gpu_slot in the config: the launcher\'s %s runs its HIP probe outside a GPU slot' + % verb_args[0]) if self.dry: self.log('would run: ' + ' '.join('"%s"' % c if ' ' in c else c for c in cmd)) return 0 - r = subprocess.run(cmd, creationflags=NOWIN, env=clean_env()) + r = subprocess.run(cmd, creationflags=NOWIN, env=env) self.log('launcher %s exit %d' % (' '.join(verb_args[:1]), r.returncode)) return r.returncode