Notifications
Clear all

A script to change Xorg config  

 of  14
  RSS

Peter Spalthoff
(@peter_spalthoff)
New Member
Joined: 4 months ago
 

It has indeed been running perfectly fine during the few minutes I was able to test it so far.
My version of X1 Carbon only has a 1080p display, so maybe it'll be just fine.

Either way, the link you sent me indeed seems relevant, I think I can pick it up from there and see if I can make it work just for curiosity's sake!

Lenovo ThinkPad X1 Carbon 7th Generation, Intel i5-8365U CPU, Intel UHD 620 iGPU.
Razer Core X Chroma case, Nvidia GTX 1660 SUPER eGPU.
Arch Linux (5.6.15 currently)


ReplyQuote
Sebulon
(@sebulon)
Trusted Member
Joined: 2 years ago
 

@peter_spalthoff, please report back if you get it working! Always good to have information like that, just for reference!

 

To do: Create my signature with system and expected eGPU configuration information to give context to my posts. I have no builds.

.

ReplyQuote
eduncan911
(@eduncan911)
New Member
Joined: 1 month ago
 

Hello.  So I have a new Razer Core X and a Thinkpad X1 Carbon 6th gen, running Pop_OS 20.04 (aka Ubuntu 20.04).  Gswitch seems to have fixed all of my issues of sever 1 FPS lagging when forcing display only through the eGPU's HDMI output.  

However, I am having a problem going back to "internal" - especially when I shut the system down, grab it on my way out the door, and try to boot it up.

The system seems to try to launch the display manager, but doesn't... It just sits on the boot screen.

I force the system into single-user (init=/bin/bash), and try to run "gswitch internal", and reboot - but this does not help.

There are times where I am unable to "gswitch internal" before disconnecting the eGPU.  Even though I am shutdown.  

What would be a solution to force it back to "internal" in emergency/single user mode?

Razer Core X, AMD Vega 64, various 1x-to-4x HDMI-connected monitors
   |- Thinkpad P1, Pop_OS (aka Ubuntu) w/Regolith
   |- Thinkpad Carbon X1 6th Gen, Pop_OS (aka Ubuntu) w/Regolith
  ^- 2018 Macbook Pro 15", macOS High Sierra


ReplyQuote
Sebulon
(@sebulon)
Trusted Member
Joined: 2 years ago
 

@eduncan911

Hi!

Have you enabled the boot service that does this automatically for you?

# systemctl enable gswitch

 

To do: Create my signature with system and expected eGPU configuration information to give context to my posts. I have no builds.

.

ReplyQuote
eduncan911
(@eduncan911)
New Member
Joined: 1 month ago
 
Posted by: @sebulon

@eduncan911

Hi!

Have you enabled the boot service that does this automatically for you?

# systemctl enable gswitch

 

Oh my.. guilty for not reading the entire OP!  I just copied and ran the commands.  Will do that now!

Question: 

Do I enable the systemd service under my user account?  Or, under system?  I'm guessing system (with sudo) since gswitch needs sudo rights to do its thing.

Question:

How well would this work with Suspend and Hibernation?  I have both enabled on my systems.  Say, I was connected via eGPU, I go into suspend/hiberation, disconnect, and then power up?  Would the systemd service help with that too?

Suggestion:

Maybe put the systemctl enable command in a CODE block in the OP.  😉  You know, for those that didn't read the whole thing (like me - doh).  

Razer Core X, AMD Vega 64, various 1x-to-4x HDMI-connected monitors
   |- Thinkpad P1, Pop_OS (aka Ubuntu) w/Regolith
   |- Thinkpad Carbon X1 6th Gen, Pop_OS (aka Ubuntu) w/Regolith
  ^- 2018 Macbook Pro 15", macOS High Sierra


ReplyQuote
eduncan911
(@eduncan911)
New Member
Joined: 1 month ago
 

I am having some serious issues with ever since I installed/setup this gswitch script and systemd daemon.  It's caused hours of lost systems to lockups and unresponsive boots.

Pop_OS 20.04 (aka Ubuntu 20.04) with Regolith (aka i3wm + gnome session manager)
Thinkpad X1 Carbon 6th Gen

0. gswitch doesn't seem to do anything on my system without special kernel params.  I created a reddit post asking for help, which pointed me here for gswitch.  I have to use these kernel params to resolve my "1 FPS sever eGPU display lag when laptop lid is closed" issue.

pcie_ports=native pci=assign-busses,nocrs,realloc iommu=on

Without these parameters, gswitch doesn't change anything on my system when set to eGPU - it's still only 1 FPS on the gnome desktop.

What gswitch did do was to force my eGPU display on at all times, which is a positive sign it's doing something. 

1. When I can get it to boot with internal only, upon running "gswitch egpu", I am prompted to reload

$ sudo gswitch egpu
You are now set up. Would you like to reload? (Y/n)

If I press Yes to this, the entire system blanks the screen instantly and the entire system becomes unresponsive (Esc, CTRL-C, ALT-CTRL-DEL, caps lock/nums lock stop working, etc).  There is no recovery from this point: I have lost all of my sessions, browser windows, etc.  

Forced power off (hold power button 4 seconds), power back on, the system sometimes boots into eGPU land and everything is fine.  Other times, I am stuck in "Hell" described below.

2. I cannot "gswitch internal" regardless of any combination, setup, config, systemd unit running for gswitch, etc.  There is no combination I can find to safely allow me to switch to internal.

Instead, I am thrown to Hell (see below).  Switching to eGPU is a death signature signing up for Hell later on.  I don't want to accept this!  There's got to be something wrong here.

3. "Hell" when booting

There are various actions that causes me to be dumped into Hell:

* Running "gswitch internal", and pressing Y to reload - locks the system,I have to force reboot.
* Running "gswitch internal", and not pressing Y, and rebooting manually causes it to go into hell.
* If the system happens to go into Suspend, or Hibernation.
* Occasionally, after a few days of being powered on, sometimes the display comes on for a few moments and I'm able to login, and then the screen goes all artifacts.  Causing a forced reboot.

Now, what is hell?

* most systemd services failing to start on boot
* gdm fails to start (always)
* if it doesn't get to gdm start, the gswitch systemd service seems to be failing
* zero, absolutely zero recovery/boot process.  
* removing kernel params does nothing.  actually, makes it worse and doesn't even get to displays

I have found one, and only one way to recover from hell...  After doing this several dozen times (not kidding, I just had to do it a good 10 times this morning to get around and disable things):

* boot into emergency mode (on systemdboot, press SPACE to get menu to show)
* "e" to edit the default entry
* change "ro" to "rw" to have write access to root drive
* add this to the end of the kernel line (no quotes): "systemd.unit=emergency.target"
* press ENTER for maintenance prompt
* at the root prompt, enter "gswitch internal"
* do NOT press "Y", it will lock system (as usual)
* unplug laptop (short 24" TB3 cable from Razer doesn't allow me to move the laptop much)
* safely reboot with "systemctl reboot"

And hope that it boots to the gdm.  sometimes, this still fails and locks the system still - and I have to start all over in Hell.

Here's a glimpse of hell.

^- The system becomes entirely unresponsive.  No rebooting, no alt-ctrl-del, no CAPS/Num lock lights working any longer.  It's a hard lockup.

These happen almost always if I reboot, regardless if set to "internal" or "egpu."  I cannot find a clean way to reboot safely into either mode.

Instead, if I need to reboot (or more often than not, a complete system freeze), I'm signing a death warrant that I'll have to boot into emergency mode and force the system into "internal", and hope it boots the next time.  Get it booted and logged in with "internal", use gswitch to switch back to "egpu", and reboot one last time - crossing fingers.  <- that's what I have to do on every reboot.

To be perfectly clear: All of those failed services start normally with no TB3 connected, no eGPU, and no gswitch systemd service running.  My system typically boots very clean.

---

Just, just to eliminate if this is my system or not, this morning I spent the time installing Pop_OS 20.04 onto a SFF harddrive, with regolith.  Exact same issues! 

If these are common problems, please feel free to point me to existing threads/comment #s.  I searched this thread and poked around the pages and didn't see anything like this.

If this is not common, could you tell me how to completely purge gswitch from my system?  I'll try the other one.  But I don't want any conflicts if I go try the other. 

This post was modified 4 weeks ago

Razer Core X, AMD Vega 64, various 1x-to-4x HDMI-connected monitors
   |- Thinkpad P1, Pop_OS (aka Ubuntu) w/Regolith
   |- Thinkpad Carbon X1 6th Gen, Pop_OS (aka Ubuntu) w/Regolith
  ^- 2018 Macbook Pro 15", macOS High Sierra


ReplyQuote
nu_ninja
(@nu_ninja)
Reputable Member
Joined: 2 years ago
 

@eduncan911

To remove gswitch, purge the ppa (if you installed it that way) or follow the uninstall instructions from the github page if you got it from there.

What you are experiencing isn't an issue I've seen before. It seems like you have an underlying issue with getting the egpu working properly with the system. I think Lenovo had a problem with their thunderbolt firmware so make sure you have applied all software and firmware updates. You should try and fix that issue before using either of our forum's scripts (as both do similar things)

Mid-2012 13" Macbook Pro (MacBookPro9,2) TB1 -> RX 460/560 (AKiTiO Node/Thunder2)
+ macOS 10.15+Win10 + Linux Mint 19.1

 
2012 13" MacBook Pro [3rd,2C,M] + RX 460 @ 10Gbps-TB1 (AKiTiO Thunder2) + macOS 10.14.4 [build link]  


ReplyQuote
Sebulon
(@sebulon)
Trusted Member
Joined: 2 years ago
 

@eduncan911, I'm sorry to hear about the issues you are having with this tool! As @nu_ninja says, just follow the instructions to uninstall the software again if that's what you want. In response, I'd just like to explain why I think a lot of your frustration seems to be rooted in confusion about how this tool works.

First of all, I have explained that I'm forcing, with udev rules, the laptop to 'OK' all thunderbolt that gets connected. In another laptop, a Thinkpad X280, I've also set it like that, but in BIOS, to accomplish the same goal. Is it secure and recommended? Heck no! But should you at least test it to see whether it helps your situation? Yes, I think so!

Second, and maybe most importantly, I wanted you to test enabling the gswitch.service, which it seems as if you've now done. Then you run 'gswitch internal' and then reboot with the eGPU still connected. What then happens is that the boot service will fire up during boot, see you still have the eGPU connected and makes the assumption that's what you want to use! If this is undesired behaviour, disable 'gswitch.service' again, that's what making this happen for you!

Thirdly, about the suspend while connected, I haven't thought about it, honestly, I've disabled suspend and sleep while on AC. Anyone else?

Lastly, if you have a spare drive, how about installing a distro that maybe works better, like Kubuntu e.g, for which it was written for?

 

To do: Create my signature with system and expected eGPU configuration information to give context to my posts. I have no builds.

.

nu_ninja liked
ReplyQuote
nu_ninja
(@nu_ninja)
Reputable Member
Joined: 2 years ago
 

@sebulon

Yeah I have suspend disabled on AC as well

Mid-2012 13" Macbook Pro (MacBookPro9,2) TB1 -> RX 460/560 (AKiTiO Node/Thunder2)
+ macOS 10.15+Win10 + Linux Mint 19.1

 
2012 13" MacBook Pro [3rd,2C,M] + RX 460 @ 10Gbps-TB1 (AKiTiO Thunder2) + macOS 10.14.4 [build link]  


ReplyQuote
edgibbs
(@edgibbs)
New Member
Joined: 4 days ago
 

Hey - when I run sudo gswitch egpu I get the following error:

ln: failed to create symbolic link '/etc/X11/xorg.conf': File exists

xorg.conf does in fact exist, I think it should, no?  This is what is in it:

Section "ServerLayout"
Identifier "Layout0"
Screen 0 "Screen0"
InputDevice "Keyboard0" "CoreKeyboard"
InputDevice "Mouse0" "CorePointer"
EndSection

Section "Files"
EndSection

Section "InputDevice"
# generated from default
Identifier "Mouse0"
Driver "mouse"
Option "Protocol" "auto"
Option "Device" "/dev/psaux"
Option "Emulate3Buttons" "no"
Option "ZAxisMapping" "4 5"
EndSection

Section "InputDevice"
# generated from default
Identifier "Keyboard0"
Driver "kbd"
EndSection

Section "Monitor"
Identifier "Monitor0"
VendorName "Unknown"
ModelName "Unknown"
Option "DPMS"
EndSection

Section "Device"
Identifier "Device0"
Driver "nvidia"
VendorName "NVIDIA Corporation"
EndSection

Section "Screen"
Identifier "Screen0"
Device "Device0"
Monitor "Monitor0"
DefaultDepth 24
SubSection "Display"
Depth 24
EndSubSection
EndSection

As an experiment, I renamed it and ran sudo xswitch egpu and this time it worked with no error.  But when I restarted x I got the black screen.  Could not switch to a console either, so I rebooted into recovery mode and put the original file back.

What am I doing wrong?

Ed Gibbs

This post was modified 3 days ago

To do: Create my signature with system and expected eGPU configuration information to give context to my posts. I have no builds.

.

ReplyQuote
 of  14