fix non-interactive session error and sudo password input for powermetrics

This commit is contained in:
Guitared 2026-03-03 14:14:30 +07:00 committed by GitHub
parent 65cfc3255f
commit b8f09a6853
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 2 additions and 0 deletions

View File

@ -672,6 +672,8 @@ def spawn_training(resume=False, steps=10000):
return proc
def spawn_powermetrics():
if not sys.stdin.isatty():
return None
try:
proc = subprocess.Popen(
['sudo', 'powermetrics', '--samplers', 'cpu_power,gpu_power,ane_power', '-i', '1000'],