This isn’t a support request but I just want to let the developers know that most of the time nvidia-prime (which provides prime-select command) package isn’t turning off the Nvidia dGPU found on hybrid/optimus/gaming laptops on intel/integrated profile, instead it just hides it from Xorg while the dGPU keeps draining battery and causing high idle temperatures.
It appears to be a well-known and “confirmed” issue as per several Launchpad bug reports:
On the other hand Ubuntu based distro Pop_OS! includes their own utility called system76-power which does the job correctly by completely turning off the Nvidia dGPU when integrated graphics mode is selected extending my laptop’s battery life and keeping temps lower than Windows nor any other Linux distro.
This is an issue that’s been fixed and regressed a number of times in the last couple of years. I see the same thing on my XPS 95600/i7-7700HW/GTX1050 to the point I’ve just uninstalled the nvidia drivers.
I created a tool for managing Nvidia Optimus graphics switching on Linux, the integrated mode actually turns off the Nvidia card by removing it from the PCI bus using Udev rules. There’s also nvidia and hybrid modes just like Ubuntu’s nvidia-prime.
It should work on Debian and Ubuntu derivatives (automatic initramfs rebuilding is included) as well although I currently use Arch Linux.