pop-os / pop

A project for managing all Pop!_OS sources
https://system76.com/pop
2.44k stars 87 forks source link

System Freezes during boot after switching to Intel graphics #194

Open jeherr opened 6 years ago

jeherr commented 6 years ago

Distribution - (run cat /etc/os-release) NAME="Pop!_OS" VERSION="18.04 LTS (Testing)" ID=ubuntu ID_LIKE=debian PRETTY_NAME="Pop!_OS 18.04 LTS (Testing)" VERSION_ID="18.04" HOME_URL="https://system76.com/pop" SUPPORT_URL="http://support.system76.com" BUG_REPORT_URL="https://github.com/pop-os/pop/issues" PRIVACY_POLICY_URL="https://system76.com/privacy" VERSION_CODENAME=bionic UBUNTU_CODENAME=bionic

Issue/Bug Description After selecting Intel graphics and rebooting, my laptop freezes when trying to boot up again before any graphical interface is loaded.

Steps to reproduce (if you know) Installed from the Nvidia .iso file. When booting from the live USB, graphics must be set to DISCRETE in BIOS, otherwise the live USB will freeze when trying to boot. After installing the OS onto my hard drive, I can then switch to MSHYBRID in the BIOS and the freshly installed OS will boot up using Nvidia graphics. After selecting Intel graphics to be used upon reboot and then rebooting, the OS freezes before any graphical interface is loaded.

Other Notes Laptop is a System76 Oryx Pro 17" (version is oryp2) Below is the output of lspci | grep VGA for graphics device info

00:02.0 VGA compatible controller: Intel Corporation HD Graphics 530 (rev 06)
01:00.0 VGA compatible controller: NVIDIA Corporation GP106M [GeForce GTX 1060 Mobile] (rev a1)

I would be happy to provide some logs of a failed boot if anything is written before the system freezes, or any other information which could be helpful to debug this.

Also is there a way from the command line to switch back to the Nvidia graphics so that I can fully boot into the OS again? I don't think that I can switch to a different tty when the system freezes, but if I can boot into single-user mode and switch the config back to Nvidia then it would be much easier to provide log files.

ghost commented 6 years ago

Have you modified the kernel line GRUB_GFXPAYLOAD_LINUX and added your screen resolution before rebooting? I have an Oryx Pro that had that problem.

My /etc/default/grub looks like this:

...blah... GRUB_GFXPAYLOAD_LINUX=1920*1080 ...blah...

jeherr commented 6 years ago

@msjenkins1 I have run into that fix a year or so ago. It was the only way I could get my laptop to boot with MSHYBRID enabled ever. Somehow with the new Pop_OS testing version I can boot with MSHYBRID enabled without the gfxpayload set to 1920*1080.

I did try booting from the live USB with that setting and it didn’t work, but it’s possible that could fix it for the installed OS. I would like to be able to reenable the Nvidia setting from single-user mode though before I do too much testing with it, but will certainly try that again once I can.

ghost commented 6 years ago

I believe I am experiencing the same issue as you are/were having. The best I can figure is that Pop uses systemd-boot and doesn't get the kernel parameters to allow graphics switching in Mesa. This is purely a trial and error guess, but what else have you found out?

I've worked with Ubuntu 16.04.4, 17.10 and 18.04 (which worked near perfectly with mesa, yet slightly higher power consumption than 17.10), Pop's Nvidia and Intel ISO's, as well as fedora 28. The only unfixable freeze is the one you mentioned with MSHYBRID enabled when running Pop's Intel ISO.

Edit I got home and checked my logs on a fresh install with all updates. This time I tried updating the kernel and Graphics stack with Padoka ppa, but there's no change. Here's a picture of the logs.

jeherr commented 6 years ago

I didn't find anything that worked since my last post. I believe you are right about the kernel parameters not allowing graphics switching in Mesa. I have tried Ubuntu 16.04 and Manjaro 17.1 as well as Pop_OS and haven't been able to get it working on any of those.

There's an issue on the Bumblebee github about X freezing when booting with intel graphics selected, and a workaround was to boot to text only mode and manually turn on the dGPU before booting. I tried this with Manjaro, and it did boot with intel graphics selected, though the dGPU is not powered down at that point so there's no power savings. Many users reported their issue being fixed by setting acpi_osi in the boot parameters (including some Clevo laptops) though none of those worked for me. Pretty sure this issue is related.

jackpot51 commented 6 years ago

This has been fixed if you can update and then reselect intel graphics from the menu. The NVIDIA card will be turned off after login to prevent hangs during boot.

ghost commented 6 years ago

@jackpot51

I hate to be the bearer of bad news. I downloaded the latest Intel and Nvidia ISOs, installed with MSHYBRID enabled in the Oryx Pro's BIOS and all seemed well. I attempted to reboot using the system-76 plugin Intel option and using terminal commands using Nouveau and then Nvidia drivers. The logs with Nvidia drivers installed were heavily populated with disconnection entries (which wasn't a new thing for me at least) many per journal -f update, but no errors other than those. Reboot yields a non, functional X with a rapid blinking cursor until it times out.

When switching from MSHYBRID to DISCRETE in the Oryx Pro's BIOS, I can successfully boot, but loose bbswitch functionality entirely. I've also tried "system76-power graphics power off", which was unsuccessful due to the Nvidia and Nouveau drivers enabled.

Dmesg shows Optimus capability found with MSYHBRID enabled, but none with DISCRETE.

I'm still unable to find a successful way to pass "GFXPAYLOAD" to the new kernelstub, which, on Ubuntu and grub, yielded perfect results with /proc/acpi/bbswitch showing the card as "OFF".

I appreciate the work y'all are doing and I can't wait until this is problem is licked. I wish I could help more...

ghost commented 6 years ago

I tried this setup with a fresh Ubuntu 18.04 LTS installation with "GRUB_GFXPAYLOAD_LINUX="1920*1080", ppa:system76/pop enabled and system76-driver-nvidia installed as well as Bumblebee (with systemctl enable bumblebeed.service) and it works flawlessly. System76-power conflicts with Nvidia-Prime and APT uninstalls it. /proc/acpi/bbswitch shows the card as "OFF".

nergdron commented 6 years ago

been running into this same problem. @jackpot51: how is it fixed? I'm using the latest system76-driver-nvidia package, but I just get the same old black screen on boot. the only thing that works is nouveau, which has super low performance and stability compared to the nvidia binary drivers. can you provide a more detailed explanation on how this is supposed to work with Pop! 18.04?

jeherr commented 6 years ago

I've gotten switchable graphics working through nvidia-prime, not in Pop!_OS, but on Kubuntu 18.04. After installing Kubuntu 18.04 the first thing I had to do was add "GRUB_GFXPAYLOAD_LINUX=1920*1080" in /etc/default/grub for the system to boot with MSHYBRID enabled in the BIOS.

Then I added the system76 repo, ran sudo apt update, and installed system76-driver and system76-driver-nvidia packages which installed the nvidia-396 graphics driver. Next I ran sudo apt install nvidia-prime. As @msjenkins1 said, nvidia-prime conflicts with something installed from the system76-driver and its dependencies. Installing nvidia-prime didn't uninstall anything from the system76 repo as I recall, but listed everything installed by them as no longer needed and could be removed with sudo apt autoremove, but running this uninstalled the nvidia driver and I was left with a black screen upon booting, but could still get to a tty.

So I started over by running sudo apt purge nvidia* system76*. Reinstalled the system76-driver and system76-driver-nvidia. Then reinstalled nvidia-prime. This time I ran sudo apt install for everything from the system76 repo which was listed for autoremove to set them all to manually installed. After this I am able to open the Nvidia X Server Setting app and choose between intel and nvidia in the prime profiles section.

ghost commented 6 years ago

@jeherr Awesome! I'm glad you got it working. What is your battery life like? For example, this Oryx Pro has an i7-7700HQ with GTX 1060 (3 hours with the GPU on and about 7 with the GPU off). I've noticed on the POP_OS! w/ intel/nouveau, system76-power graphics intel is now successful in switching drivers, but the card is not being powered down yet. system76-power graphics power show the card as off, I'm still only getting about 3 hours of battery.

EDIT: I didn't have to pass GFXPAYLOAD to the kernelstub settings to do it. This is the output of kernelstub -p=loglevel=0 nvidia.NVreg_EnableBacklightHandler=1 quiet splash systemd.show_status=false

jeherr commented 6 years ago

@msjenkins1 Going from memory here but I believe I have the i7-7700HQ and the GTX 1060 (6 GB Ram). My battery life with the GPU on is maybe 1.5 to 2 hours and with the GPU off it's maybe like 3-4 hours. It's strange that we see significant differences. If yours the 15" version? Mine is 17", maybe the extra screen size is causing a significant change in battery life. I'd die to get the kind of battery life you're getting on that. Is there anything else you've done to improve your battery life? I have TLP installed as per the System76 support page on battery life, but I haven't used powertop to config my system for even more power savings.

ghost commented 6 years ago

@jeherr Yeah, I think it is the 15" version. It usually varies wildly from my use case. If it's just sitting in airplane mode, the longest I've gotten on standby is about 9 hours with Intel, however if I'm looking for Mersenne Primes, 45-60 minutes. If I can get the darn Nvidia card to shut off, I regularly get a minimum of 5 hours, even with watching a few videos while working. When I can't get the Nvidia card to shut off, I get 90-120 minutes of work, but the random fan/turbine noise from opening Firefox really is loud in a quiet classroom... :(

I don't have TLP installed, but I have tried it in the past. I may just give it another go to see if I can squeeze more time from the 60 watt/hour battery. It only seems to charge regularly to a max of 58.7, but I have taken to using the Flexicharger setting to stop charging at 60% and start charging at 40%. Unless I'm gaming, it's plenty of juice for at least 2.5 hours.