Created attachment 301002 [details]
I have an external egpu (Radeon 6600 RX) connected through thunderbolt3 to a Thinkpad X1 carbon 6th Gen.
Note that no display is attached to the eGPU, since I use it only to offloading the computation using the DRI_PRIME=1 env variable.
Upon connection, the eGPU is recognized, amdgpu driver is loaded, and it becomes available in offloading mode. No Xserver restart occurred at this stage, since the integrated intel gpu is still the one managing the display. So far so good.
Instead, When I disconnect the thunderbolt3 cable I get that Xserver restarts, even though I'm not using the eGPU. This is very annoying, and I see no reasons to kill the Xserver in this situation.
I would expect that the eGPU is released, and that the amdgpu driver being unloaded.
See also attachments in bug 215958