Skip to content

Instantly share code, notes, and snippets.

@rrbutani
Last active February 9, 2020 09:14
Show Gist options
  • Save rrbutani/c6fa0e0480756b9792a53666ae02e395 to your computer and use it in GitHub Desktop.
Save rrbutani/c6fa0e0480756b9792a53666ae02e395 to your computer and use it in GitHub Desktop.
nvidia-390 w/5.3.0-28 on hera on an xps 9560

since i don't have a blog, i'm going to dump here:

  • /lib/modules/<kernel version>/updates/dkms isn't what dkms uses anymore for, at least for ubuntu provided HWE and other patched kernels; instead it's /lib/modules/<kernel version>/extras so make your symlinks so that X and bumblebee and friends don't flip out
  • you can use the graphics ppa (ppa:graphics-drivers/ppa or just the stock ubuntu contrib/non-free bionic ppas)
  • install: bbswitch-dkms prime-select acpi-call-dkms nvidia-390 bumblebee bumblebee-nvidia (if you don't install this one you'll suffer like me) and (crucially!) your linux kernel's headers! (i.e.: linux-headers-generic-hwe-18.04-edge or linux-headers-5.3.0-26-generic) (note: install your headers before you install the other things or if you don't go run dkms manually)
  • nvidia drivers are no longer symlinked to /usr/lib/nvidia-current so change /etc/bumblebee/xorg.conf.nvidia and /etc/bumbleebee/bumblee.conf's contents to match (this has details)
  • kill the lines that alias nvidia modules to off in /lib/modprobe.d/blacklist-nvidia.conf (this doesn't seem to persist but it's unclear if that's a problem — if it is, modify the prime-select python script; details here)
    • update! you do need to patch prime-select (located in /usr/bin/prime-select on my machine)
    • I added a patch file to this gist; you can run sudo patch "$(which prime-select)" < </path/to/patchfile> and it should work, maybe
  • and also probably more steps that i forgot I even did (40% sure this was all the changes that i actually didn't end up undoing)

xps9560 specific:

  • you need these params in yer kernel cmdline (give em to grub, put them in /etc/default/grub):
    • apci_rev_override=1
    • these are for i915 (intel):
      • enable_fbc=1 (probably not actually needed 4.12+)
      • enable_psr=1
      • disable_power_well=0
    • pci=noaer
    • pci_aspm=force
    • rcutree.rcu_idle_gp_delay=2 (helps prevent "GPU has fallen off the bus errors")
    • nouveau.modeset=0 for reasons I don't understand this is needed (even though nouveau is 100% blacklisted by bumblebee and friends)
    • nmi_watchdog=0 (I no longer remember what this is for but it's not graphics related)

linux kernel version notes:

  • i'm using the 18.04 HWE kernel (5.3.0-26 as of this writing). Currently nvidia-440 (440.59) does not support this kernel!! But: nvidia-390 (390.132 though reportedly 390.116+ work) does support this kernel. This is ridiculous and dumb.
  • As of this writing 5.4/5.5 are just not supported by nvidia.

some debugging steps for when things inevitably go wrong: syslog is useful but noisy; i found running bumblebeed with -vv in a tmux pane and running optirun commands in another while in recovery mode to be the quickest way to understand what bumblebee and X were actually mad about

✌️

159,161c159,161
< alias nvidia off
< alias nvidia-drm off
< alias nvidia-modeset off'''
---
> #alias nvidia off
> #alias nvidia-drm off
> #alias nvidia-modeset off'''
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment