Skip to content

Commit

Permalink
Simplify GPU check
Browse files Browse the repository at this point in the history
  • Loading branch information
daniandtheweb authored Jan 19, 2023
1 parent 4599e8a commit c09fb3d
Showing 1 changed file with 10 additions and 15 deletions.
25 changes: 10 additions & 15 deletions webui.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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

0 comments on commit c09fb3d

Please sign in to comment.