Update PRIME Render Offload

Added Finer-Grained Control of PRIME Render Offload on Vulkan applications
Added automatic activation of PRIME Render Offload when hybrid graphics are detected
This commit is contained in:
Boria138 2023-09-01 13:08:49 +06:00
parent 0e82a32ef4
commit 42b5885ba2
2 changed files with 11 additions and 1 deletions

@ -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"

@ -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