From 6c148f1791b39d678a502724077200eef85664d1 Mon Sep 17 00:00:00 2001 From: cmdr2 Date: Thu, 20 Apr 2023 16:48:38 +0530 Subject: [PATCH] Don't install xformers for AMD on Linux; changelog --- CHANGES.md | 1 + scripts/check_modules.py | 19 +++++++++++++------ ui/index.html | 2 +- 3 files changed, 15 insertions(+), 7 deletions(-) diff --git a/CHANGES.md b/CHANGES.md index 7e61b5aa..ed648dd4 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -21,6 +21,7 @@ Our focus continues to remain on an easy installation experience, and an easy user-interface. While still remaining pretty powerful, in terms of features and speed. ### Detailed changelog +* 2.5.33 - 20 Apr 2023 - Use `xformers` to speed up image generation. * 2.5.32 - 19 Apr 2023 - Automatically check for black images, and set full-precision if necessary (for attn). This means custom models based on Stable Diffusion v2.1 will just work, without needing special command-line arguments or editing of yaml config files. * 2.5.31 - 10 Apr 2023 - Reduce VRAM usage while upscaling. * 2.5.31 - 6 Apr 2023 - Allow seeds upto `4,294,967,295`. Thanks @ogmaresca. diff --git a/scripts/check_modules.py b/scripts/check_modules.py index 042086a1..80d198e2 100644 --- a/scripts/check_modules.py +++ b/scripts/check_modules.py @@ -35,7 +35,7 @@ def version(module_name: str) -> str: def install(module_name: str, module_version: str): - if module_name == "xformers" and os_name == "Darwin": # xformers is not available on mac + if module_name == "xformers" and (os_name == "Darwin" or is_amd_on_linux()): return index_url = None @@ -87,11 +87,8 @@ def apply_torch_install_overrides(module_version: str): if os_name == "Windows": module_version += "+cu117" index_url = "https://download.pytorch.org/whl/cu117" - elif os_name == "Linux": - with open("/proc/bus/pci/devices", "r") as f: - device_info = f.read() - if "amdgpu" in device_info and "nvidia" not in device_info: - index_url = "https://download.pytorch.org/whl/rocm5.4.2" + elif is_amd_on_linux(): + index_url = "https://download.pytorch.org/whl/rocm5.4.2" return module_version, index_url @@ -107,6 +104,16 @@ def include_cuda_versions(module_versions: tuple) -> tuple: return allowed_versions +def is_amd_on_linux(): + if os_name == "Linux": + with open("/proc/bus/pci/devices", "r") as f: + device_info = f.read() + if "amdgpu" in device_info and "nvidia" not in device_info: + return True + + return False + + def fail(module_name): print( f"""Error installing {module_name}. Sorry about that, please try to: diff --git a/ui/index.html b/ui/index.html index 2e89aaf4..404d88af 100644 --- a/ui/index.html +++ b/ui/index.html @@ -30,7 +30,7 @@

Easy Diffusion - v2.5.32 + v2.5.33