Skip to content

Commit

Permalink
Add xformers for ROCm support
Browse files Browse the repository at this point in the history
  • Loading branch information
Looong01 committed Dec 17, 2024
1 parent 82a973c commit e285037
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion modules/launch_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -399,7 +399,14 @@ def prepare_environment():
startup_timer.record("install open_clip")

if (not is_installed("xformers") or args.reinstall_xformers) and args.xformers:
run_pip(f"install -U -I --no-deps {xformers_package}", "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")

if not is_installed("ngrok") and args.ngrok:
Expand Down

0 comments on commit e285037

Please sign in to comment.