Merge e285037e2905bd671d5e25716e191642398601ea into 2174ce5afea90ca489d222f539988dcef59f1027

This commit is contained in:
Loong 2025-05-03 02:17:18 -04:00 committed by GitHub
commit 9165f886f6
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -431,6 +431,13 @@ def prepare_environment():
startup_timer.record("install open_clip")
if (not is_installed("xformers") or args.reinstall_xformers) and args.xformers:
try:
rocm_check = subprocess.run(['rocminfo'], stdout=subprocess.PIPE, stderr=subprocess.PIPE).returncode
except FileNotFoundError:
rocm_check = 1
if rocm_check == 0:
run_pip(f"install -U -I --no-deps xformers --index-url https://download.pytorch.org/whl/rocm6.1", "xformers")
else:
run_pip(f"install -U -I --no-deps {xformers_package}", "xformers")
startup_timer.record("install xformers")