Merge pull request #6709 from DaniAndTheWeb/master

Automatic setup for AMD GPUs on Linux
This commit is contained in:
AUTOMATIC1111 2023-01-15 13:48:25 +03:00 committed by GitHub
commit ebfdd7baeb
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -165,5 +165,15 @@ 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
if [[ -z "${TORCH_COMMAND}" ]]
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}" "$@"
fi
fi