studio: address review feedback

install_python_stack.py:
- Print uv error output on failure for debuggability
- Refactor pip_install() to use early return after uv success,
  removing duplicated pip command path

setup.sh:
- Guard nvidia-smi command substitution with || true so it does
  not abort the script under set -euo pipefail when nvidia-smi
  fails (e.g., containerized environments, driver quirks)
- Read all GPU compute capabilities and deduplicate, so
  mixed-GPU hosts get kernels built for all present architectures
  instead of only the first GPU
This commit is contained in:
Daniel Han 2026-03-14 06:49:08 +00:00
parent 6dda8c4c23
commit a7a66a66b9
2 changed files with 25 additions and 15 deletions

View file

@ -186,13 +186,14 @@ def pip_install(
stdout = subprocess.PIPE,
stderr = subprocess.STDOUT,
)
if result.returncode != 0:
print(_red(f" uv failed, falling back to pip..."))
pip_cmd = _build_pip_cmd(args) + constraint_args + req_args
run(label, pip_cmd)
else:
pip_cmd = _build_pip_cmd(args) + constraint_args + req_args
run(label, pip_cmd)
if result.returncode == 0:
return
print(_red(f" uv failed, falling back to pip..."))
if result.stdout:
print(result.stdout.decode(errors = "replace"))
pip_cmd = _build_pip_cmd(args) + constraint_args + req_args
run(label, pip_cmd)
finally:
if actual_req is not None and actual_req != req:
actual_req.unlink(missing_ok = True)