A script to change Xorg config
For many users, eGPU is less than plug and play. In my case, I already have two internal GPU's, and have to fiddle with Xorg configs some way or another, and it's a pick and choose. You can have the onboard (either the integrated or the discrete) GPU render the laptop screen and have the eGPU render an external screen, or you can have the eGPU render both, or something else of your choosing, but not dynamically, sadly.
The way I've solved it is to have an Xorg config that makes the eGPU render both the laptop screen and any external screen(s) that may be connected and when I want to use the eGPU, I have:
And then create a symbolic link to /etc/X11/xorg.conf, plug in the eGPU, reload and done. But after a while, the manual steps started to bore me and remembered the old saying: "One time is none. Two times is a script!"
And then I got a "little" carried away and wanted to learn how to write QT GUI applications Thing is, I can´t learn just by reading the documentation and look at examples, I have to have "a mission" to set out on and this was the perfect task to get me going!
And then I wanted to make the installation process even easier for new users, so I invested some time to learn how to make .deb packages out of the binaries:
So you can clone, edit and then build these packages yourselves! I have setup a PPA for this to make the process as easy as humanly possible!
Here's how to set it up in Ubuntu:
Or if you're running openSUSE:
Just replace the version with whatever you're running. If something's missing or not quite right, give me shout and I'll make sure to fix it!
Then you run the friendly setup routine:
After that you´re all set! When you want to use the eGPU, you just run:
The laptop will reload the screen, so make sure to save everything open before doing so! And when you´re done, you run:
It will reload and you can disconnect the eGPU.
Or if you´d rather want to use the GUI, open your applications menu and look under System 😉
This package also comes with automatic detection of eGPU at boot!
After gswitch has been configured and you've got the switching set up, simply run 'systemctl enable gswitch' and it will configure the eGPU automatically when you boot. It will also switch back to internal if you've by accident forgotten to before leaving and found yourself stuck at a black screen; no more!
Yeah, that happened once too many
Hope it helps!
PS. If you have something you feel could be done better, we can discuss the changes here, then for the actual code, pull requests are warmly welcome!
@sebulon Welcome aboard and thank you for sharing this script! To clarify we only need to change the driver identification and BusID to replicate your success? I'm using an Alienware 15 R3 that has Intel iGPU running the internal display, nVidia dGPU that doesn't seem to do anything, and AMD eGPU that can work with internal display mode (DRI_PRIME=1) but has absolutely no external monitor output.
Thanks man, appreciate it!
Well, I can't say for sure, no guarantees. It's Hippie, right? 🙂 But in theory, yeah, should be.
Prime is something new to me, could you explain how to use it?
I'm a novice so I simply followed the instructions posted in this Linux sub forum. To get my AW15R3 use the eGPU I put Prime string in front of whichever software I want to run. For example, I run Unigine Valley with
DRI_PRIME=1 ./valley. This works well so far but I'd like to get external monitor output and have a better control over which GPU is doing what.
Ah, OK, seems easy enough 🙂
Going to try it that tonight and see how it goes. Wonder how that goes with processes that starts other processes... Like you start steam; that gets rendered with the eGPU, but what about when I start a game from it, does it inherit, or does it default? I'll report back when it's tested!
And about the "BusID", remember to convert from hex to decimal. Maybe you already knew that but it's worth mentioning
Neh, Prime did not work for me, it renders on the built-in Quadro in my Lenovo P50, looks like this:
So I guess the time spent scripting pays off, at least Could you run the commands and share the output, just for comparisons sake?
Thank you for testing it with your setup. I will get the output and post them tonight on my AW15R3 + eGPU.
Here's my output:
Seeing that output, I think your problem is that the WX cards are (to the best of my knowledge) only supported by the AMDGPU-PRO driver and not the open source amdgpu driver. And to make things even more confusing, note that you might not be able to install the AMDGPU-PRO driver on your existing OS, only Ubuntu 16.04.
You could try going with a different card, maybe an nvidia one since @sebulon seems to have gotten nvidia eGPU+dGPU working.
Looks supported to me: