Skip to content

Instantly share code, notes, and snippets.

@spenserlee
Last active August 21, 2020 00:26
Show Gist options
  • Star 5 You must be signed in to star a gist
  • Fork 3 You must be signed in to fork a gist
  • Save spenserlee/9dae818a99b57d2f19ba3200f7672f41 to your computer and use it in GitHub Desktop.
Save spenserlee/9dae818a99b57d2f19ba3200f7672f41 to your computer and use it in GitHub Desktop.
Personal notes for dual booting Windows and Linux on XPS 15 9560

Installing Ubuntu GNOME 17.04 on XPS 15 9560

This document is to serve as a set of notes for myself and can be used as a guide for others looking to set up Ubuntu on their XPS 15. For me this was a dual-boot setup with Windows 10. On Linux I don't have a need for the discrete graphics card, so the main focus is to maximize battery life for development.

I had initially tried to dual boot with Fedora 25, but ran into a lot of issues trying to disable the discrete graphics card, resulting in poor battery life. Instead of starting over with Fedora again, I decided to try with Ubuntu, since there seemed to be a few more resources available.

My XPS Configuration is: i7, 16GB RAM, 512GB SSD, 4K Screen.

Setup

BIOS

  • Reboot and press F2 on Dell logo screen until "Preparing to enter setup" appears to get into BIOS
  • Under "System Configuration > SATA Operation" switch from RAID to AHCI
  • Optionally disable Touchscreen under "System Configuration > Touchscreen" to improve battery life
  • Many sources said to disable Secure Boot, but when I initially installed Fedora it wasn't required
    • After reading more about this, to install 3rd party drivers this was required, so I did disable Secure Boot in the end

Windows

Installing Linux

  • ISO from: https://wiki.ubuntu.com/UbuntuGNOME/GetUbuntuGNOME
  • Created bootable USB via Rufus: https://www.ubuntu.com/download/desktop/create-a-usb-stick-on-windows
  • Insert USB and reboot
  • Press F12 until "One time boot menu" appears to choose USB as boot device
  • On GRUB menu, choose Install Ubuntu GNOME
    • These are the settings I used for "something else":
      • leave device for boot loader installation as default
      • swap space set to 10GB
      • / set to 25 GB
      • /home uses the rest (leave size blank)
  • Interesting note that Fedora 25 scaled nicely for installation process, while Ubuntu GNOME was not scaled
  • Didn't connect to internet during installation and didn't choose to install 3rd party software at this point

Setting up Linux

Scaling Issues

  • Potential fix for login screen scaling: https://askubuntu.com/a/912789
    • Did not work for me, still unresolved
  • Desktop did scale on initial login, though some issues with cursor becoming small when hovering over menu bar
    • Still unresolved, not a big issue
  • TTY is very small text
    • Tried to resolve by editing /etc/default/grub and set GRUB_GFXPAYLOAD_LINUX=1600x1200
      • On restart it appears to be working, but after login screen loads, TTY still set to 3840x2160 (still unresolved)
  • GRUB boot up menu scaling can be fixed in a couple ways:
    • Via grub-customizer and setting a lower resolution: https://launchpad.net/~danielrichter2007/+archive/ubuntu/grub-customizer
      • Or just edit /etc/default/grub and set GRUB_GFXMODE= to desired resolution
      • In GRUB, navigate to console (usually by pressing 'c') and run videoinfo to get your machines supported resolutions for GRUB
      • XPS 15 4K supports: 3840x2160, 1920x1440, 1600x1200, 1024x768, 800x600, 640x480
    • Via setting a custom font with a larger font size via grub-mkfont: https://unix.stackexchange.com/a/31752/139951
      • This solution did not work when I tried under Fedora 25, but did under Ubuntu GNOME 17.04
      • Minor, but noticeable lag in boot selection (i.e. up/down arrow) with this method

Power Management

TLDR: sudo apt install tlp tlp-rdw


  • Install powertop and powerstat to get monitor power usage:
    • powerstat grabs samples of power usage and prints an average
    • powertop reports what is using power

Power consumption testing done with the following conditions:

  • Bluetooth disabled
  • Location disabled
  • Connected to WiFi
  • Brightness set to 40% (8 steps up from 0 using keyboard button)
  • Only application running is a single terminal running powerstat (i.e. idling state)
  • powerstat -d 2 run for about 5-10 samples (50 seconds)
  • Base line with no updates or anything installed

    • Average consumption of 18.26 Watts
    • Audio codec hwC0D0: Realtek at 100% usage as reported by powertop
  • Install tlp and tlp-rdw for basic power management

    • sudo tlp-stat -s to check status
    • sudo tlp start to start tlp without reboot
    • After tlp started average consumption reduced to 9.96 Watts
      • Appears to have fixed Audio codec issue
  • Updating system sudo apt update && sudo apt upgrade and a reboot

    • Upgrade from kernel 4.10.0-19 to 4.10.0-21
    • Average consumption 9.87 Watts, so pretty much the same
TLDR: Stop here if you don't need the Nvidia GPU!

After what I was reading online I wrongly assumed that the Nvidia GPU would be running all the time, so I thought I could achieve more power savings by disabling it. I have since come to the conclusion that the nouveau drivers act properly and are not using the Nvidia GPU, so this isn't necessary.

The following is what I tried before realizing that chasing a sub 9 Watt idle power consumption (at 40% brightness) was pointless. After reading more, I concluded this was likely only possible for XPS models with a FHD display. Anyways, here are my probably not-very-useful notes as to what I tried to get the Nvidia GPU working via optimusrun/prime-select.

  • Install acpi and acpi-call-dkms to disable Nvidia GPU
    • sudo apt install acpi acpi-call-dkms

    • sudo modprobe acpi_call

    • sudo bash /usr/share/doc/acpi-call-dkms/examples/turn_off_gpu.sh | grep works

      • For XPS 15 9560 should return: "_SB.PCI0.PEG0.PEGP._OFF"
      • NOTE: do not run this if using nvidia drivers, I think this crashed my system when I had previously run "sudo ubuntu-drivers autoinstall", which set to using the nvidia drivers
    • echo '_SB.PCI0.PEG0.PEGP._OFF' | sudo tee /proc/acpi/call to actually turn off the dGPU

      • After executing and re-running powerstat, did not observer any change in power consumption
    • Edit /etc/default/grub and add acpi_rev_override=5 to GRUB_CMDLINE_LINUX_DEFAULT and reboot

      • No changes to power consumption, still around 12 Watts
  • Trying an sudo apt update && sudo apt upgrade
    • This improved power consumption to an average of 9.73 Watts, unclear what update specifically caused improvement
      • Possibly the upgrade from kernel 4.10.0-19 to 4.10.0-20 ?
  • Attempting switch to Intel proprietary drivers under "additional drivers" GUI tool
    • No noticeable changes, reverted back
  • Trying to install Intel Graphics For Linux Kabylake Drivers from: https://01.org/linuxgraphics/downloads/firmware
    • Slightly worse power consumption now, average of 10.07 Watts, probably just margin of error
@spenserlee
Copy link
Author

grub kernel parameters that fixed sleep issues:

GRUB_CMDLINE_LINUX_DEFAULT="quiet splash acpi_rev_override=5 enable_fbc=1 enable_psr=1 disable_power_well=0 pci=noaer pcie_aspm=force nmi_watchdog=0"

@kevlawz
Copy link

kevlawz commented Dec 9, 2017

Hey nice write-up. A couple of things to possibly help...

  1. You don't have to reinstall Windows when changing from RAID to AHCI. While still in RAID (or change AHCI to RAID to do this step), set Windows to do a "Safe Mode". Then change to AHCI in the bios. Then boot into Windows. Turn "Safe Mode" off. You can now reboot into Windows without reinstalling.
  2. For power management, did you check Powertop for any devices with 100% usage? In my case I had an Intel USB bluetooth device that was not being released. Turns out it was a bug with FWUPD (auto firmware update service). I uninstalled FWUPD and power drain was reduced. (Ubuntu 17.10)

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