Skip to content

Commit

Permalink
profiles/graphic_drivers: Return workaround for RTD3 (#149)
Browse files Browse the repository at this point in the history
Signed-off-by: Vasiliy Stelmachenok <[email protected]>
  • Loading branch information
ventureoo authored Jan 9, 2025
1 parent 403d0bb commit 86b6f79
Showing 1 changed file with 37 additions and 0 deletions.
37 changes: 37 additions & 0 deletions profiles/pci/graphic_drivers/profiles.toml
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,24 @@ post_install = """
if ! lspci -d "10de:*:030x" -vm | grep -q 'Device:\\tTU.*'; then
systemctl enable nvidia-powerd
fi
systemctl enable switcheroo-control
cat << 'EOF' >/etc/profile.d/nvidia-rtd3-workaround.sh
# This file is automatically generated by chwd. PLEASE DO NOT EDIT IT.
if [ -n "$(lspci -d "10de:*:0302")" ]; then
export __EGL_VENDOR_LIBRARY_FILENAMES=/usr/share/glvnd/egl_vendor.d/50_mesa.json
fi
EOF
cat << 'EOF' | install -Dm755 /dev/stdin /usr/lib/systemd/user-environment-generators/20-nvidia-rtd3-workaround
#!/usr/bin/env sh
# This file is automatically generated by chwd. PLEASE DO NOT EDIT IT.
if [ -n "$(lspci -d "10de:*:0302")" ]; then
echo "__EGL_VENDOR_LIBRARY_FILENAMES=/usr/share/glvnd/egl_vendor.d/50_mesa.json"
fi
EOF
else
# Add libva-nvidia-driver to profile
echo "export LIBVA_DRIVER_NAME=nvidia" > /etc/profile.d/nvidia-vaapi.sh
Expand All @@ -72,6 +89,8 @@ pre_remove = """
"""
post_remove = """
rm -f /etc/profile.d/nvidia-vaapi.sh
rm -f /etc/profile.d/nvidia-rtd3-workaround.sh
rm -f /usr/lib/systemd/user-environment-generators/20-nvidia-rtd3-workaround
"""

[nvidia-dkms]
Expand Down Expand Up @@ -117,6 +136,22 @@ post_install = """
device_type="$(cat /sys/devices/virtual/dmi/id/chassis_type)"
if ((device_type >= 8 && device_type <= 11)); then
systemctl enable switcheroo-control
cat << 'EOF' >/etc/profile.d/nvidia-rtd3-workaround.sh
# This file is automatically generated by chwd. PLEASE DO NOT EDIT IT.
if [ -n "$(lspci -d "10de:*:0302")" ]; then
export __EGL_VENDOR_LIBRARY_FILENAMES=/usr/share/glvnd/egl_vendor.d/50_mesa.json
fi
EOF
cat << 'EOF' | install -Dm755 /dev/stdin /usr/lib/systemd/user-environment-generators/20-nvidia-rtd3-workaround
#!/usr/bin/env sh
# This file is automatically generated by chwd. PLEASE DO NOT EDIT IT.
if [ -n "$(lspci -d "10de:*:0302")" ]; then
echo "__EGL_VENDOR_LIBRARY_FILENAMES=/usr/share/glvnd/egl_vendor.d/50_mesa.json"
fi
EOF
else
# Add libva-nvidia-driver to profile
echo "export LIBVA_DRIVER_NAME=nvidia" > /etc/profile.d/nvidia-vaapi.sh
Expand All @@ -127,6 +162,8 @@ pre_remove = """
"""
post_remove = """
rm -f /etc/profile.d/nvidia-vaapi.sh
rm -f /etc/profile.d/nvidia-rtd3-workaround.sh
rm -f /usr/lib/systemd/user-environment-generators/20-nvidia-rtd3-workaround
"""

[nvidia-dkms-470xx]
Expand Down

0 comments on commit 86b6f79

Please sign in to comment.