karli-sjoberg / gswitch

BSD 3-Clause "New" or "Revised" License
91 stars 13 forks source link

gswitch boot service and shutdown bug #5

Closed pabloag5 closed 3 years ago

pabloag5 commented 4 years ago

Hello: I have been using gswitch for a while, initially I had issues at login (loop) which I managed to fix by not forcing Xorg commenting 'WaylandEnable=false' in /etc/gdm3/custom.conf, even though it always chooses Xorg. Then If I want to change from internal to egpu and viceversa (egpu is at home) I always have to reboot which is no big deal. However I have a problem with the gswitch boot service, I know is loading because every time I reboot the xorg.conf file has been removed and I have to run gswitch egpu at tyy before login in, so I believe the egpu is not loaded yet when the boot script is running and only sees one gpu (intel) from lspci output; how can I add a "waiting time" so the egpu loads before the script starts? My second issue is when I use only the external monitor the system wont shutdown and I have to force it manually or by sudo poweroff; if I work using both displays, laptop and external it shutdowns normally, but if I use just the external (close lid) then it wont shutdown. I have searched a little and it looks like is something related to nvidia drivers but I haven't managed to solve the issue.

My setup is: Dell XPS 9360 egpu Sonnet eGFX Breakaway box - Nvidia GTX 1060 Pop!_OS 19.04 - gnome 3.32.2 - gdm3 NVIDIA Driver: 435.21

Pablo

karli-sjoberg commented 4 years ago

Hey man! So cool to hear you using this on an entirely different platform and working anyway! Awesome!

Maybe that trick you pulled with gdm should be included by default so other people can use it as well? What do you think?

How come you can't just do "gswitch egpu" after boot? Do you have an idea why you have to reboot?

Ok, I get it, huh, that's a bummer... Let me think on that for a while. I could just add a "sleep" somewhere for the eGPU to have a chance to wake up but it could be done in a nicer way, I suppose. How have you installed it btw, have you pulled it directly from here or have added my repo, or what?

Last question is harder, I have no idea I'm afraid. I just have it plugged into my laptop and no external monitor around. I could use my TV as a secondary with my lid closed and test if I can reproduce your issue there, but it may very well be hardware specific, which would be harder to investigate.

/K

pabloag5 commented 4 years ago

Hey! How come you can't just do "gswitch egpu" after boot? Do you have an idea why you have to reboot? I can do "gswitch egpu" after boot but in TYY mode before X display server starts, if I logged in with internal gpu and run "gswitch egpu" in terminal it wont work in the current X server meaning it works but initializing a different X server (alt+ctrl+F#). What I understand is that gdm uses two X server instances, one for log in screen and another for desktop manager, different than lightdm that only uses one X server instance, so maybe there is some configuration done when the gdm desktop manager X server instance starts but that is as far as I understand, no idea where to update besides xorg.conf after initializing the desktop manager. How have you installed i I added the repo.

karli-sjoberg commented 4 years ago
--- gswitch 2019-10-18 17:10:17.476008659 +0200
+++ gswitch 2019-10-18 17:50:48.736011837 +0200
@@ -104,6 +104,7 @@
   ;;
   boot)
     MODE="internal"
+    sleep 10
     for HEX_ID in $(lspci | grep -i 'vga' | cut -f 1 -d ' '); do
       DEC_ID=""
       for HEX_VALUE in $(echo ${HEX_ID} | tr ':|\.' ' '); do

Could you test this monkey patch for starters to see if a sleep fixes the issue? Then we can start drilling down on the issue later.

pabloag5 commented 4 years ago

The sleep line works. The xorg.conf link is created. However, something changed, previously after I ran in TTY "gswitch egpu" the display manager (gdm) was active in both displays, so for example if I close the lid I could log in from the external monitor; now with the sleep line added the display manager only activates the internal display and once I logged in it activates the external display. What could be the reason of this? could it be something related to the reload process? is the only difference I see in the script.

karli-sjoberg commented 4 years ago

Ugh, I'd have to install plain Ubuntu to know that shrugs :smile: Maybe I can get my hands on a spare disk to test with, because I have no experience with GNOME/gdm, only KDE/SDDM.

Question: When you boot the computer, is the boot service working correctly?

Because with it enabled, it should switch to the eGPU by itself, without you having to execute 'gswitch egpu', is why I'm asking.

pabloag5 commented 4 years ago

I believe is working correctly. I am trying to give gdm a chance, but it looks like lightdm is more egpu friendly, probably I will give it a go and stop this suffering =D. I will let you know any additional progress.

Thank you

karli-sjoberg commented 3 years ago

Old issue, closing.