diff --git a/tools/win-ci/gvr.ps1 b/tools/win-ci/gvr.ps1 index 1e8f5bb..10e91ac 100644 --- a/tools/win-ci/gvr.ps1 +++ b/tools/win-ci/gvr.ps1 @@ -129,9 +129,9 @@ try { if ($Phase -eq 'full') { $r['app_build'] = Step 'app_build' { Push-Location (Join-Path $Repo 'app') - & npm ci --no-audit --no-fund + & npm.cmd ci --no-audit --no-fund if ($LASTEXITCODE -ne 0) { Pop-Location; throw "npm ci exit $LASTEXITCODE" } - & npm run dist:win + & npm.cmd run dist:win $c = $LASTEXITCODE Pop-Location if ($c -ne 0) { throw "electron-builder exit $c" } diff --git a/worker/gvr_worker/gpu.py b/worker/gvr_worker/gpu.py index b519166..455cf3d 100644 --- a/worker/gvr_worker/gpu.py +++ b/worker/gvr_worker/gpu.py @@ -68,7 +68,8 @@ def _run_smi(args: list[str]) -> str | None: return None try: flags = getattr(subprocess, "CREATE_NO_WINDOW", 0) - out = subprocess.run([exe, *args], capture_output=True, text=True, timeout=10, creationflags=flags) + out = subprocess.run([exe, *args], stdin=subprocess.DEVNULL, capture_output=True, text=True, timeout=10, + creationflags=flags) # stdin 을 물려주지 않는다 (main.run_finetune 참고) except (OSError, subprocess.TimeoutExpired) as e: log.info("nvidia-smi 실행 실패: %s", e) return None diff --git a/worker/gvr_worker/main.py b/worker/gvr_worker/main.py index ba6dcf0..5c371e8 100644 --- a/worker/gvr_worker/main.py +++ b/worker/gvr_worker/main.py @@ -148,7 +148,9 @@ def run_finetune(req: dict[str, Any], ctx: Context) -> dict[str, Any]: elif v not in (None, False): cmd += [flag, str(v)] flags = getattr(subprocess, "CREATE_NO_WINDOW", 0) - proc = subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE, text=True, encoding="utf-8", + # stdin 은 꼭 끊는다. 워커 stdin(요청 파이프)을 물려받으면 Windows 에서 자식의 런타임 초기화(GetFileType)가 + # 주 스레드의 읽기 대기와 엉켜 자식이 시작조차 못 하고 멈춘다 (win-ci: train 요청 120초 응답 없음). + proc = subprocess.Popen(cmd, stdin=subprocess.DEVNULL, stdout=subprocess.PIPE, stderr=subprocess.PIPE, text=True, encoding="utf-8", errors="replace", creationflags=flags, env={**os.environ, "PYTHONIOENCODING": "utf-8"}) err_tail: deque[str] = deque(maxlen=30)