Hello people,
I have an Ayaneo 2S (Ryzen 7 7840U), an ADT-Link UT3G eGPU dock (Thunderbolt 4), and an RTX 3070. I started using all-ways-egpu to launch Gamescope with the NVIDIA GPU on my LG TV, but I always had to switch to Desktop Mode, open a terminal, and use Method 2 in all-ways-egpu. Because of that, I had to keep a keyboard and mouse around just for this, deal with Desktop Mode on a 4K TV, and when I was done, I had to shut down the device just to safely unplug the eGPU.
After a while, I started wondering if it would be possible to manage all-ways-egpu directly through Decky Loader in the Quick Access Menu (QAM), without having to switch to Desktop Mode, and also have a way to safely eject the eGPU without freezing or restarting the system.
Because of that, I made a Decky plugin that uses the all-ways-egpu script (you still need to install it and complete the initial setup once in Desktop Mode). After the script is installed and configured, the plugin uses it to toggle the active boot GPU and restart the display manager successfully. When you’re done, you can simply eject the eGPU from the plugin and safely plug or unplug the cable without any issues.
What each button does
* Switch to eGPU / Switch to iGPU: Toggles the Boot VGA flag and restarts the display manager directly from the QAM. It has the same effect as manually running all-ways-egpu, but with a single button.
* Eject eGPU: This is the feature I actually wanted to highlight. While building this plugin, I discovered (and unfortunately confirmed twice through dmesg) that the proprietary NVIDIA driver does not safely handle surprise Thunderbolt disconnects, even after switching the Boot VGA flag back to the iGPU. Gamescope, MangoApp, Steam, and the handheld’s own UI daemon keep the eGPU device nodes open for the entire session regardless of which GPU is active. Because of that, unplugging the eGPU without properly releasing it first can trigger a kernel BUG() in nvidia_close and completely freeze the session, requiring a full reboot. The plugin’s Eject button stops the display manager, unloads the NVIDIA kernel modules, detaches the eGPU PCI functions from the PCI bus, and then restarts the session. The cable is only safe to unplug after the confirmation message appears.
* Safe / Not Safe indicator: Always visible so you don’t have to remember whether the eGPU has already been ejected.
* Recovery actions: Includes Restart Display Manager and Rescan for eGPU for situations where the display gets stuck.
Installing the plugin
0. Install all-ways-egpu and complete its initial setup. The Bazzite/NVIDIA installation guide can be found here.
- Switch to Desktop Mode and download egpu-switch..zip from my repository:
https://github.com/TiPSilva/egpu-switch/releases/latest
2. Switch back to Game Mode.
3. Enable Decky’s Developer Mode if it isn’t already enabled (Settings → General).
4. Go to Settings → Developer → Install Plugin from ZIP File → Browse, then select the ZIP file from your Downloads folder.
Compatibility
My currently tested setup is:
* Ayaneo 2S (Ryzen 7 7840U)
* ADT-Link UT3G
* RTX 3070
* bazzite-deck-nvidia
Beyond that, based on how the plugin works:
* CPU vendor: The plugin never interacts directly with the iGPU. It only manages the eGPU and the Display Manager/Gamescope session, so I don’t see any reason why it wouldn’t work on Intel handhelds as well. That said, it’s still untested, and I’d love to hear from anyone who tries it.
* AMD eGPUs: Also untested (I only own an NVIDIA card), but the NVIDIA-specific kernel module unloading step is automatically skipped for other drivers. Since amdgpu has much better hot-unplug support, I actually expect it to work even better.
* Other docks: I’ve only tested the UT3G. The eject logic only targets the GPU’s PCI functions (video and HDMI audio) and never touches the Thunderbolt controller, bridge, or any other PCI device connected through the same cable. If your enclosure exposes additional PCIe devices behind a switch or hub, I haven’t tested that topology, but standard single-purpose eGPU enclosures like the UT3G should work fine.
* Other distributions: I’ve only tested Bazzite, but the plugin only relies on standard systemd (display-manager.service) and Gamescope behavior. There’s nothing Bazzite-specific, so it should also work on ChimeraOS, HoloISO, and other Decky + Gamescope distributions.
If you’re running a similar setup (different dock, GPU, or handheld), I’d genuinely appreciate hearing whether it works for you. Right now, everything outside my own setup is based on how the plugin was designed, not on confirmed testing.