From 066390eb5683945a6e094a817584ada6b1f7118e Mon Sep 17 00:00:00 2001 From: Wes Roberts Date: Wed, 4 Jan 2023 17:58:16 -0500 Subject: Fixes webui.sh to exec LAUNCH_SCRIPT --- webui.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'webui.sh') diff --git a/webui.sh b/webui.sh index 04ecbf76..c4d6521d 100755 --- a/webui.sh +++ b/webui.sh @@ -160,10 +160,10 @@ then printf "\n%s\n" "${delimiter}" printf "Accelerating launch.py..." printf "\n%s\n" "${delimiter}" - accelerate launch --num_cpu_threads_per_process=6 "${LAUNCH_SCRIPT}" "$@" + exec accelerate launch --num_cpu_threads_per_process=6 "${LAUNCH_SCRIPT}" "$@" else printf "\n%s\n" "${delimiter}" printf "Launching launch.py..." printf "\n%s\n" "${delimiter}" - "${python_cmd}" "${LAUNCH_SCRIPT}" "$@" + exec "${python_cmd}" "${LAUNCH_SCRIPT}" "$@" fi -- cgit v1.2.3 From cbf4b3472b1da35937ff12c06072214a2e5cbad7 Mon Sep 17 00:00:00 2001 From: DaniAndTheWeb <57776841+DaniAndTheWeb@users.noreply.github.com> Date: Fri, 13 Jan 2023 19:18:56 +0100 Subject: Automatic launch argument for AMD GPUs This commit adds a few lines to detect if the system has an AMD gpu and adds an environment variable needed for torch to recognize the gpu. --- webui.sh | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'webui.sh') diff --git a/webui.sh b/webui.sh index c4d6521d..23629ef9 100755 --- a/webui.sh +++ b/webui.sh @@ -165,5 +165,11 @@ else printf "\n%s\n" "${delimiter}" printf "Launching launch.py..." printf "\n%s\n" "${delimiter}" - exec "${python_cmd}" "${LAUNCH_SCRIPT}" "$@" + gpu_info=$(lspci | grep VGA) + if echo "$gpu_info" | grep -q "AMD" + then + HSA_OVERRIDE_GFX_VERSION=10.3.0 exec "${python_cmd}" "${LAUNCH_SCRIPT}" "$@" + else + exec "${python_cmd}" "${LAUNCH_SCRIPT}" "$@" + fi fi -- cgit v1.2.3 From 6192a222bf7131771a2cd7655a64a5b24a1e6e2e Mon Sep 17 00:00:00 2001 From: DaniAndTheWeb <57776841+DaniAndTheWeb@users.noreply.github.com> Date: Sat, 14 Jan 2023 15:46:23 +0100 Subject: Export TORCH_COMMAND for AMD from the webui --- webui.sh | 1 + 1 file changed, 1 insertion(+) (limited to 'webui.sh') diff --git a/webui.sh b/webui.sh index 23629ef9..35f52f2a 100755 --- a/webui.sh +++ b/webui.sh @@ -168,6 +168,7 @@ else gpu_info=$(lspci | grep VGA) if echo "$gpu_info" | grep -q "AMD" then + export TORCH_COMMAND="pip install torch torchvision --extra-index-url https://download.pytorch.org/whl/rocm5.2" HSA_OVERRIDE_GFX_VERSION=10.3.0 exec "${python_cmd}" "${LAUNCH_SCRIPT}" "$@" else exec "${python_cmd}" "${LAUNCH_SCRIPT}" "$@" -- cgit v1.2.3 From c4ba34928ec7f977585494f0fa5925496c887698 Mon Sep 17 00:00:00 2001 From: DaniAndTheWeb <57776841+DaniAndTheWeb@users.noreply.github.com> Date: Sat, 14 Jan 2023 15:58:50 +0100 Subject: Quick format fix --- webui.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'webui.sh') diff --git a/webui.sh b/webui.sh index 35f52f2a..fcba6b7d 100755 --- a/webui.sh +++ b/webui.sh @@ -168,7 +168,7 @@ else gpu_info=$(lspci | grep VGA) if echo "$gpu_info" | grep -q "AMD" then - export TORCH_COMMAND="pip install torch torchvision --extra-index-url https://download.pytorch.org/whl/rocm5.2" + export TORCH_COMMAND="pip install torch torchvision --extra-index-url https://download.pytorch.org/whl/rocm5.2" HSA_OVERRIDE_GFX_VERSION=10.3.0 exec "${python_cmd}" "${LAUNCH_SCRIPT}" "$@" else exec "${python_cmd}" "${LAUNCH_SCRIPT}" "$@" -- cgit v1.2.3 From 2e172cf831a928223e93803b94896325bd4c22a7 Mon Sep 17 00:00:00 2001 From: DaniAndTheWeb <57776841+DaniAndTheWeb@users.noreply.github.com> Date: Sat, 14 Jan 2023 22:25:32 +0100 Subject: Only set TORCH_COMMAND if wasn't set webui-user --- webui.sh | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'webui.sh') diff --git a/webui.sh b/webui.sh index fcba6b7d..35542ed6 100755 --- a/webui.sh +++ b/webui.sh @@ -168,7 +168,10 @@ else gpu_info=$(lspci | grep VGA) if echo "$gpu_info" | grep -q "AMD" then - export TORCH_COMMAND="pip install torch torchvision --extra-index-url https://download.pytorch.org/whl/rocm5.2" + if [ -z ${TORCH_COMMAND+x} ] + then + export TORCH_COMMAND="pip install torch torchvision --extra-index-url https://download.pytorch.org/whl/rocm5.2" + fi HSA_OVERRIDE_GFX_VERSION=10.3.0 exec "${python_cmd}" "${LAUNCH_SCRIPT}" "$@" else exec "${python_cmd}" "${LAUNCH_SCRIPT}" "$@" -- cgit v1.2.3 From ba077e2110cab891a46d14665fb161ce0669f31e Mon Sep 17 00:00:00 2001 From: DaniAndTheWeb <57776841+DaniAndTheWeb@users.noreply.github.com> Date: Sat, 14 Jan 2023 23:19:52 +0100 Subject: Fix TORCH_COMMAND check --- webui.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'webui.sh') diff --git a/webui.sh b/webui.sh index 35542ed6..6e07778f 100755 --- a/webui.sh +++ b/webui.sh @@ -168,7 +168,7 @@ else gpu_info=$(lspci | grep VGA) if echo "$gpu_info" | grep -q "AMD" then - if [ -z ${TORCH_COMMAND+x} ] + if [[ -z "${TORCH_COMMAND}" ]] then export TORCH_COMMAND="pip install torch torchvision --extra-index-url https://download.pytorch.org/whl/rocm5.2" fi -- cgit v1.2.3 From 956263b8a4f0393dcb47ed497f367717add4f0e9 Mon Sep 17 00:00:00 2001 From: facu Date: Wed, 18 Jan 2023 19:15:53 -0300 Subject: fixing error using lspci on macOsX --- webui.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'webui.sh') diff --git a/webui.sh b/webui.sh index 6e07778f..1edf921d 100755 --- a/webui.sh +++ b/webui.sh @@ -165,7 +165,7 @@ else printf "\n%s\n" "${delimiter}" printf "Launching launch.py..." printf "\n%s\n" "${delimiter}" - gpu_info=$(lspci | grep VGA) + gpu_info=$(lspci 2>/dev/null | grep VGA) if echo "$gpu_info" | grep -q "AMD" then if [[ -z "${TORCH_COMMAND}" ]] -- cgit v1.2.3 From 4599e8ad0acaae3f13bd3a7bef4db7632aac8504 Mon Sep 17 00:00:00 2001 From: DaniAndTheWeb <57776841+DaniAndTheWeb@users.noreply.github.com> Date: Thu, 19 Jan 2023 17:00:51 +0100 Subject: Environment variable on launch just for Navi cards Setting HSA_OVERRIDE_GFX_VERSION=10.3.0 for all AMD cards seems to break compatibility for polaris and vega cards so it should just be enabled on Navi --- webui.sh | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'webui.sh') diff --git a/webui.sh b/webui.sh index 1edf921d..a35a5f35 100755 --- a/webui.sh +++ b/webui.sh @@ -172,7 +172,12 @@ else then export TORCH_COMMAND="pip install torch torchvision --extra-index-url https://download.pytorch.org/whl/rocm5.2" fi - HSA_OVERRIDE_GFX_VERSION=10.3.0 exec "${python_cmd}" "${LAUNCH_SCRIPT}" "$@" + if echo "$gpu_info" | grep -q "Navi" + then + HSA_OVERRIDE_GFX_VERSION=10.3.0 exec "${python_cmd}" "${LAUNCH_SCRIPT}" "$@" + else + exec "${python_cmd}" "${LAUNCH_SCRIPT}" "$@" + fi else exec "${python_cmd}" "${LAUNCH_SCRIPT}" "$@" fi -- cgit v1.2.3 From c09fb3d8f1f71bc66d7c4cea603885619d6a1cd4 Mon Sep 17 00:00:00 2001 From: DaniAndTheWeb <57776841+DaniAndTheWeb@users.noreply.github.com> Date: Thu, 19 Jan 2023 19:21:02 +0100 Subject: Simplify GPU check --- webui.sh | 25 ++++++++++--------------- 1 file changed, 10 insertions(+), 15 deletions(-) (limited to 'webui.sh') diff --git a/webui.sh b/webui.sh index a35a5f35..aa4f875c 100755 --- a/webui.sh +++ b/webui.sh @@ -104,6 +104,12 @@ then fi # Check prerequisites +gpu_info=$(lspci 2>/dev/null | grep VGA) +if echo "$gpu_info" | grep -q "Navi" +then + export HSA_OVERRIDE_GFX_VERSION=10.3.0 +fi + for preq in "${GIT}" "${python_cmd}" do if ! hash "${preq}" &>/dev/null @@ -165,20 +171,9 @@ else printf "\n%s\n" "${delimiter}" printf "Launching launch.py..." printf "\n%s\n" "${delimiter}" - gpu_info=$(lspci 2>/dev/null | grep VGA) - if echo "$gpu_info" | grep -q "AMD" + if echo "$gpu_info" | grep -q "AMD" && [[ -z "${TORCH_COMMAND}" ]] then - if [[ -z "${TORCH_COMMAND}" ]] - then - export TORCH_COMMAND="pip install torch torchvision --extra-index-url https://download.pytorch.org/whl/rocm5.2" - fi - if echo "$gpu_info" | grep -q "Navi" - then - HSA_OVERRIDE_GFX_VERSION=10.3.0 exec "${python_cmd}" "${LAUNCH_SCRIPT}" "$@" - else - exec "${python_cmd}" "${LAUNCH_SCRIPT}" "$@" - fi - else - exec "${python_cmd}" "${LAUNCH_SCRIPT}" "$@" - fi + export TORCH_COMMAND="pip install torch torchvision --extra-index-url https://download.pytorch.org/whl/rocm5.2" + fi + exec "${python_cmd}" "${LAUNCH_SCRIPT}" "$@" fi -- cgit v1.2.3 From 48045545d9a3f174621a62086812d9bbfb3ce1c2 Mon Sep 17 00:00:00 2001 From: DaniAndTheWeb <57776841+DaniAndTheWeb@users.noreply.github.com> Date: Thu, 19 Jan 2023 19:23:40 +0100 Subject: Small reformat of the GPU check --- webui.sh | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'webui.sh') diff --git a/webui.sh b/webui.sh index aa4f875c..ff410e15 100755 --- a/webui.sh +++ b/webui.sh @@ -109,6 +109,10 @@ if echo "$gpu_info" | grep -q "Navi" then export HSA_OVERRIDE_GFX_VERSION=10.3.0 fi +if echo "$gpu_info" | grep -q "AMD" && [[ -z "${TORCH_COMMAND}" ]] +then + export TORCH_COMMAND="pip install torch torchvision --extra-index-url https://download.pytorch.org/whl/rocm5.2" +fi for preq in "${GIT}" "${python_cmd}" do @@ -170,10 +174,6 @@ then else printf "\n%s\n" "${delimiter}" printf "Launching launch.py..." - printf "\n%s\n" "${delimiter}" - if echo "$gpu_info" | grep -q "AMD" && [[ -z "${TORCH_COMMAND}" ]] - then - export TORCH_COMMAND="pip install torch torchvision --extra-index-url https://download.pytorch.org/whl/rocm5.2" - fi + printf "\n%s\n" "${delimiter}" exec "${python_cmd}" "${LAUNCH_SCRIPT}" "$@" fi -- cgit v1.2.3 From 36364bd76c4634820e08070a287f0a5ad27c35f6 Mon Sep 17 00:00:00 2001 From: DaniAndTheWeb <57776841+DaniAndTheWeb@users.noreply.github.com> Date: Thu, 19 Jan 2023 20:05:49 +0100 Subject: GFX env just for RDNA 1 and 2 This commit specifies which GPUs should use the GFX variable, RDNA 3 is excluded since it uses a newer GFX version --- webui.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'webui.sh') diff --git a/webui.sh b/webui.sh index ff410e15..91c95e47 100755 --- a/webui.sh +++ b/webui.sh @@ -105,7 +105,7 @@ fi # Check prerequisites gpu_info=$(lspci 2>/dev/null | grep VGA) -if echo "$gpu_info" | grep -q "Navi" +if echo "$gpu_info" | grep -qE "Navi (1|2)" then export HSA_OVERRIDE_GFX_VERSION=10.3.0 fi -- cgit v1.2.3 From 912285ae64e4e1186feb54caf82b4a0b11c6cb7f Mon Sep 17 00:00:00 2001 From: DaniAndTheWeb <57776841+DaniAndTheWeb@users.noreply.github.com> Date: Thu, 19 Jan 2023 23:42:12 +0100 Subject: Experimental support for Renoir This adds the GFX version 9.0.0 in order to use Renoir GPUs with at least 4 GB of VRAM (it's possible to increase the virtual VRAM from the BIOS settings of some vendors). This will only work if the remaining ram is at least 12 GB to avoid the system to become unresponsive on launch.). This change also changes the GPU check to a case statement to be able to add more GPUs efficiently. --- webui.sh | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'webui.sh') diff --git a/webui.sh b/webui.sh index 91c95e47..27933c04 100755 --- a/webui.sh +++ b/webui.sh @@ -105,10 +105,14 @@ fi # Check prerequisites gpu_info=$(lspci 2>/dev/null | grep VGA) -if echo "$gpu_info" | grep -qE "Navi (1|2)" -then - export HSA_OVERRIDE_GFX_VERSION=10.3.0 -fi +case "$gpu_info" in + *"Navi 1"*|*"Navi 2"*) export HSA_OVERRIDE_GFX_VERSION=10.3.0 + ;; + *"Renoir"*) export HSA_OVERRIDE_GFX_VERSION=9.0.0 + ;; + *) + ;; +esac if echo "$gpu_info" | grep -q "AMD" && [[ -z "${TORCH_COMMAND}" ]] then export TORCH_COMMAND="pip install torch torchvision --extra-index-url https://download.pytorch.org/whl/rocm5.2" -- cgit v1.2.3 From 0684a6819dfaec40732271ca5ef32392c36f17ba Mon Sep 17 00:00:00 2001 From: DaniAndTheWeb <57776841+DaniAndTheWeb@users.noreply.github.com> Date: Fri, 20 Jan 2023 00:21:05 +0100 Subject: Usage explanation for Renoir users --- webui.sh | 3 +++ 1 file changed, 3 insertions(+) (limited to 'webui.sh') diff --git a/webui.sh b/webui.sh index 27933c04..4da51880 100755 --- a/webui.sh +++ b/webui.sh @@ -109,6 +109,9 @@ case "$gpu_info" in *"Navi 1"*|*"Navi 2"*) export HSA_OVERRIDE_GFX_VERSION=10.3.0 ;; *"Renoir"*) export HSA_OVERRIDE_GFX_VERSION=9.0.0 + printf "\n%s\n" "${delimiter}" + printf "Make sure to have at least 4GB of VRAM and 10GB of RAM or enable cpu mode: --use-cpu all --no-half" + printf "\n%s\n" "${delimiter}" ;; *) ;; -- cgit v1.2.3 From fd651bd0bcceb4c746c86b202702bca029cbd6db Mon Sep 17 00:00:00 2001 From: DaniAndTheWeb <57776841+DaniAndTheWeb@users.noreply.github.com> Date: Fri, 20 Jan 2023 00:21:51 +0100 Subject: Update webui.sh --- webui.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'webui.sh') diff --git a/webui.sh b/webui.sh index 4da51880..d5e7b3c5 100755 --- a/webui.sh +++ b/webui.sh @@ -110,8 +110,8 @@ case "$gpu_info" in ;; *"Renoir"*) export HSA_OVERRIDE_GFX_VERSION=9.0.0 printf "\n%s\n" "${delimiter}" - printf "Make sure to have at least 4GB of VRAM and 10GB of RAM or enable cpu mode: --use-cpu all --no-half" - printf "\n%s\n" "${delimiter}" + printf "Make sure to have at least 4GB of VRAM and 10GB of RAM or enable cpu mode: --use-cpu all --no-half" + printf "\n%s\n" "${delimiter}" ;; *) ;; -- cgit v1.2.3 From e0b6092bc99efe311261a51289dec67cbf4845bc Mon Sep 17 00:00:00 2001 From: DaniAndTheWeb <57776841+DaniAndTheWeb@users.noreply.github.com> Date: Fri, 20 Jan 2023 15:31:27 +0100 Subject: Update webui.sh --- webui.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'webui.sh') diff --git a/webui.sh b/webui.sh index d5e7b3c5..8cdad22d 100755 --- a/webui.sh +++ b/webui.sh @@ -110,7 +110,7 @@ case "$gpu_info" in ;; *"Renoir"*) export HSA_OVERRIDE_GFX_VERSION=9.0.0 printf "\n%s\n" "${delimiter}" - printf "Make sure to have at least 4GB of VRAM and 10GB of RAM or enable cpu mode: --use-cpu all --no-half" + printf "Experimental support for Renoir: make sure to have at least 4GB of VRAM and 10GB of RAM or enable cpu mode: --use-cpu all --no-half" printf "\n%s\n" "${delimiter}" ;; *) -- cgit v1.2.3