[https://nvbugs/5821433][fix] WAR for popen in QA env (#10989)

Signed-off-by: Lizhi Zhou <1432185+reasonsolo@users.noreply.github.com>
Signed-off-by: Wangshanshan <30051912+dominicshanshan@users.noreply.github.com>
This commit is contained in:
Lizhi Zhou 2026-01-28 14:55:55 +08:00 committed by Yanchao Lu
parent 5f8b1b8cbb
commit 1524c172a4

View File

@ -147,14 +147,14 @@ def _run_worker(model_name,
env = os.environ.copy()
log_file = None
log_path = None
stdout = None
stderr = None
if save_log:
log_path = os.path.join(work_dir, f"worker_{role}_{port}.log")
log_file = open(log_path, "w+")
stdout = log_file
stderr = log_file
else:
stdout = sys.stdout
stderr = sys.stderr
if device != -1:
env["CUDA_VISIBLE_DEVICES"] = str(device)
print(f"Running {role} on port {port}")