[Sticky] A script to change Xorg config  

Page 2 / 2 Prev
  RSS

Sebulon
(@sebulon)
Eminent Member
Joined: 3 months ago
Posts: 25
December 6, 2018 5:14 am  

@mzo

What Ubuntu version are you running?

To remove the repo:

# sudo add-apt-repository --remove ppa:karli.sjoberg/gswitch-ppa

Pending: Add my system information and expected eGPU configuration to my signature to give context to my posts


ReplyQuote
mzo
 mzo
(@mzo)
Active Member
Joined: 2 years ago
Posts: 13
December 12, 2018 11:44 pm  

@sebulon

Thanks, later today I'll try again. I'm running 18.10 cosmic with the latest mainline kernel.

Regarding the Nvidia drivers, I still haven't managed to have them working. However, I found several posts of people that have exactly the same problem. I will try some of the solutions suggested.

My other problem is with my AMD dGPU. The amdgpu driver is not stable on my system. The card overheats and produces frequent kernel freezes. I tried countless solutions to fix this with no luck (including fresh ubuntu reinstalls, etc). The problem is even there when I boot Ubuntu from live usb (tried 18.04 and 18.10, same problem). I had my MacBook Pro inspected by Apple to check if there were hardware issues but it looked all good. That being said, if I understand correctly, the Nvidia Prime feature uses the dGPU (or iGPU when available) to render on the screen the graphic that is being processed by the external GPU. If that is the case, if I manage to have the Nvidia drivers loading, do you think my unstable dGPU problem will persist even though I'm using the Nvidia eGPU with your script?

Finally, I tried a workaround to activate the intel iGPU and use that instead of the dGPU because by default recent Mac hardware disable the iGPU if you boot anything that is not MacOS. This worked, the iGPU was used instead of the dGPU (resolving the kernel freezes issues). However, this solution was very "invasive" as it modifies EFI stuff and MacOS boot files and rendered MacOS irreversibly un-bootable (I had to do a fresh reinstall). This solution is discussed here:  https://sourceforge.net/p/refind/discussion/general/thread/84a55c48/

My plan is to fix the Nvidia drivers problem, and, through your script, use my Nvidia eGPU as my only graphic solution for Ubuntu. Do you think it's doable to use the eGPU for everything despite the iGPU being inactive and not recognized by default and the dGPU having driver problems?

Thank you!

Pending: Add my system information and expected eGPU configuration to my signature to give context to my posts


ReplyQuote
Sebulon
(@sebulon)
Eminent Member
Joined: 3 months ago
Posts: 25
December 13, 2018 9:55 am  
Posted by: mzo

@sebulon

Thanks, later today I'll try again. I'm running 18.10 cosmic with the latest mainline kernel.

As I thought, that explains the issues you were having with the PPA. I have only submitted packages for "bionic", as that is the long term supported version. But I can invest the time to submit packages for "cosmic" as well, if you´re interested?

Posted by: mzo

... if I manage to have the Nvidia drivers loading, do you think my unstable dGPU problem will persist even though I'm using the Nvidia eGPU with your script?

It also explains why my instructions and the commands don´t work as you´re on a different Ubuntu version than what I have tested and know work. And the kernel included in "cosmic" is 4.18, so not much difference to the mainline 4.19 kernels I wanted you to install then. See below for answer about eGPU

Posted by: mzo

Do you think it's doable to use the eGPU for everything despite the iGPU being inactive and not recognized by default and the dGPU having driver problems?

Thank you!

The driver problems comes from using the hardware. If you are only using the eGPU then I would imagine the dGPU wouldn´t bother you any more. With that said, I cannot test this for you as I have a different computer than you have.

Pending: Add my system information and expected eGPU configuration to my signature to give context to my posts


ReplyQuote
Sebulon
(@sebulon)
Eminent Member
Joined: 3 months ago
Posts: 25
December 13, 2018 1:36 pm  

Never mind, I got carried away and got packages published for "cosmic" too 😉

Pending: Add my system information and expected eGPU configuration to my signature to give context to my posts


theitsage liked
ReplyQuote
(@paul_griz)
New Member
Joined: 2 months ago
Posts: 2
January 3, 2019 5:21 pm  

First off, thank you! I have a MSI GS73-Stealth-8RF laptop with both i7-8750H / GTX 1070 graphics integrated. 
I'm connecting a GTX 1080Ti with two monitors via the Sonnet eGFX Breakaway 550.


I tried to configure Nvidia Optimums and Nvidia Bumblebee drivers without success.
Next, I tried manually configuring two X Server configurations. This worked.
However, I had to make shell scripts to switch between sessions, and it was not stable. 
After wasting time trying to make this process seamless, I found this form and installed your program. 
You're program works perfectly!
  


If you would like, I'll design a logo for the program and write-up some documentation for the README. 


Edit you should make for the original post for new comers:
When you query for GPUs now:
nvidia-xconfig --query-gpu-info
A 1080ti GPU is now returned as: 1080 Ti with a space and a capital T.

My Hardware

Laptop: MSI GS73-Stealth-8RF
eGPU Enclosure: Sonnet eGFX Breakaway Box 550w
GPU: GTX 1080 Ti


ReplyQuote
Sebulon
(@sebulon)
Eminent Member
Joined: 3 months ago
Posts: 25
January 16, 2019 6:32 am  
Posted by: Paul Griz

First off, thank you!

You're most welcome! I did it just for fun and it happened to be a successful project 🙂 

Posted by: Paul Griz

You're program works perfectly!

Yeay, that makes me so happy to hear! Of course I'm using it myself, so I know that it works for me but hearing it from others is awesome!

Posted by: Paul Griz

If you would like, I'll design a logo for the program and write-up some documentation for the README.

Heck yeah, go wild!  😀 Pull requests are most welcome!

Posted by: Paul Griz

Edit you should make for the original post for new comers:
When you query for GPUs now:
nvidia-xconfig --query-gpu-info
A 1080ti GPU is now returned as: 1080 Ti with a space and a capital T.

Very good to know, I'll edit that pronto!

Pending: Add my system information and expected eGPU configuration to my signature to give context to my posts


theitsage liked
ReplyQuote
(@richard_le)
New Member
Joined: 2 months ago
Posts: 3
January 18, 2019 10:54 am  

Hey Sebulon thank you so much, this script solve a big problem for me!!!

I have a question though I am away from my egpu right now and forgot to switch back to internal? after i log in it just loops. How do I get around this?

Pending: Add my system information and expected eGPU configuration to my signature to give context to my posts


ReplyQuote
(@paul_griz)
New Member
Joined: 2 months ago
Posts: 2
January 18, 2019 4:03 pm  
Posted by: Richard Le

Hey Sebulon thank you so much, this script solve a big problem for me!!!

I have a question though I am away from my egpu right now and forgot to switch back to internal? after i log in it just loops. How do I get around this?

How to Fix the Login Loop:

At the login screen, you can open a terminal before loading the GUI.

  1. Simply hit: CTRL+ALT+F1 
  2. Enter your login username
  3. Enter your password

From here, you can switch between your eGPU / Internal GPU:

  • For eGPU: sudo gswitch egpu
  • For Internal: sudo gswitch internal

Then, I suggest you reboot. 


Cool Tip: 

You can run up to 6 terminals by CTRL+ALT+F[X] where [X] is 1-6. Example: CTRL+ALT+F3 
To leave the terminal and load the GUI: CTRL+ALT+F7 

Final Notes: 

The CTRL+ALT+F1 command for launching a terminal at the login screen works for most desktop environments. 
If it isn't loading a terminal, just Google, "command line at login [X]" where [X] is your desktop environment.

My Hardware

Laptop: MSI GS73-Stealth-8RF
eGPU Enclosure: Sonnet eGFX Breakaway Box 550w
GPU: GTX 1080 Ti


ReplyQuote
(@richard_le)
New Member
Joined: 2 months ago
Posts: 3
January 18, 2019 10:38 pm  

thanks for pointing me in the right direction, ctrl + alt + f1 does not work for me on Pop OS! which is based of ubuntu. I currently unable to find command line log in for pop os via web search, so I have posted on their reddit forum and  awaiting their response

Pending: Add my system information and expected eGPU configuration to my signature to give context to my posts


ReplyQuote
nu_ninja
(@nu_ninja)
Estimable Member
Joined: 11 months ago
Posts: 121
January 18, 2019 11:23 pm  

@richard_le

I do something like this to drop down to runlevel 3 before booting. Then run the gswitch command and restart normally.

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


ReplyQuote
(@richard_le)
New Member
Joined: 2 months ago
Posts: 3
January 18, 2019 11:36 pm  

Does this apply to pop os?

Since they moved to systemd and do not use grub

Pending: Add my system information and expected eGPU configuration to my signature to give context to my posts


ReplyQuote
nu_ninja
(@nu_ninja)
Estimable Member
Joined: 11 months ago
Posts: 121
January 19, 2019 1:36 am  

I think the runlevel command should work even though run levels don't actually exist any more. Otherwise the systemd equivalent is the boot parameter 

systemd.unit=multi-user.target

this should work regardless of your bootloader so long as you're somehow able to add boot parameters.

This post was modified 1 month ago

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


ReplyQuote
nu_ninja
(@nu_ninja)
Estimable Member
Joined: 11 months ago
Posts: 121
January 23, 2019 12:14 am  

In case anyone is looking for a way to avoid the above mentioned login loop in the future, I found using a modification of the script from this thread works. If you use my example xswitcher file from the post it basically just automatically calls gswitch at boot for you.

This post was modified 4 weeks ago

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


ReplyQuote
Sebulon
(@sebulon)
Eminent Member
Joined: 3 months ago
Posts: 25
January 23, 2019 7:01 am  
Posted by: nu_ninja

In case anyone is looking for a way to avoid the above mentioned login loop in the future, I found using a modification of the script from this thread works. If you use my example xswitcher file from the post it basically just automatically calls gswitch at boot for you.

Yeah, nice collaboration indeed!

I´m unsure however, if I´d like to have this thing just happen automatically. I mean, I´m not against it, it just feels like it is something I´d like to have total control over when and how the switch happens. At the moment of writing, the "xswitcher" script just counts the number of GPU's and triggers if the number is more than 1, which also would need improvement since my laptop, and many others have 2 builtin: 1 iGPU and 1 dGPU as well. It needs a more universal way of knowing if you have a GPU specifically coming over a thunderbolt connection. I´m also wondering how the script should "know" when it is being run at startup compared to when it is run on demand, to sort out whether or not it should trigger a restart of the login manager. Ideas, anyone?

Pending: Add my system information and expected eGPU configuration to my signature to give context to my posts


ReplyQuote
nu_ninja
(@nu_ninja)
Estimable Member
Joined: 11 months ago
Posts: 121
January 23, 2019 11:57 pm  

@sebulon

I agree it feels wrong to use the script in that way. I could add a check using the command:

tbtadm devices

so that it requires a thunderbolt device to be connected?

Edit: looks like boltctl is actually the command that comes with Ubuntu
Edit2: Or maybe just checking for the bus ID from the xorg configuration file would be easiest? So do lspci | grep "[busID]"
Edit3: Changed my example.txt file to a check against the busID from the xorg configuration

This post was modified 4 weeks ago

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


ReplyQuote
Sebulon
(@sebulon)
Eminent Member
Joined: 3 months ago
Posts: 25
February 4, 2019 7:07 am  
Posted by: nu_ninja

@sebulon

I agree it feels wrong to use the script in that way. I could add a check using the command:

tbtadm devices

so that it requires a thunderbolt device to be connected?

Edit: looks like boltctl is actually the command that comes with Ubuntu
Edit2: Or maybe just checking for the bus ID from the xorg configuration file would be easiest? So do lspci | grep "[busID]"
Edit3: Changed my example.txt file to a check against the busID from the xorg configuration

First of all, sorry for not answering sooner, I have been trying to log in to this forum for like two weeks now, intermittently. I finally managed to get the password reset...

Yeah, something along those lines, just beware that 'lspci' and 'xorg' config use different '[BusID]' formats, which is why I've used the 'nvidia-xconfig' command to list the graphics cards. The output from 'lspci' is in hexadecimal form, whereas the '[BusID]' in the 'xorg'-config needs to be in decimal and I've just been to lazy to convert the output and used 'nvidia-xconfig' instead 🙂 In many cases, the hexadecimal and decimal output are the same, but in somecases, you might have a GPU with '0a:00:00' that has to be converted into '10:0:0'.

What's missing is how to figure out which card is the external one, without necessarily knowing what it is. I mean, 'lspci' and 'nvidia-xconfig' or whatever shows PCI devices and makes no distinction whether they are internal or connected via Thunderbolt. 'tbtadm' could solve that, but it's another dependency to worry about. Would be nicer to be able to figure it out without it though.

/Sebulon

This post was modified 2 weeks ago

Pending: Add my system information and expected eGPU configuration to my signature to give context to my posts


ReplyQuote
Spiro
(@spiro)
Active Member
Joined: 2 weeks ago
Posts: 5
February 5, 2019 5:39 pm  

Hello everyone,

Sorry for repost (since I also posted on reddit) but I'm really confused with all of this because of variations in distro, gpu brand, TB version etc etc.

Could someone help me out? Really lost in this.

I have the following setup:
Linux Manjaro, kernel 4.19, DE Xfce
i7-8550, integrated intel uhd 620 (so, no discrete gpu which makes it easier I guess)
Thunderbolt 3
Mantiz Venuz + amd rx 580 and I want to use amdgpu and vulkan stuff.

Care to help me with a step by step? I've seen so many threads on so many places that I can't understand what to do in my particular case. I only want to have external display when egpu is plugged in.
How can I install the scripts (gswitch and others mentioned) given that I can't use ppa/deb on manjaro (arch derivative)? I need to build from scratch? Add something to config files manually? (Noob at tinkering with stuff on linux).
1 - plug in, find egpu with
lspci | grep VGA

2 - How to authrize the connection for TB3 using information from 1?
3 - How to install/add scripts (from ninja, sebulon or morv)??
4 - how to plug / unplug? (during boot, after,??)

I'm really desperate. Everywhere I look things are done differently. I just want it to work..... I'm not good at playing with the system at all.... I'll get you coffee!!!
Thanks in advance, kinda desperate.

Pending: Add my system information and expected eGPU configuration to my signature to give context to my posts


ReplyQuote
Spiro
(@spiro)
Active Member
Joined: 2 weeks ago
Posts: 5
February 5, 2019 11:58 pm  

Ok so I managed to install the scripts. I edited the xorg.conf.egpu to replace "amdgpu" and Bus ID (I got something like 09:00:0 which I also replaced in the conf.egpu. I guess it is correct value already? Took it from lscpi | grep VGA). I can use

sudo gswitch egpu

and

sudo gswitch internal

and I get the image through the external screen.

 

I only have 2 problems:

 

1 - the image on the external display blinks every "x" seconds. How can I solve this?
2 - after I do sudo gswitch internal, and get the image back on internal screen, am I supposed to unplug right after running the command or after I shutdown the laptop?

Pending: Add my system information and expected eGPU configuration to my signature to give context to my posts


ReplyQuote
Sebulon
(@sebulon)
Eminent Member
Joined: 3 months ago
Posts: 25
February 6, 2019 6:40 am  

Hey @Spiro, welcome aboard!

Posted by: Spiro

I'm not good at playing with the system at all....

Not to be a downer here, I'm saying this in the most friendly, helpful way, that if you want "Just works", then Manjaro may not be the best fit for you? But if you're willing to endure the pain and do a lot of digging and research (trail and error, basically), then you also have the chance to learn a lot.

However, I believe that knowledge must be acquired by yourself, for yourself- I won't do your homework for you.

I will tell you this much though, there isn't a right way to do this, there are many. There aren't any "best practices". You have to figure out what works on the distribution you're currently using, they all have their quirks. And as my mother use to say "Break down, get back!". If you aren't getting anywhere, maybe taking a step back, use something "easier" for a while, to get a sense of why that's working and then try again. Stubbornness is the key. Stubborn as hell 🙂

This post was modified 2 weeks ago

Pending: Add my system information and expected eGPU configuration to my signature to give context to my posts


ReplyQuote
Spiro
(@spiro)
Active Member
Joined: 2 weeks ago
Posts: 5
February 6, 2019 9:19 am  

Thank you @Sebulon !!
You were referring to my first reply I guess?
Did you see my second reply to this thread? Just above yours. I got almost everything working!!

 

Only issue is the external screen blinking/flickering when egpu is connected. I've been trying a couple of stuff but still trying to figure it out. I've seen related issues but not in the egpu context. Things related to power management, kernel boot parameters, xorg config options, drivers, etc etc. Some add to xorg an extra config with "radeon" instead of "amdgpu".

So I actually did the homework and your scripts were super important. I hope you don't mind but since Gswitch-GUI on my system had no app icon I chose your profile pic for app launcher. Works really well.

If I get this only issue solved I'll add my build including your links.

This post was modified 2 weeks ago

Pending: Add my system information and expected eGPU configuration to my signature to give context to my posts


ReplyQuote
Sebulon
(@sebulon)
Eminent Member
Joined: 3 months ago
Posts: 25
February 6, 2019 9:37 am  
Posted by: Spiro

Thank you @Sebulon !!
You were referring to my first reply I guess?
Did you see my second reply to this thread? Just above yours. I got almost everything working!!

 

Only issue is the external screen blinking/flickering when egpu is connected. I've been trying a couple of stuff but still trying to figure it out. I've seen related issues but not in the egpu context. Things related to power management, kernel boot parameters, xorg config options, drivers, etc etc. Some add to xorg an extra config with "radeon" instead of "amdgpu".

So I actually did the homework and your scripts were super important. I hope you don't mind but since Gswitch-GUI on my system had no app icon I chose your profile pic for app launcher. Works really well.

If I get this only issue solved I'll add my build including your links.

My reply regarded both actually, let me clarify. If you're stuck but confident you have done everything as "right" as you possibly can, taking a step back and trying out another distro gives a good perspective. Let's say you try out Kubuntu 18.04, install my PPA and the gswitch packages, change the driver from "nvidia" to "amdgpu" and it works, without any flickering or anything. Then you can start comparing; why does it work now, but not before? It's just software you know, nothing magic about it. Same software, but perhaps different build options, versions are different, etc, etc. Those things. And I'm not talking about my stuff, but all of the stuff around it.

Regarding the icon image, as long you keep it a secret from Production I.G, neither of us are going to get sued for copyright violation 🙂

Good luck with it!

Pending: Add my system information and expected eGPU configuration to my signature to give context to my posts


theitsage liked
ReplyQuote
(@michael_watkins)
New Member
Joined: 4 days ago
Posts: 2
February 19, 2019 2:07 am  

I finally got this working my only issue is the switching doesn't seem to work too well. My screen just blinks and never actually loads. It just freezes and I have to reboot manually by pressing the power button .

Pending: 2018 Razer Blade 15 / Razer Core v2 my signature to give context to my posts


ReplyQuote
nu_ninja
(@nu_ninja)
Estimable Member
Joined: 11 months ago
Posts: 121
February 19, 2019 3:50 am  

In my experience, how well the switching works depends on your display manager. Lightdm works great, gdm3 doesn't always work so well.

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


ReplyQuote
Sebulon
(@sebulon)
Eminent Member
Joined: 3 months ago
Posts: 25
February 19, 2019 4:55 am  
Posted by: Michael Watkins

I finally got this working my only issue is the switching doesn't seem to work too well. My screen just blinks and never actually loads. It just freezes and I have to reboot manually by pressing the power button .

Hey man, glad you got it working! For me that happens when I plug the eGPU in after I've booted. If I plug it in before booting it up, the switching works no problemo 🙂

Pending: Add my system information and expected eGPU configuration to my signature to give context to my posts


ReplyQuote
Page 2 / 2 Prev