Skip to content

Instantly share code, notes, and snippets.

@xtenduke
Created February 1, 2021 04:14
Show Gist options
  • Save xtenduke/9888c02a1219494828b805223d7a654d to your computer and use it in GitHub Desktop.
Save xtenduke/9888c02a1219494828b805223d7a654d to your computer and use it in GitHub Desktop.
Gnome AMD EGPU eject
# AMD EGPU EJECT GNOME
# I offer absolutely no warranty using this software
# Instructions:
# - Ctrl + Alt + F2 to enter console
# - run script as root
# - wait 5 seconds and unplug your egpu
# - wait for gdm to restart
#!/bin/bash
if [ "$EUID" -ne 0 ]
then echo "Please run as root"
exit
fi
echo "Stopping gdm3"
sudo service gdm3 stop
echo "Unloading amdgpu module"
sudo modprobe -r amdgpu
echo "Please disconnect egpu"
sleep 10
echo "Restarting gdm3"
sudo service gdm3 start
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment