Fedora on Dell XPS 9360 and 9560

Note: This is an older guide for the XPS 9560 and 9360. For the 9570 and 7590 use our new XPS 7590 guide.

I don’t travel for work much, but I travel enough that I need a semi-portable computer. For the last three years, I’ve lugged around a Dell Precision M6800. I’ve always found Precisions to be great laptops with exceptional Linux support. These are one of the few laptops that can still disable Optimus and run entirely on the dedicated Nvidia card for simplicity. I could even sneak in Team Fortress 2 games after hours with the Quadro! Unfortunately, a 17″ Precision can also stand in for a boat anchor, the heat could cook your thighs, and the battery is gone with a quick *poof*.

I decided it’s time to join the legions of Linux on XPS fans, so I found a great deal on a scratch-and-dent 4K XPS 13 9360. I was thoroughly impressed with the fit and finish as well as having Fedora booting in minutes with no issues. Unfortunately, after a few days I found myself wanting a bit more screen real estate.

I was soon ogling XPS 15s and found another scratch-and-dent special on my doorstep, despite my trepidation about tangling with Optimus.

First boot from a Fedora 28 flash drive confirmed my fears – booting hangs. I got past that only to find power consumption levels that cut estimated battery life to 2-4 hours. Resolving that left me with random hangs of the entire system. I struggled through various permutations of fixes of each issue I encountered and thought I should post an updated guide for installing on these otherwise lovely laptops. From my reading, these fixes also apply to the new 9570 as well as the older 9550 but YMMV.

Configuring BIOS

Before booting, use F12 to boot into BIOS setup and make the following changes:

1. Change the SATA mode from RAID to AHCI

Fedora will not find the nvme without this.

2. Disable secure boot

This is optional, but I use both proprietary Nvidia drivers and Virtualbox which require this. This guide uses the commercial Nvidia drivers. Contrary to some information, I had no issues booting with secure boot until I wanted to use unsigned modules.

3. Change POST Behavior from “fast boot” to “thorough”

I’ve read repeatedly that this prevents random hangs. I haven’t duplicated but see little harm in enabling. It’s Linux: who reboots often?

Installation

On older versions of Fedora, picking the ‘Troubleshooting -> Basic Graphics mode’ worked. I couldn’t get this to work at all.

Instead, I needed to use a different mode setting option, which worked fine on the normal boot entry.

1. At the boot prompt, type ‘e’ on ‘Start Fedora-workstation-Live 28’

2. Change the ‘linuxefi’ line by adding nouveau.modeset=0:

linuxefi /images/pxeboot/vmlinuz root=live:CDLABEL=Fedora-WS-Live-28-1-1 rd.live.image quite nouveau.modeset=0

3. Hit F10 to boot.

I had no issues performing a normal Fedora installation: the Toshiba XG5 makes quick work of it: Encrypt everything and go!

Booting

Repeat the same step as for the installer: add nouveau.modeset=0 to the parameter list.

The Nvidia driver installation will make this unnecessary.

Nvidia and Bumblebee

The best combination I found for managing the Nvidia card’s use and power state was Negativo17’s fedora-nvidia repository. I typically find rpmfusion to be more trouble-free, but I had issues with power state management. It’s entirely possible this was a fluke or just a minor difference in driver versions – let me know if rpmfusion works for you.

Note: if you enable third-party repositories in the Software app, it will strangely enable rpmfusion instead of the Fedora-recommended Negativo repository.

With this combination, the Nvidia card is not merely disabled, but powered off. A quick launch properties modification on Team Fortress 2 powers on and enables the card, then powers it off when done.

1. Go ahead and ‘sudo dnf update’ and reboot to avoid possible issues with running kernel versions and packages. Don’t forget nouveau.modeset=0!

2. Install the fedora-nvidia repository and the packages required for Nvidia:

sudo dnf config-manager --add-repo=https://negativo17.org/repos/fedora-nvidia.repo
sudo dnf install nvidia-driver kernel-devel akmod-nvidia dkms acpi

3. Install the copr bumblebee repository and the Bumblebee packages:

sudo dnf copr enable chenxiaolong/bumblebee
sudo dnf install akmod-bbswitch bumblebee primus

4. Configure Bumblebee:

sudo gpasswd -a $USER bumblebee
sudo systemctl enable bumblebeed
sudo systemctl disable nvidia-fallback

5. Modify kernel params

There are problems with Bumblebee and Kernel 4.8+ on the XPS 15 that may be mitigated by a future kernel.

The first problem are lockups when X or Wayland start. These are resolved with a kernel parameter:

acpi_rev_override

Once this is resolved, you’ll find primusrun / optirun don’t work: they’ll report the card is offline. Resolve this problem by disabling pcie port power management:

pcie_port_pm=off

This did seem to impact power consumption for me, so hopefully a better fix is forthcoming.

To make these changes permanent, first add these two parameters to GRUB_CMDLINE_LINUX in /etc/default/grub:

GRUB_CMDLINE_LINUX="rd.driver.blacklist=nouveau rd.luks.uuid= rhgb quiet acpi_rev_override pcie_port_pm=off
Note: This is an example. Do not copy this line!

Next, regenerate grub.cfg:

sudo grub2-mkconfig -o /boot/efi/EFI/fedora/grub.cfg
6. Testing Nvidia

Reboot. It should come up without any kernel parameter intervention.

Log in, and verify the power state of the Nvidia card is “OFF”:

cat /proc/acpi/bbswitch
0000:01:00.0 OFF
Now test Bumblebee by running glxgears in a second terminal:
primusrun glxgears
You should now see the Nvidia card powered on:
cat /proc/acpi/bbswitch
0000:01:00.0 ON

Power Consumption

Install TLP to automatically tune power consumption, and powertop to observe the result.

sudo dnf install powertop tlp
sudo systemctl start tlp

Final Results

On a 4K touch screen, 16GB RAM, 512GB nvme, I7-7700, no USB peripherals, keyboard backlight off, and screen brightness at ~50%, powertop shows:

The battery reports a discharge rate of 8.15 W
The power consumed was 240 J
The estimated remaining time is 11 hours, 56 minutes

While that is a low among several samples, this 9560 hovers in the 8-10 W range at nearly idle. That’s respectable for a thin and light laptop that will also drive Team Fortress 2 at 3840×1600 on a Dell U3818DW!

Undervolting

I experimented with the linux-intel-undervolt-tool, but at the recommended -100mv undervolting I couldn’t consistently tell a difference in power consumption or heat. I’ve been running -100mv CPU and -50mv GPU with no issues.

# intel-undervolt read
CPU (0): -99.61 mV
GPU (1): -49.80 mV
CPU Cache (2): -99.61 mV
System Agent (3): -0.00 mV
Analog I/O (4): -0.00 mV

Touchscreen

There are references to the Elan touchscreen being a significant contributor to power draw. I was also unable to replicate this savings.

I’ll update this if I experiment further.

Update: These modifications still apply on Fedora 29.