Unverified Commit 216f67ec authored by AUTOMATIC1111's avatar AUTOMATIC1111 Committed by GitHub
Browse files

Merge pull request #6938 from DaniAndTheWeb/AMD_automation-patch1

AMD environment variable and experimental APU support (Renoir)
parents abf11215 e0b6092b
Loading
Loading
Loading
Loading
+19 −12
Original line number Original line Diff line number Diff line
@@ -104,6 +104,23 @@ then
fi
fi


# Check prerequisites
# Check prerequisites
gpu_info=$(lspci 2>/dev/null | grep VGA)
case "$gpu_info" in
    *"Navi 1"*|*"Navi 2"*) export HSA_OVERRIDE_GFX_VERSION=10.3.0
    ;;
    *"Renoir"*) export HSA_OVERRIDE_GFX_VERSION=9.0.0
        printf "\n%s\n" "${delimiter}"
        printf "Experimental support for Renoir: make sure to have at least 4GB of VRAM and 10GB of RAM or enable cpu mode: --use-cpu all --no-half"
        printf "\n%s\n" "${delimiter}"
    ;;
    *) 
    ;;
esac
if echo "$gpu_info" | grep -q "AMD" && [[ -z "${TORCH_COMMAND}" ]]
then
    export TORCH_COMMAND="pip install torch torchvision --extra-index-url https://download.pytorch.org/whl/rocm5.2"
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,15 +182,5 @@ 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"
    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}" "$@"
    exec "${python_cmd}" "${LAUNCH_SCRIPT}" "$@"
fi
fi
fi