Connect/Mount eGPU using command line
Is this the most up-to-date solution right now? I have tried the script and am using sleepwatcher to unload the kext on sleep and load the kext on wake. The sleep portion works fine, but the problem is when I try to wake the machine, my eGPU reconnects fine but all the I/O for my Razer Core X Chroma acts wonky/doesn't work. Is there something extra I need to do to get this working as needed?
I would like to ask you, if is this solution still working under Catalina (10.15.6)? I try to use it but when I follow mac_editor's guide and try to "Disable Thunderbolt PCI stream" I see this message:
(kernel) Can't remove kext com.apple.driver.AppleThunderboltPCIUpAdapter; services failed to terminate - 0xe00002c7.
Failed to unload com.apple.driver.AppleThunderboltPCIUpAdapter - (iokit/common) unsupported function.
Command for re-enabling PCI stream doesn't show any error but the eGPU doesn't connect anymore. I have to physically unplug TB3 cable.
PS: nu_ninja's apple script has the same error.
Yeah it doesn't work for me anymore, it seems like Apple changed it so system kexts can't be unloaded anymore
the post helped me to understand the SafeEjectGPU command.
I have a simple sleep script which sets the MacBook Pro 2015 to sleep running without admin Privileges (the echo password hack is really unsecure...)
echo <password> | sudo -S SafeEjectGPU Eject
echo "Disconnect eGPU"
osascript -e "tell application \"Finder\" to sleep"
It first unmounts the eGPU and then sets the MacBook to Sleep. If you then wait another 10 seconds or so, the fans go off an my Macbook really sleeps. I can now physically switch off the Razer box.
(Otherwise it does not turn off, like it would do if you unconnect the UBS3/TB3 cable. As long as the TB2/TB3 adapter is still plugged into the Razer, it powers the AMD card.)
I can now also savely unplug the TB connector and take the Macbook away. If I just switch the Razer power on again and then touch the Macbook (any key or the touchpad), it first wakes up, and then automatically finds the Razer box again and reconnects the AMD eGPU.
I do not get the "unsafely unconnect eGPU" notification!
It may appear if you unplug the TB2 connection or switch off the power at the Raze too quickly.
Actually it seems like Catalina improved the procedure, or it might has something todo with the natively supported AMD card (5700XT is officially supported since 10.15).
Hope this helps!