Thunderbolt display not recognised with Ubuntu 16.04

I'm setting up Ubuntu on a new Alienware R3 15. I have it dual booting with Windows 10. I also have a Thunderbolt display (Thunderbolt 2). I recently bought an adaptor so that that I can plug the Thunderbolt display into the Thunderbolt 3 port on the Laptop.

When I log into Windows the display is automatically recognised and works as expected. On Ubuntu the splash / load screen flashes for a second or two on the Thunderbolt display, then disappears. Then I just have the laptop screen working by the time the login screen loads. Once logged in, the displays dialog does not recognise the Thunderbolt monitor, only the laptop's screen. I've tried rebooting the machine as I understand hot plugging could be an issue. I had the same outcome after a reboot.

Any tricks to getting this to work? I'm using 16.04.2 LTS 64 bit with Gnome (3.18.5), I have a GeForce GTX 1070/PCIe/SSE2 card and the proprietary Nvidia 375.39 driver installed and selected. Again, no problems in Windows on the same machine.

Below is the output from running lspci. From the directory here I believe Intel Corporation Device 15d9 maps to JHL6340 Thunderbolt 3 NHI (C step) [Alpine Ridge 2C 2016]

lspci -vt
-[0000:00]-+-00.0  Intel Corporation Device 5910
           +-01.0-[01]----00.0  NVIDIA Corporation Device 1be1
           +-01.2-[02-3a]----00.0-[03-3a]--+-00.0-[04]----00.0  Intel Corporation Device 15d9
           |                               +-01.0-[05-39]--
           |                               \-02.0-[3a]--
           +-02.0  Intel Corporation Device 591b
           +-04.0  Intel Corporation Skylake Processor Thermal Subsystem
           +-14.0  Intel Corporation Sunrise Point-H USB 3.0 xHCI Controller
           +-14.2  Intel Corporation Sunrise Point-H Thermal subsystem
           +-16.0  Intel Corporation Sunrise Point-H CSME HECI #1
           +-17.0  Intel Corporation Sunrise Point-H SATA controller [AHCI mode]
           +-1c.0-[3b]--
           +-1c.4-[3c]----00.0  Qualcomm Atheros Device e0b1
           +-1c.5-[3d]----00.0  Qualcomm Atheros QCA6174 802.11ac Wireless Network Adapter
           +-1d.0-[3e]----00.0  Toshiba America Info Systems Device 0115
           +-1f.0  Intel Corporation Sunrise Point-H LPC Controller
           +-1f.2  Intel Corporation Sunrise Point-H PMC
           +-1f.3  Intel Corporation Device a171
           \-1f.4  Intel Corporation Sunrise Point-H SMBus

Solution 1:

I ran the command sudo xrandr -q and got the output:

Screen 0: minimum 8 x 8, current 1920 x 1080, maximum 32767 x 32767
HDMI-0 disconnected (normal left inverted right x axis y axis)
DP-0 connected primary 1920x1080+0+0 (normal left inverted right x axis y axis) 344mm x 194mm
   1920x1080     60.02*+  47.99  
DP-1 disconnected (normal left inverted right x axis y axis)
DP-2 disconnected (normal left inverted right x axis y axis)

Then the command xrandr --listproviders

Providers: number : 2
Provider 0: id: 0x1e2 cap: 0x1, Source Output crtcs: 4 outputs: 4 associated providers: 0 name:NVIDIA-0
Provider 1: id: 0x46 cap: 0x2, Sink Output crtcs: 3 outputs: 4 associated providers: 0 name:modesetting

Then the command xrandr --setprovideroutputsource 1 0 and then xrandr --current

Screen 0: minimum 8 x 8, current 1920 x 1080, maximum 32767 x 32767
HDMI-0 disconnected (normal left inverted right x axis y axis)
DP-0 connected primary 1920x1080+0+0 (normal left inverted right x axis y axis) 344mm x 194mm
   1920x1080     60.02*+  47.99  
DP-1 disconnected (normal left inverted right x axis y axis)
DP-2 disconnected (normal left inverted right x axis y axis)
DP-1-1 connected
   2560x1440     59.95 +
   1280x720      59.86  
HDMI-1-1 disconnected
DP-1-2 disconnected
HDMI-1-2 disconnected

Notice DP-1-1 is now showing as connected. At this point I was able to open the display settings and see the Thunderbolt display. There I could enable it and configure. It appears to be working correctly now. I determined these steps from a post here

I then added the following command in the 'Startup Applications' dialog so that the settings persist after loging in and out.

/bin/bash -c "sleep 10&&xrandr --setprovideroutputsource 1 0 && xrandr --output DP-1-1 --auto --primary --left-of DP-0"