Skip to content

Instantly share code, notes, and snippets.

@lhotari
Created October 25, 2019 03:26
  • Star 3 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save lhotari/c2abef51a3a899de5520df9eadb41567 to your computer and use it in GitHub Desktop.
Ubuntu 18.04 Linux kernel settings for Dell Latitude 7480
#!/bin/bash
sudo apt-get update
sudo apt-get install --install-recommends linux-generic-hwe-18.04 xserver-xorg-hwe-18.04
sudo mkdir /etc/default/grub.d
# adjust i915 related kernel parameters
# references for different settings:
# intel_iommu=igfx_off - https://bugs.archlinux.org/task/55629
# intel_idle.max_cstate=4
# i915.enable_rc6=0 setting no more exists in 5.x kernel and the workaround stopped working (https://bugs.freedesktop.org/show_bug.cgi?id=105962),
# the workaround is intel_idle.max_cstate=4, https://bugs.freedesktop.org/show_bug.cgi?id=103229#c20
# i915.enable_psr=0 - https://hobo.house/2018/05/18/fix-for-intel-i915-gpu-freeze-on-recent-linux-kernels/
# i915.enable_fbc=0 - https://wiki.archlinux.org/index.php/intel_graphics#Framebuffer_compression_.28enable_fbc.29
# i915.enable_guc=2 - https://wiki.archlinux.org/index.php/intel_graphics#Enable_GuC_/_HuC_firmware_loading
echo 'GRUB_CMDLINE_LINUX="$GRUB_CMDLINE_LINUX intel_iommu=igfx_off intel_idle.max_cstate=4 i915.enable_psr=0 i915.disable_power_well=1 i915.enable_fbc=0 i915.enable_guc=2"' | sudo tee /etc/default/grub.d/i915.cfg
# pass "Linux" in acpi_osi parameter (For some HW a value like "Windows 2012" might be more appropriate, ref http://iam.tj/prototype/enhancements/Windows-acpi_osi.html)
echo 'GRUB_CMDLINE_LINUX="$GRUB_CMDLINE_LINUX acpi_osi=Linux"' | sudo tee /etc/default/grub.d/acpi.cfg
# disable unnecessary memory optimization in Linux for desktop usage, save some CPU cycles since khugepaged won't need to run
echo 'GRUB_CMDLINE_LINUX="$GRUB_CMDLINE_LINUX transparent_hugepage=never"' | sudo tee /etc/default/grub.d/thp_disable.cfg
# adjust cgroup settings for docker
echo 'GRUB_CMDLINE_LINUX="$GRUB_CMDLINE_LINUX cgroup_enable=memory swapaccount=1"' | sudo tee /etc/default/grub.d/cgroup.cfg
sudo update-grub
@antonio-petricca
Copy link

Hi, do you have some recommendation for Latitude E5495 (which does not boot with kernel since 5.18)?

Thank you so much in advance!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment