From 5702271991e126c026aa1ff41c44f8ad37b26e3a Mon Sep 17 00:00:00 2001 From: Lincoln Stein Date: Wed, 9 Nov 2022 14:09:36 +0000 Subject: [PATCH] speculative reorganization of the requirements & environment files - This is only a test! - The various environment*.yml and requirements*.txt files have all been moved into a directory named "environments-and-requirements". - The idea is to clean up our root directory so that the github home page is tidy. - The manual install instructions will start with the instructions to create a symbolic link from environment.yml to the appropriate file for OS and GPU. - The 1-click installers have been updated to accommodate this change. --- .gitignore | 5 +++++ 1-click-installer/install.bat | 1 + 1-click-installer/install.sh | 15 ++++++++++----- .../environment-lin-aarch64.yml | 0 .../environment-lin-amd.yml | 0 .../environment-lin-cuda.yml | 0 .../environment-mac.yml | 0 .../environment-win-cuda.yml | 0 .../requirements-lin-amd.txt | 0 .../requirements-linux-amd.txt | 0 .../requirements-linux-arm64.txt | 0 .../requirements-linux-cuda.txt | 0 .../requirements-linux-windows-colab-cuda.txt | 0 .../requirements-mac-mps-cpu.txt | 0 14 files changed, 16 insertions(+), 5 deletions(-) rename environment-linux-aarch64.yml => environments-and-requirements/environment-lin-aarch64.yml (100%) rename environment-AMD.yml => environments-and-requirements/environment-lin-amd.yml (100%) rename environment-linux-cuda.yml => environments-and-requirements/environment-lin-cuda.yml (100%) rename environment-mac.yml => environments-and-requirements/environment-mac.yml (100%) rename environment-win-cuda.yml => environments-and-requirements/environment-win-cuda.yml (100%) rename requirements-mac-MPS-CPU.txt => environments-and-requirements/requirements-lin-amd.txt (100%) rename requirements-lin-AMD.txt => environments-and-requirements/requirements-linux-amd.txt (100%) rename requirements-linux-arm64.txt => environments-and-requirements/requirements-linux-arm64.txt (100%) rename requirements-linux-cuda.txt => environments-and-requirements/requirements-linux-cuda.txt (100%) rename requirements-lin-win-colab-CUDA.txt => environments-and-requirements/requirements-linux-windows-colab-cuda.txt (100%) rename requirements-rocm.txt => environments-and-requirements/requirements-mac-mps-cpu.txt (100%) diff --git a/.gitignore b/.gitignore index a30b2156e8..cb5f2cc107 100644 --- a/.gitignore +++ b/.gitignore @@ -219,3 +219,8 @@ models/gfpgan # ignore initfile invokeai.init + +# ignore environment.yml and requirements.txt +# these are to be copied from environments-and-requirements +environment.yml +requirements.txt \ No newline at end of file diff --git a/1-click-installer/install.bat b/1-click-installer/install.bat index 1054d05634..c8e68d7391 100644 --- a/1-click-installer/install.bat +++ b/1-click-installer/install.bat @@ -81,6 +81,7 @@ call conda activate @rem create the environment call conda env remove -n invokeai +mklink environment.yml environments-and-requirements\environment-win-cuda.yml call conda env create if "%ERRORLEVEL%" NEQ "0" ( echo "" diff --git a/1-click-installer/install.sh b/1-click-installer/install.sh index fbee171469..a2aeed0470 100755 --- a/1-click-installer/install.sh +++ b/1-click-installer/install.sh @@ -94,14 +94,19 @@ CONDA_BASEPATH=$(conda info --base) source "$CONDA_BASEPATH/etc/profile.d/conda.sh" # otherwise conda complains about 'shell not initialized' (needed when running in a script) conda activate - if [ "$OS_NAME" == "mac" ]; then - environment_file="environment-mac.yml" + echo "Macintosh system detected. Installing MPS and CPU support." + ln -sf environments-and-requirements/environment-mac.yml environment.yml else - environment_file="environment.yml" + if (lsmod | grep amdgpu) &>/dev/null ; then + echo "Linux system with AMD GPU driver detected. Installing ROCm and CPU support" + ln -sf environments-and-requirements/environment-lin-amd.yml environment.yml + else + echo "Linux system detected. Installing CUDA and CPU support." + ln -sf environments-and-requirements/environment-lin-cuda.yml environment.yml + fi fi - -conda env update -f "${environment_file}" +conda env update status=$? diff --git a/environment-linux-aarch64.yml b/environments-and-requirements/environment-lin-aarch64.yml similarity index 100% rename from environment-linux-aarch64.yml rename to environments-and-requirements/environment-lin-aarch64.yml diff --git a/environment-AMD.yml b/environments-and-requirements/environment-lin-amd.yml similarity index 100% rename from environment-AMD.yml rename to environments-and-requirements/environment-lin-amd.yml diff --git a/environment-linux-cuda.yml b/environments-and-requirements/environment-lin-cuda.yml similarity index 100% rename from environment-linux-cuda.yml rename to environments-and-requirements/environment-lin-cuda.yml diff --git a/environment-mac.yml b/environments-and-requirements/environment-mac.yml similarity index 100% rename from environment-mac.yml rename to environments-and-requirements/environment-mac.yml diff --git a/environment-win-cuda.yml b/environments-and-requirements/environment-win-cuda.yml similarity index 100% rename from environment-win-cuda.yml rename to environments-and-requirements/environment-win-cuda.yml diff --git a/requirements-mac-MPS-CPU.txt b/environments-and-requirements/requirements-lin-amd.txt similarity index 100% rename from requirements-mac-MPS-CPU.txt rename to environments-and-requirements/requirements-lin-amd.txt diff --git a/requirements-lin-AMD.txt b/environments-and-requirements/requirements-linux-amd.txt similarity index 100% rename from requirements-lin-AMD.txt rename to environments-and-requirements/requirements-linux-amd.txt diff --git a/requirements-linux-arm64.txt b/environments-and-requirements/requirements-linux-arm64.txt similarity index 100% rename from requirements-linux-arm64.txt rename to environments-and-requirements/requirements-linux-arm64.txt diff --git a/requirements-linux-cuda.txt b/environments-and-requirements/requirements-linux-cuda.txt similarity index 100% rename from requirements-linux-cuda.txt rename to environments-and-requirements/requirements-linux-cuda.txt diff --git a/requirements-lin-win-colab-CUDA.txt b/environments-and-requirements/requirements-linux-windows-colab-cuda.txt similarity index 100% rename from requirements-lin-win-colab-CUDA.txt rename to environments-and-requirements/requirements-linux-windows-colab-cuda.txt diff --git a/requirements-rocm.txt b/environments-and-requirements/requirements-mac-mps-cpu.txt similarity index 100% rename from requirements-rocm.txt rename to environments-and-requirements/requirements-mac-mps-cpu.txt