Hi all!
I run nixos on my laptop, and I use an AMD eGPU in a Thunderbolt enclosure. It works well for providing the power I need for gaming, but the screen freezes hard and I have to hold the power button for 10 seconds in order to power off whenever I unplug. I’ve heard that this is called a kernel panic, and it’s happening here because the system is trying to use an absent gpu to render the display.
Would it be possible to force my computer to use the integrated graphics for all applications by default, and then only use the eGPU to run certain applications, and would that allow hot-unplugging the eGPU?
EDIT: So if I disable the external monitors connected thru the eGPU in display manager, I can hot-remove just fine. Unfortunately, I was also hoping for the eGPU to function as a multi-monitor dock.
Ideal solution: Computer detects when the eGPU is unplugged and, before panicking, disables all displays connected thru it.
Adequate solution: When I unplug, I can first close the lid or use a keyboard shortcut to quickly disable the external monitors.
EDIT 2: Adequate solution achieved: In KDE Plasma, Power Settings → On AC Power → When Laptop Lid Closed: Turn off Screen; Even when an external monitor is connected.