diff --git a/data_from_portwine/scripts/functions_helper b/data_from_portwine/scripts/functions_helper index e4cb5d83..2237c7b4 100755 --- a/data_from_portwine/scripts/functions_helper +++ b/data_from_portwine/scripts/functions_helper @@ -791,8 +791,9 @@ pw_check_and_download_plugins () { return 0 } +lspci_output=$(lspci | grep VGA) + nvidia_check_rtx () { - lspci_output=$(lspci | grep VGA) if echo "$lspci_output" | grep -i "nvidia" ; then # Turing (without nvidia 16XX) nv_arch=$(echo "$lspci_output" | sed -rn 's/.*(TU[0-9]*).*/\1/p') @@ -807,6 +808,14 @@ nvidia_check_rtx () { return 1 } +# Hybrid graphics (Intel + NVIDIA) +if echo "$lspci_output" | grep -i "intel" && echo "$lspci_output" | grep -i "nvidia"; then + export PW_PRIME_RENDER_OFFLOAD=1 +# Hybrid graphics (AMD + NVIDIA) +elif echo "$lspci_output" | grep -i "amd" && echo "$lspci_output" | grep -i "nvidia"; then + export PW_PRIME_RENDER_OFFLOAD=1 +fi + pw_init_db () { if [[ ! -z "${portwine_exe}" ]] ; then try_remove_file "${PORT_SCRIPTS_PATH}/portwine_db/setup" diff --git a/data_from_portwine/scripts/runlib b/data_from_portwine/scripts/runlib index 437867f1..81f15b97 100755 --- a/data_from_portwine/scripts/runlib +++ b/data_from_portwine/scripts/runlib @@ -171,6 +171,7 @@ start_portwine () { if [[ "${PW_PRIME_RENDER_OFFLOAD}" == 1 ]] ; then export __NV_PRIME_RENDER_OFFLOAD=1 + export __VK_LAYER_NV_optimus=NVIDIA_only export __GLX_VENDOR_LIBRARY_NAME=nvidia fi