Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
51 changes: 2 additions & 49 deletions profiles/pci/graphic_drivers/profiles.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
# Or set of devices depending on the generation:
# device_name_pattern = '(AD)\w+'

[nvidia-open-dkms]
[nvidia]
desc = 'Open source NVIDIA drivers for Linux (Latest)'
class_ids = "0300 0302 0380"
vendor_ids = "10de"
Expand Down Expand Up @@ -98,10 +98,8 @@ post_remove = """
rm -f /usr/lib/systemd/user-environment-generators/20-nvidia-rtd3-workaround
"""

[nvidia-dkms-580xx]
[nvidia.580xx]
desc = 'Closed source NVIDIA drivers for Linux (580xx)'
class_ids = "0300 0302 0380"
vendor_ids = "10de"
priority = 12
packages = 'nvidia-580xx-dkms nvidia-580xx-utils nvidia-580xx-settings opencl-nvidia-580xx lib32-opencl-nvidia-580xx lib32-nvidia-580xx-utils libva-nvidia-driver vulkan-icd-loader lib32-vulkan-icd-loader'
device_ids = '>/var/lib/chwd/ids/nvidia-580.ids'
Expand All @@ -125,51 +123,6 @@ conditional_packages = """
echo "$packages"

"""
pre_install = """
cat <<EOF >/etc/mkinitcpio.conf.d/10-chwd.conf
# This file is automatically generated by chwd. PLEASE DO NOT EDIT IT.
MODULES+=(nvidia nvidia_modeset nvidia_uvm nvidia_drm)
EOF

# Remove kms hook from mkinitcpio.conf on desktops
device_type="$(cat /sys/devices/virtual/dmi/id/chassis_type)"
if ! ((device_type >= 8 && device_type <= 11)); then
cat <<'EOF' >/etc/mkinitcpio.conf.d/10-chwd-kms.conf
# This file is automatically generated by chwd. PLEASE DO NOT EDIT IT.
HOOKS=(${HOOKS[@]/kms/})
EOF
fi
"""
post_install = """
# Trying to determine the laptop
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
fi
"""
pre_remove = """
rm -f /etc/mkinitcpio.conf.d/10-chwd.conf
rm -f /etc/mkinitcpio.conf.d/10-chwd-kms.conf
"""
post_remove = """
rm -f /etc/profile.d/nvidia-rtd3-workaround.sh
rm -f /usr/lib/systemd/user-environment-generators/20-nvidia-rtd3-workaround
"""

[nvidia-dkms-470xx]
desc = 'Closed source NVIDIA drivers for Linux (470xx branch, only for Kepler GPUs)'
Expand Down
Loading