aboutsummaryrefslogtreecommitdiffstats
path: root/webui.sh
diff options
context:
space:
mode:
authorDaniAndTheWeb <57776841+DaniAndTheWeb@users.noreply.github.com>2023-01-19 18:21:02 +0000
committerGitHub <noreply@github.com>2023-01-19 18:21:02 +0000
commitc09fb3d8f1f71bc66d7c4cea603885619d6a1cd4 (patch)
tree77a1a3d7f2b58f141ead8b1e7cfab4fd6642abce /webui.sh
parent4599e8ad0acaae3f13bd3a7bef4db7632aac8504 (diff)
downloadstable-diffusion-webui-gfx803-c09fb3d8f1f71bc66d7c4cea603885619d6a1cd4.tar.gz
stable-diffusion-webui-gfx803-c09fb3d8f1f71bc66d7c4cea603885619d6a1cd4.tar.bz2
stable-diffusion-webui-gfx803-c09fb3d8f1f71bc66d7c4cea603885619d6a1cd4.zip
Simplify GPU check
Diffstat (limited to 'webui.sh')
-rwxr-xr-xwebui.sh25
1 files changed, 10 insertions, 15 deletions
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