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.
This commit is contained in:
DaniAndTheWeb 2023-01-13 19:18:56 +01:00 committed by GitHub
parent 82725f0ac4
commit cbf4b3472b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -165,5 +165,11 @@ else
printf "\n%s\n" "${delimiter}"
printf "Launching launch.py..."
printf "\n%s\n" "${delimiter}"
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