Unverified Commit c09fb3d8 authored by DaniAndTheWeb's avatar DaniAndTheWeb Committed by GitHub

Simplify GPU check

parent 4599e8ad
...@@ -104,6 +104,12 @@ then ...@@ -104,6 +104,12 @@ then
fi fi
# Check prerequisites # 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}" for preq in "${GIT}" "${python_cmd}"
do do
if ! hash "${preq}" &>/dev/null if ! hash "${preq}" &>/dev/null
...@@ -165,20 +171,9 @@ else ...@@ -165,20 +171,9 @@ else
printf "\n%s\n" "${delimiter}" printf "\n%s\n" "${delimiter}"
printf "Launching launch.py..." printf "Launching launch.py..."
printf "\n%s\n" "${delimiter}" printf "\n%s\n" "${delimiter}"
gpu_info=$(lspci 2>/dev/null | grep VGA) if echo "$gpu_info" | grep -q "AMD" && [[ -z "${TORCH_COMMAND}" ]]
if echo "$gpu_info" | grep -q "AMD"
then then
if [[ -z "${TORCH_COMMAND}" ]] export TORCH_COMMAND="pip install torch torchvision --extra-index-url https://download.pytorch.org/whl/rocm5.2"
then fi
export TORCH_COMMAND="pip install torch torchvision --extra-index-url https://download.pytorch.org/whl/rocm5.2" exec "${python_cmd}" "${LAUNCH_SCRIPT}" "$@"
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
fi fi
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment