A frequent problem in dual-GPU systems is that the PC freezes (kernel panic) when you try to logout, restart or shutdown after changing back from the Intel (integrated) to the NVIDIA (discrete) GPU in Linux. All of this when you're using the NVIDIA drivers (proprietary drivers).
When using the NVIDIA drivers for Linux, it's possible to change the GPU in use with the
prime-select command followed by logout.
Switching from NVIDIA to Intel GPU works perfectly:
Then logout and login to see the changes. By changing to the discrete GPU power consumption drops almost by half, providing a decent battery life in laptops.
However, the kernel panic occurs when switching back from the Intel to NVIDIA GPU.
After changing the GPU with
prime-select, either logout, restart or shutdown will result in kernel panic.
The problem is likely to be cause by ACPI configuration in the kernel boot sequence. It can be solved by adding the following to the kernel boot sequence:
acpi_osi=! acpi_osi="Windows 2009"
After than change you should be able to logout correctly after changing from the Intel to the NVIDIA GPU.