I'm running Ubuntu 16.04 on a Dell XPS 15 9560. I have secure boot disabled, and I'm using the NVIDIA driver (
415.27-0ubuntu0~gpu16.04.1 from the
The battery life is terrible (< 2h), so I'd like to use the Intel GPU when I'm not doing heavy graphics stuff that requires the dGPU.
When I switch to the integrated graphics in the
nvidia-settings app and then reboot, the screen goes black. When I enable secure boot in the BIOS, the iGPU works. (Why does the Intel GPU require secure boot? Windows 10 doesn't seem to have any problems switching between GPUs.)
To switch back to NVIDIA again, I have to select the NVIDIA GPU using
sudo prime-select nvidia, because the
nvidia-settings app crashes as soon as I try to open it:
ERROR: Unable to load info from any available system. Then I have to reboot, and disable secure boot again. If I try to use the NVIDIA driver with secure boot enabled, I get a black screen as well.
To make matters even worse, I cannot use VirtualBox when secure boot is enabled. There seems to be a fix for that (it even mentions signing NVIDIA drivers using the same technique): https://stegard.net/2016/10/virtualbox-secure-boot-ubuntu-fail/
But I don't understand what's going on there, and I don't want to brick my main computer, so I'm a little hesitant to try it.
What's the cleanest way to get everything working, so I can easily switch between iGPU and dGPU, as well as being able to launch virtual machines, no matter what GPU I'm using?