Trying to install Ubuntu on Dell XPS 15 (9570)

I have been trying to install Ubuntu on my new laptop:

  • Dell XPS 15 (9570)
  • Windows 10 Home 64bit English
  • 8th Generation Intel(R) Core(TM) i7-8750H Processor (9M Cache, up to 4.1 GHz, 6 cores)
  • 16GB, 2x8GB, DDR4, 2666MHz
  • 256GB M.2 2280 PCIe Solid State Drive
  • NVIDIA(R) GeForce(R) GTX 1050Ti with 4GB GDDR5

I began by trying to install Ubuntu 18.04 LTS using an 8GB USB drive. The first issue I ran into was getting frozen on the bootup screen on the fourth dot. After a couple tries, I plugged in my monitor (through HDMI) and it stopped getting stuck all of a sudden.

Next, I tried to go through the installation and when I clicked on restart now, my computer froze and I had to shut it down manually and start it back up again. At this point I got to the login screen and logged in but after entering my password it got stuck on a purple screen with my mouse pointer (which was frozen). I was able to get into a shell at this point (with ctrl+alt+f4) and attempted to run sudo apt-get install nvidia-390 but this froze when it reached building initial module for 4.15.0-22-generic and upon reboot I had to run sudo dpkg --remove -a.

I was unable to work around this so I attempted to install Ubuntu 16.04 which I could only do by adding acpi=off to the boot configuration (which by the way, I had a lot of trouble getting to since GRUB usually flashed in and then immediately disappeared and only occasionally would it stick around long enough for me to use). But when I try to boot up now, I never reach the screen with the five dots and instead immediately get stuck on a purple screen (with no mouse pointer).

I reinstalled Ubuntu 18.04 and am back to being stuck on the log-in screen.

What should I do?


Solution 1:

I've summarized all of this into a blog post https://medium.com/@pwaterz/how-to-dual-boot-windows-10-and-ubuntu-18-04-on-the-15-inch-dell-xps-9570-with-nvidia-1050ti-gpu-4b9a2901493d

I struggled with this as well. What ended up working for me is as follows, note I installed Ubuntu 18.04:

  • Follow the first part of this doc - https://github.com/rcasero/doc/wiki/Ubuntu-linux-on-Dell-XPS-15-(9560) in regards to bios settings and changing the windows partition from raid to ahci. This will allow you to boot the live CD. Note, I did end up having to enter my windows key to unlock the drive after I did this to get back into windows.

  • Install Ubuntu normally.

  • JackJack96 did a fabulous job scripting all setup and package installation steps here https://github.com/JackHack96/dell-xps-9570-ubuntu-respin. The primary purpose of those scripts is to generate an image with the packages already installed, but he does provide a script to set things up on a existing installation. After you boot for the first time, open terminal and run the following:

    sudo apt install curl
    sudo bash -c "$(curl -fsSL https://raw.githubusercontent.com/JackHack96/dell-xps-9570-ubuntu-respin/master/xps-tweaks.sh)"
    sudo prime-select intel
    

This forces the use of the intel integrated graphics, no need to waste battery. I have not tested running the nvidia card. If you want to, run:

sudo prime-select nvidia
  • The last issue I ran into was the screen would start flickering. I solved this by changing the resolution to 2048 x 1152 and setting the refresh rate to 59.91. At first I did have it set at 3840 x 1152, with the lowest refresh rate, but it was still a little unstable, so I dropped the resolution. It's basically the same as running 4k and scaling up to 250% - which is the default. Side note, I owned an XPS 10 years ago, and ran into this same issue...why is it still happening?

I've been running this setup for a couple days and it mostly works. The screen does occasionally freak out when I plug in the power, still need to work that out.

Lastly, one tweak that was icing on the cake was installing https://github.com/bulletmark/libinput-gestures.

Last but not least, back up your image so if you break something you can restore it:

sudo dd if=/dev/nvme0n1p2 conv=sync,noerror bs=64K status=progress |  gzip -c  > backup.img.gz

Make sure to replace nvme0n1p2 with the proper partition. You can check it by running:

df -h  

My advice is to do this on a fresh install. You end up installing and configuring so many different things when trying to get things working, and that will ensure you don't have any issues.

Update 1:

Screen flickering/crashing continues. Did some digging and it appears to be a bug with linux kernel. I updated my kernel to 4.17.12-041712-generic by doing the following:

git clone [email protected]:mtompkins/linux-kernel-utilities.git
cd linux-kernel-utilities
sudo ./update_ubuntu_kernel.sh --latest

Note, when you run this, you might install a newer kernel version than I did. For the moment things seem a little better, only been a couple hours though. Will update later if it stays stable.

Update 2:

Used the computer all day and no flickers. Kernel update seems to have done the trick.

Update 3 No flickering still after kernel update. I did notice an issue when suspending the laptop where it was getting very hot and not fully shutting down. I traced it to what looks to be a bug in nouveau driver:

Aug 08 19:20:26 hermes kernel: Hardware name: Dell Inc. XPS 15 
9570/02MJVY, BIOS 1.3.0 07/12/2018
Aug 08 19:20:26 hermes kernel: Workqueue: events_unbound async_run_entry_fn
Aug 08 19:20:26 hermes kernel: RIP: 0010:gf100_vmm_flush_+0x15c/0x1a0 [nouveau]
Aug 08 19:20:26 hermes kernel: RSP: 0018:ffffa9fc0782f5c8 EFLAGS: 00010282
Aug 08 19:20:26 hermes kernel: RAX: 0000000000000000 RBX: ffff969a575e0050 RCX: ffffffffaf061dc8
Aug 08 19:20:26 hermes kernel: RDX: 0000000000000000 RSI: 0000000000000096 RDI: 0000000000000246
Aug 08 19:20:26 hermes kernel: RBP: ffffa9fc0782f600 R08: 0000086da855788c R09: 000000000000001d
Aug 08 19:20:26 hermes kernel: R10: 0000000000000766 R11: 00000000000158a8 R12: ffff969a49d08c00
Aug 08 19:20:26 hermes kernel: R13: ffff969a2b5d0f00 R14: 000003cbc7bc6800 R15: ffff969a494a5000
Aug 08 19:20:26 hermes kernel: FS:  0000000000000000(0000) GS:ffff969a5bcc0000(0000) knlGS:0000000000000000
Aug 08 19:20:26 hermes kernel: CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
Aug 08 19:20:26 hermes kernel: CR2: 00007f15f4007036 CR3: 00000001b960a004 CR4: 00000000003606e0
Aug 08 19:20:26 hermes kernel: Call Trace:
Aug 08 19:20:26 hermes kernel:  gp100_vmm_flush+0x17/0x20 [nouveau]
Aug 08 19:20:26 hermes kernel:  nvkm_vmm_iter.constprop.14+0x323/0x810 [nouveau]
Aug 08 19:20:26 hermes kernel:  ? gp100_vmm_pd0_pde+0x1a0/0x1a0 [nouveau]
Aug 08 19:20:26 hermes kernel:  ? __switch_to_asm+0x40/0x70
Aug 08 19:20:26 hermes kernel:  ? __switch_to_asm+0x40/0x70
Aug 08 19:20:26 hermes kernel:  ? native_sched_clock+0x37/0x90
Aug 08 19:20:26 hermes kernel:  nvkm_vmm_map+0x148/0x400 [nouveau]
Aug 08 19:20:26 hermes kernel:  ? gp100_vmm_pd0_pde+0x1a0/0x1a0 [nouveau]
Aug 08 19:20:26 hermes kernel:  ? __switch_to_asm+0x40/0x70
Aug 08 19:20:26 hermes kernel:  ? __switch_to_asm+0x34/0x70
Aug 08 19:20:26 hermes kernel:  nvkm_vram_map+0x57/0x80 [nouveau]
Aug 08 19:20:26 hermes kernel:  nvkm_uvmm_mthd+0x5ff/0x8d0 [nouveau]
Aug 08 19:20:26 hermes kernel:  nvkm_object_mthd+0x1a/0x30 [nouveau]
Aug 08 19:20:26 hermes kernel:  nvkm_ioctl_mthd+0x65/0x70 [nouveau]
Aug 08 19:20:26 hermes kernel:  nvkm_ioctl+0xe2/0x180 [nouveau]
Aug 08 19:20:26 hermes kernel:  nvkm_client_ioctl+0x12/0x20 [nouveau]
Aug 08 19:20:26 hermes kernel:  nvif_object_ioctl+0x47/0x50 [nouveau]
Aug 08 19:20:26 hermes kernel:  nvif_object_mthd+0x129/0x150 [nouveau]
Aug 08 19:20:26 hermes kernel:  ? _cond_resched+0x19/0x30
Aug 08 19:20:26 hermes kernel:  ? __kmalloc+0x19b/0x230
Aug 08 19:20:26 hermes kernel:  ? nvif_vmm_map+0x3f/0xb0 [nouveau]
Aug 08 19:20:26 hermes kernel:  nvif_vmm_map+0x88/0xb0 [nouveau]
Aug 08 19:20:26 hermes kernel:  nouveau_mem_map+0x82/0xf0 [nouveau]
Aug 08 19:20:26 hermes kernel:  nouveau_vma_map+0x48/0x70 [nouveau]
Aug 08 19:20:26 hermes kernel:  nouveau_bo_move_ntfy+0x77/0xe0 [nouveau]
Aug 08 19:20:26 hermes kernel:  ttm_bo_handle_move_mem+0x2d2/0x520 [ttm]
Aug 08 19:20:26 hermes kernel:  ttm_bo_evict+0x142/0x1c0 [ttm]
Aug 08 19:20:26 hermes kernel:  ? drm_edid_to_sad+0x194/0x1d0 [drm]
Aug 08 19:20:26 hermes kernel:  ttm_mem_evict_first+0x19a/0x220 [ttm]
Aug 08 19:20:26 hermes kernel:  ttm_bo_force_list_clean+0xa1/0x170 [ttm]
Aug 08 19:20:26 hermes kernel:  ttm_bo_evict_mm+0x2e/0x30 [ttm]
Aug 08 19:20:26 hermes kernel:  nouveau_do_suspend+0x85/0x2d0 [nouveau]
Aug 08 19:20:26 hermes kernel:  nouveau_pmops_suspend+0x39/0x80 [nouveau]
Aug 08 19:20:26 hermes kernel:  pci_pm_suspend+0x76/0x130
Aug 08 19:20:26 hermes kernel:  ? pci_pm_freeze+0xf0/0xf0
Aug 08 19:20:26 hermes kernel:  dpm_run_callback+0x5b/0x130
Aug 08 19:20:26 hermes kernel:  __device_suspend+0x109/0x450
Aug 08 19:20:26 hermes kernel:  async_suspend+0x1f/0x90
Aug 08 19:20:26 hermes kernel:  async_run_entry_fn+0x3c/0x150
Aug 08 19:20:26 hermes kernel:  process_one_work+0x1f5/0x3c0
Aug 08 19:20:26 hermes kernel:  worker_thread+0x32/0x400
Aug 08 19:20:26 hermes kernel:  kthread+0x120/0x140
Aug 08 19:20:26 hermes kernel:  ? pwq_unbound_release_workfn+0xd0/0xd0
Aug 08 19:20:26 hermes kernel:  ? kthread_bind+0x40/0x40
Aug 08 19:20:26 hermes kernel:  ret_from_fork+0x35/0x40
Aug 08 19:20:26 hermes kernel: Code: 41 5e 41 5f 5d c3 49 8b 7c 24 10 48 8b 5f 50 48 85 db 74 4d e8 56 4a 3c ed 48 89 da 48 c7 c7 9c a8 f9 c0 48 89 c6 e8 b6 79 de ec <0f> 0b eb bf 49 8b 7c 24 10 48 8b 5f 50 48 85 db 74 1e e8 2d 4a 
Aug 08 19:20:26 hermes kernel: ---[ end trace ff7d3fd86666433f ]---

To fix it I switched to the nvidia card full time.

sudo prime-select nvidia

It seems to suspend and wake up much smoother now!

Update 4: I fixed the issue with not being able to sleep while using the intel gpu. All I had to do was add nouveau.modeset=0 to my grub and everything works now! I am going to try and write all this up in a medium post soon!

Solution 2:

I have got a very similar set-up. XPS 15 9570- i7 w/ 32GB. I have managed to set-up dual boot with Ubuntu 18.04 and Windows 10.
I installed BIOS update from Dell directly.
And then I followed these instructions provided by Ramón Casero

Hope this helps.

Solution 3:

I come across the same issue as you with my 9570, what you need to do is to modify the bootup parameters. Being more specific, adding nouveau.modeset=0 to the boot options.

The following 2 links might help you:

  • https://github.com/rcasero/doc/wiki/Ubuntu-linux-on-Dell-XPS-15-(9560)
  • Ubuntu 16.04 hangs on shutdown/restart (Dell XPS 15 9560)