2023-03-03 16:27:01 +01:00
|
|
|
#! /bin/bash
|
|
|
|
|
|
|
|
# Check system for NVIDIA card and set vaapi env vars
|
|
|
|
|
2023-10-12 18:48:20 +02:00
|
|
|
nvkernmod=$(lspci -nnkk | grep -A3 '\[03' | grep 'Kernel modules:' | grep -i nvidia)
|
2023-03-03 16:27:01 +01:00
|
|
|
|
|
|
|
if [[ ! -z $nvkernmod ]]
|
|
|
|
then
|
2023-09-30 09:55:03 +02:00
|
|
|
if switcherooctl list | awk 'ORS = $1 ~/Name/ ? " " : "\n"' | grep Default | grep yes | grep -E -i 'intel|amd|radeon|advanced' > /dev/null 2>&1
|
|
|
|
then
|
|
|
|
export MOZ_DISABLE_RDD_SANDBOX=1
|
|
|
|
export NVD_BACKEND=direct
|
|
|
|
export EGL_PLATFORM=$XDG_SESSION_TYPE
|
|
|
|
else
|
|
|
|
export LIBVA_DRIVER_NAME=nvidia
|
|
|
|
export MOZ_DISABLE_RDD_SANDBOX=1
|
|
|
|
export NVD_BACKEND=direct
|
|
|
|
export EGL_PLATFORM=$XDG_SESSION_TYPE
|
|
|
|
fi
|
2023-03-03 16:27:01 +01:00
|
|
|
fi
|
|
|
|
|