Notifications
Clear all

A script to change Xorg config  

 of  14
  RSS

wiliam969
(@wiliam969)
New Member
Joined: 2 months ago
 

Hello,

After using hertg script for almost a year i wanted to try out your implementation, as i was keen to see if I can switch between the gpu's simply by using one command or the GUI. Due to Focal Focca I upgraded to 20.04 and the PPA available for this release. Any chance of releasing your script to 20.04 in the future?

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

.

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

@wiliam969, Yeah, of course!

Sure, I can do that, it's just that I don't personally upgrade until my distribution (KDE Neon) does it, but I can upload new source files for 20.04 to have new packages built so you can tell me how it goes!

I make no promises it will be of any success as to switching graphics, (hopefully) a lot has changed over the past two years or so it's been around. I was sort of hoping this tool wasn't going to be necessary any more, but as long there's a use for it, it'll be there!

 

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

.

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

@wiliam969, Hi again!

The packages are now pubslished! Let me know how it goes!

 

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

.

ReplyQuote
Xevien 96
(@xevien_96)
New Member
Joined: 2 months ago
 

@sebulon, just tried your script on Ubuntu 20.04
first I set it up by getting the gui via apt as instructed in your first post in this thread. everything worked fine until I enabled the service (systemctl enable gswitch). After I enabled the service the Laptop would be painfully slow if the egpu wasn't attached. I tried every combination of setting it to egpu and internal while previously being connected or not. Same result each time... slow.

So I purged everything. The Laptop was fast again. So I tried the script without gui (apt install gswitch). I tried setting up the egpu. Everything worked fast and flawless as before (before i enabled the service).

So I thought about using it without the service... but that would be painful on the go if I forgot to turn to internal. So I enabled the service again and this time everything is going normal even with the service running. No noticeable performance loss anymore.

I tried it with every combination of set to internal/ egpu, connecting it or not before boot. It worked the same (fast and flawless) under all circumstances. So I have no idea if the gui or anything caused the slowdown or not. I could not reproduce the effect without the gui, but with a sample size of just one I wouldn't blame the gui. (and I wouldn't know how the gui should cause it at all ^^)

The other script on this site (egpu-switcher) would leave my Laptop with bad artifacts if the egpu wasn't connected. Yours just works.

Thanks for the work you put into this, stay healthy Smile

 

PS: My setup is a Dell XPS 13 7390 i7 10510U connected to a Razer Core with RTX 2070 inside running Ubuntu 20.04.

 

This post was modified 2 months ago

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

.

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

@xevien_96

all the GUI does is to call the script underneath, so I'm having a hard time seeing how that could make a difference, but I'm glad to hear you got it working in the end! Thank you for the words of encouragement! Take care!

 

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

.

ReplyQuote
Peter Spalthoff
(@peter_spalthoff)
New Member
Joined: 1 month ago
 

First of all, thanks a ton Sebulon for the gswitch script! It worked for me out of the box on my system:

As seems intended from what I understand from the `xorg.conf.egpu`, the internal screen is turned off when the eGPU is used with an external display.
Ideally, I would like the internal screen to be run by the Intel iGPU. This seems to be working on my dual-booted Windows installation.

I have tried messing around with the 'xorg.conf.egpu' file (see below) that is linked by your awesome script to 'xorg.conf' when the eGPU is used,
but so far I only get a flashing cursor on my internal display and nothing on the external one.
At this point I need to hard-reboot the laptop to get back to working shape, which makes experimentation cumbersome.

This is my first time dealing with xorg in more detail, and if someone could point me in the right direction that would be super appreciated!

The 'xorg.conf' below is pieced together from different pages and threads, so there might be redundant/unnecessary lines such as the options in the "external" screen section.
The BusIDs are correct to the best of my knowledge, but the ouput of `lspci | grep VGA` can be seen below.

Spoiler
xorg.conf
Section "ServerLayout"
  Identifier  "Layout0"
  Screen 0    "internal" 0 0
  Screen 1    "external" 3000 0
EndSection

Section "Screen"
  Identifier  "internal"
  Device      "iGPU"
EndSection

Section "Screen"
  Identifier  "external"
  Device      "eGPU"
  Option      "AllowEmptyInitialConfiguration" "on"
  Option      "Coolbits" "4"
  Option      "ConstrainCursor" "on"
EndSection

Section "Device"
  Identifier  "iGPU"
  Driver      "intel"
  BusID       "PCI:00:2:0"
EndSection

Section "Device"
  Identifier  "eGPU"
  Driver      "nvidia"
  BusID       "PCI:10:0:0"
  Option      "AllowEmptyInitialConfiguration"
  Option      "AllowExternalGpus" "True"
EndSection
Spoiler
lspci | grep VGA
00:02.0 VGA compatible controller: Intel Corporation UHD Graphics 620 (Whiskey Lake) (rev 02)
0a:00.0 VGA compatible controller: NVIDIA Corporation TU116 [GeForce GTX 1660 SUPER] (rev a1)

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, And thank you for the kind words, it's awesome hearing that people are enjoying it!

Posted by: @peter_spalthoff

As seems intended from what I understand from the `xorg.conf.egpu`, the internal screen is turned off when the eGPU is used with an external display.

Actually no, when set to eGPU, it renders all of the displays you have connected!

 

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

.

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

@peter_spalthoff

I would go back to the original xorg.conf from the script, which you said was working for you? You shouldn't need to modify this xorg.conf to get the internal display working. If the laptop's display remains black, you can try manually setting xrandr to output to both screens. Something like:

xrandr --output HDMI1 --auto --output eDP1-1 --auto --right-of HDMI1

where HDMI1 and  eDP1-1 would be the labels of the screens from xrandr.

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
Peter Spalthoff
(@peter_spalthoff)
New Member
Joined: 1 month ago
 

Thanks @sebulon and @nu_ninja for your fast replies!

I was sure I had tried enabling my internal display via xrandr (via arandr) and that it did not work.

Turns out I was wrong, and you guys were right! =D
I have heard that powering the internal display from the eGPU is not ideal due to the data transfer, but I'm not looking for performance when I'm on my arch system anyways.

I probably won't try this now, but for future reference, would it be possible to use the iGPU for the internal display by modifying the xorg.conf, all while using gswitch to go turn the eGPU on/off?
Not asking for a "correct" xorg.conf, just whether it is possible so I can try and figure it out later.

 

This post was modified 1 month ago

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

Posted by: @peter_spalthoff

I have heard that powering the internal display from the eGPU is not ideal due to the data transfer, but I'm not looking for performance when I'm on my arch system anyways.

That generation X1 Carbon has a true 4x PCIe 3.0, like my P50 has and I have no performance issues whatsoever, at least at 1080p, but that's more than enough for me.

About having the iGPU render the laptop screen and eGPU the rest, perhaps something along these lines?
https://forum.manjaro.org/t/tv-is-not-seen-when-plugged-with-hdmi-cable/11589/4

 

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