Complete freeze with nvidia-prime

I’m honestly not sure if the issue is Prime or just the drivers.

  • Brand new Dell XPS 15 9560, Intel IDG and Nvidia 1050
  • Ubuntu 16.04.1
  • Kernel 4.4.0-62-generic

Without the nvidia drivers and prime, works great in “Intel mode”.

I then install the native drivers (nvidia-378, nvidia-prime, nvidia-settings). After logging in, everything is great. I checked and I was using the Nvidia drivers (the only issue being that not all screen resolutions were available).

However, anything that causes X to shutdown completely freezes the laptop - video stops, can’t ping, even the Caps lock button is disabled.

At first I couldn’t figure out the problem. I was just trying to switch from Intel to Nvidia and back and it froze. Then I went to the console to restart lightdm, which restarts X and it froze. Then I realized just logging off, which also causes X to reset made the machine freeze.

Then I simply uninstalled the Nvidia drivers and everything worked again.

Wondering if anyone else has seen anything similar. Googling the issue I do see some similar problems.

Please run after the issue occured and your system is back up. Then attach output to your post.

I tested again. But before I did I installed kernel 4.4.0-62. With this kernel the issue has disappeared. With 4.4.0-59 it is still present.

Note that the kernels mentioned are from the Ubuntu repos.

I spoke too soon. I switch to Nvidia and rebooted and it worked. Switched back and it worked. Then it hung on shutdown switching to NVidia again.

nvidia-bug-report.log.gz attached.
nvidia-bug-report.log.gz (91.8 KB)

Once again it is freezing whenever lightdm is shutdown or restarted.

I attempted to reboot from the console and the last line that shows is:

“Manage, Install, and Generate Color Profiles”.

“sudo apt-get purge nvidia-378 nvidia-prime nvidia-settings” hosed my machine. It now boots into emergency mode.

It hosed the kernel that was installed. Luckily I could boot to the previously installed kernel.

That should NEVER happen when simply removing video driver packages!

The Dell XPS 15 9560 appears to be designed for and ships with Windows 10.

If one is intent upon buying an Intel-based notebook for use with Ubuntu then a purpose-built System76 lappy is one time saving option worth checking out:

Laptops - System76

28 December 2016
System76 Has Been Collaborating With NVIDIA Over Linux Driver Fixes - Phoronix

Other options:

ZaReason Linux Laptops, Desktops, Servers and more

Top 5 Ubuntu pre-installed Laptop companies | Unixmen

Certified hardware | Ubuntu

nvidia-378 is a beta driver have you tried the stable release (nvidia-375)?

Wondered about that. 378 is the latest that’s actually in the repo. I didn’t realize betas were put there without being marked as such.

Tried with 375. Same issues. However, to add more info; when NVIDIA is selected there are no issues restarting lightdm or the computer. When you switch back to Intel you have the issues after rebooting (IOW while set to “Intel”).

Switching back to Nvidia (which will require are hard reboot), things work well again.

Want to mention once again that some display resolutions are missing, which is frustrating.

Since the driver by itself works, this forum is the wrong place for bug hunting. You would rather have to report a bug with ubuntu and their prime-select infrastructure.
The issue with resolutions missing is a prime bug, this sure has to be discussed here as it is kind of annoying. Can be worked around by generating modelines, of course.

Did the modeline thing. But thanks for the suggestion to file a bug with Ubuntu. I’ll do that.

@generix, are you sure that the problem with the shutdown hang is on the prime-select side?
@rabinnh have you filed the bug with Ubuntu?

I searched and a number of people have already filed bugs with Ubuntu, but there doesn’t appear to be any activity on the Ubuntu side.

Here is a more generic version of the bug that affects a number of laptop manufacturers:

Seems like you’re all running around in circles:

Yep. We all agree that there’s an issue, but can’t seem to get NVidia or Ubuntu to look at it.

Thanks you guys for the informative links.

Sooo… I installed ubuntu 17.04 on an usb drive and for me, switching works. I used the official ubuntu drivers nvidia-375. But I suspect this could be a timing problem, i.e. only apparent on fast drives, SSDs.
Could you do me a favor and

  1. post contents of /var/log/gpu-manager.log when switched to intel
  2. remove the file /lib/systemd/system/nvidia-persistenced.service and try to boot while switched to intel

Using a Dell XPS 15 9560 with Nvidia 1050 and a fresh install of Ubuntu 16.04.2

kernel 4.8.0-36-generic nvidia-378

Can’t reboot at the moment, but I’ll try to remove /lib/systemd/system/nvidia-persistenced.service and report back.

Eventualy I’ll try also nvidia-375 and kernel 4.9.

cat /var/log/gpu-manager.log

log_file: /var/log/gpu-manager.log
last_boot_file: /var/lib/ubuntu-drivers-common/last_gfx_boot
new_boot_file: /var/lib/ubuntu-drivers-common/last_gfx_boot
can’t access /run/u-d-c-fglrx-was-loaded file
Looking for fglrx modules in /lib/modules/4.8.0-36-generic/updates/dkms
Looking for nvidia modules in /lib/modules/4.8.0-36-generic/updates/dkms
Found nvidia module: nvidia_378.ko
Is nvidia loaded? yes
Was nvidia unloaded? no
Is nvidia blacklisted? no
Is fglrx loaded? no
Was fglrx unloaded? no
Is fglrx blacklisted? no
Is intel loaded? yes
Is radeon loaded? no
Is radeon blacklisted? no
Is amdgpu loaded? no
Is amdgpu blacklisted? no
Is nouveau loaded? no
Is nouveau blacklisted? yes
Is fglrx kernel module available? no
Is nvidia kernel module available? yes
Vendor/Device Id: 8086:591b
BusID “PCI:0@0:2:0”
Is boot vga? yes
Vendor/Device Id: 10de:1c8d
BusID “PCI:1@0:0:0”
Is boot vga? no
Skipping “/dev/dri/card1”, driven by “i915”
Skipping “/dev/dri/card0”, driven by “nvidia-drm”
Skipping “/dev/dri/card1”, driven by “i915”
Skipping “/dev/dri/card0”, driven by “nvidia-drm”
Skipping “/dev/dri/card1”, driven by “i915”
Skipping “/dev/dri/card0”, driven by “nvidia-drm”
Found “/dev/dri/card1”, driven by “i915”
output 0:
output 1:
Number of connected outputs for /dev/dri/card1: 2
Does it require offloading? yes
last cards number = 1
Has amd? no
Has intel? yes
Has nvidia? yes
How many cards? 2
The number of cards has changed!
Has the system changed? Yes
main_arch_path x86_64-linux-gnu, other_arch_path i386-linux-gnu
Current alternative: /usr/lib/nvidia-378-prime/
Current core alternative: (null)
Current egl alternative: /usr/lib/nvidia-378-prime/
Is nvidia enabled? no
Is nvidia egl enabled? no
Is fglrx enabled? no
Is mesa enabled? no
Is mesa egl enabled? no
Is pxpress enabled? no
Is prime enabled? yes
Is prime egl enabled? yes
Is nvidia available? yes
Is nvidia egl available? no
Is fglrx available? no
Is fglrx-core available? no
Is mesa available? yes
Is mesa egl available? yes
Is pxpress available? no
Is prime available? yes
Is prime egl available? no
System configuration has changed
Intel IGP detected
Intel hybrid system
Nvidia driver version 378.9 detected
Invalid /sys/class/dmi/id/product_version=""
/sys/class/dmi/id/product_name=“XPS 15 9560”
1st try: bbswitch without quirks
Loading bbswitch with “load_state=-1 unload_state=1” parameters
Removing xorg.conf. Path: /etc/X11/xorg.conf
Moved /etc/X11/xorg.conf to /etc/X11/xorg.conf.02152017
Powering off the discrete card
Disabling persistence mode
Unloading nvidia-uvm with “no” parameters
Unloading nvidia-drm with “no” parameters
Unloading nvidia-modeset with “no” parameters
Unloading nvidia with “no” parameters

gpu-manager.log looks unsuspicious.
As you have a Kaby Lake cpu it might be interesting what kind of driver the xserver uses.
Can you please post the outputs of (as root, when switched to intel):
cat /var/log/Xorg.0.log
lspci -v
cat /proc/acpi/bbswitch
cat /usr/lib/nvidia-378-prime/
Maybe put them in a zip-archive and attach that to your post.