eGPU on Linux Ubuntu 19.04 - Easy-to-use setup script
 
Notifications
Clear all

eGPU on Linux Ubuntu 19.04 - Easy-to-use setup script  

 of  8
  RSS

hertg
(@hertg)
Active Member
Joined: 1 year ago
 

Hello there,

I have created a script which automatically detects your (E)GPUs and creates the needed X-Server configuration files.
You won't have to mess around with finding the correct BUS-IDs and convert them from dec to hex or anything like that, the script takes care of it.

Just execute the setup command and choose which GPU is the internal, and which the external one.
After that, your computer will automatically detect on startup wheter your EGPU is connected or not, and decides which X-Server configuration it is going to use.

For further information, please refer to the README in my Github Repository.
You'll also find all the source code in there.

Installation
Connect your EGPU to your computer and make sure the Thunderbolt connection is authorized. Then execute the following commands.

$ sudo add-apt-repository ppa:hertg/egpu-switcher
$ sudo apt update
$ sudo apt install egpu-switcher
$ sudo egpu-switcher setup
screenshot setup

No more steps needed, your computer will automatically select the correct X-Server configuration on startup.

Disclaimer
I am using this script with my Lenovo Thinkpad X1 Extreme (Hybrid graphics with a Nvidia GTX 1050 Ti). My EGPU is a GTX 1080 in a Mantiz MZ-02 VENUS enclosure.
This was only tested in Ubuntu 19.04, but it might work in other distros / versions too.
As i have no AMD GPU, this was only tested with Nvidia, but theoretically AMD GPUs could work too. Would be great if someone could test that and report back if it works. Smile Update: @itsage successfully tested it, and it does work with AMD GPUs as well. There seem to be issues in using 5K+ displays, but those are unlikely to be directly related to the script.

Why yet another script

I was initially quite overwhelmed by the steps i had to take in order to make my EGPU work with Ubuntu. As i had no knowledge about X-Server and why i needed to tamper around with it. I created this project mainly to learn more about X-Server, GPUs in Linux and how to publish packages for Ubuntu.
I am in no means an expert, and there certainly are some bugs, but i've tried my best and hope that someone may find it useful.

If this script doesn't work for you
Please let me know or feel free to create a pull request.
Also, the whole setup process can be reverted by executing egpu-switcher cleanup or by removing the package completely with apt remove --purge egpu-switcher. This command will even restore your previous xorg.conf file, if you had one.

Please also refer to these other great projects if mine doesn't work for you:

This topic was modified 1 year ago

Notebook: Lenovo ThinkPad X1 Extreme (GTX 1050 Max-Q Ti)
EGPU: Mantiz MZ-02 VENUS (GTX 1080)
OS: Ubuntu 19.04


dannawilson, DrEGPU, Madlink and 2 people liked
ReplyQuote
itsage
(@itsage)
Illustrious Member Admin
Joined: 4 years ago
 

@hertg Welcome aboard and thank you for this simple-to-use script! I will try it on my Alienware 15R3 [Nvidia GTX 1070 dGPU] with an AMD eGPU and report back.

external graphics card builds
best laptops for external GPU
eGPU enclosure buyer's guide

 
2020 13" MacBook Pro [10th,4C,G] + RX 5700 @ 32Gbps-TB3 (Prototype eGPU Enclosure) + macOS 10.15.4 & Win10 1903 [build link]  


ReplyQuote
hertg
(@hertg)
Active Member
Joined: 1 year ago
 

@itsage
Thanks, looking forward to it!
I hope that "amdgpu" is the correct driver name to use in the xorg.conf, cause that's what i currently write into it, if the GPU has "AMD" in its name.

Notebook: Lenovo ThinkPad X1 Extreme (GTX 1050 Max-Q Ti)
EGPU: Mantiz MZ-02 VENUS (GTX 1080)
OS: Ubuntu 19.04


ReplyQuote
mac_editor
(@mac_editor)
Famed Member Moderator
Joined: 3 years ago
 

Super-happy to see eGPU on Linux get easier and easier. Wish I had a bare metal Linux machine to experiment + a bunch of time.

purge-wranglertbt-flashpurge-nvdaset-eGPU
Insights Into macOS Video Editing Performance

Master Threads:
2014 15-inch MacBook Pro 750M
2018 15-inch MacBook Pro

 
2019 13" MacBook Pro [8th,4C,U] + RX Vega 64 @ 32Gbps-TB3 (Mantiz Venus) + macOS 10.14.6 & Win10 [build link]  


ReplyQuote
itsage
(@itsage)
Illustrious Member Admin
Joined: 4 years ago
 

@hertg I have great news to report. It worked first try on my Alienware 15 R3! First test was with the Razer Core + WX 9100. I connected a 5K monitor HP Z27q but the drivers couldn't combine the two DisplayPort streams to produce 5K resolutions. Even a single DisplayPort connection didn't work well because instead of going to 4K, it was a vertical half of 5K.

I then tried another eGPU setup [Razer Core X Chroma + Radeon VII]. It worked too and the connected monitor this time was a Samsung 49". It's a single DisplayPort conenction and I got full resolution, 3840 x 1080 at 144Hz. I fired up Steam Play and got Age of Empires II running nicely on the external monitor.

There's a strange cursor jump with the internal display when the AMD eGPU is connected. You may have seen in the first photo, the system couldn't detect the Intel iGPU because the internal display is directly attached to the GTX 1070 dGPU. Perhaps I need to install a different set of Nvidia drivers?

external graphics card builds
best laptops for external GPU
eGPU enclosure buyer's guide

 
2020 13" MacBook Pro [10th,4C,G] + RX 5700 @ 32Gbps-TB3 (Prototype eGPU Enclosure) + macOS 10.15.4 & Win10 1903 [build link]  


ReplyQuote
hertg
(@hertg)
Active Member
Joined: 1 year ago
 

@itsage Great to hear that it (somewhat) works with AMD GPUs.
That's a very strange behaviour indeed. I never tested it with a 4k+ monitor, but it works for me with the monitors below.

screenshot nvidia xconfig

Unfortunately, I don't think that i can do much about that issue in my script, since all it does is creating an xorg.conf file with the following contents:

Section "Module"
 Load "modesetting"
EndSection

Section "Device"
 Identifier "Device0"
 Driver "<your-driver>"
 BusID "<your-bus-id>"
 Option "AllowEmptyInitialConfiguration"
 Option "AllowExternalGpus" "True"
EndSection

For the integrated graphics: Did you disable the integrated graphics in the BIOS? Because that is what i had to do, in order to install Ubuntu 19.04. I then re-enabled it later after the installation was complete. If you connected your internal display directly to the dedicated GPU, i think you should still see the integrated graphics, but i might be wrong about that (?).

It's also kind of strange, why your Wireless Network Adapter shows up in the list, would you mind posting the output of the following command: lspci | grep -Ei "3d|vga"
Also try executing the lspci command without grep, and see if your integrated graphics shows up in this list.

Which nvidia drivers do you have installed currently? I am on nvidia-418.
I will post the results of my system below, maybe it helps you in finding a possible issue.

sudo apt list --installed *nvidia*

screenshot drivers

lspci | grep -Ei "3d|vga"

screenshot lspci

uname -a

screenshot uname

Notebook: Lenovo ThinkPad X1 Extreme (GTX 1050 Max-Q Ti)
EGPU: Mantiz MZ-02 VENUS (GTX 1080)
OS: Ubuntu 19.04


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

Looks like the wifi card is on bus 61 which in hex is "3D"

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]  


hertg liked
ReplyQuote
OliverB
(@oliverb)
Noble Member
Joined: 2 years ago
 

@hertg
why are you using an nVidia eGPU? Common sense is that AMD is much better supported in Linux, isn't it?

2018 15" MBP & 2015 13" MBP connected to RTX2080Ti GTX1080Ti GTX1080 Vega56 RX580 R9-290 GTX680

 
2018 15" MacBook Pro (RP560X) [8th,6C,H] + RX 5700 XT @ 32Gbps-TB3 (ASUS XG Station Pro) + Win10 & macOS 10.15.4 [build link]  


ReplyQuote
hertg
(@hertg)
Active Member
Joined: 1 year ago
 

@oliverb
I made a switch from using a desktop to using a notebook + egpu, so the GTX 1080 is the one i had in my desktop previously.
Yes, as far as i know, AMD does publish their drivers open source, therefore it can be better integrated into Linux. I'm still hoping Nvidia might do the same someday.

Notebook: Lenovo ThinkPad X1 Extreme (GTX 1050 Max-Q Ti)
EGPU: Mantiz MZ-02 VENUS (GTX 1080)
OS: Ubuntu 19.04


OliverB liked
ReplyQuote
itsage
(@itsage)
Illustrious Member Admin
Joined: 4 years ago
 

@hertg Thank you for the advice. I was on nvidia-390. The AMD eGPU is running Mesa 19.0.2 and Nvidia dGPU is running 418 now.

I was also able to replicate this success on a 2019 Razer Blade Stealth. Intel iGPU, MX150 dGPU, and Radeon VII eGPU all showed up. There's some "invalid number" message after I set the GPU preferences but things seem to work fine.

external graphics card builds
best laptops for external GPU
eGPU enclosure buyer's guide

 
2020 13" MacBook Pro [10th,4C,G] + RX 5700 @ 32Gbps-TB3 (Prototype eGPU Enclosure) + macOS 10.15.4 & Win10 1903 [build link]  


ReplyQuote
 of  8