eGPU in Ubuntu 18.04 works flawlessly  

  RSS

gt0242
(@gt0242)
Active Member
Joined: 12 months ago
Posts: 7
October 20, 2018 3:41 pm  

I have a Mid-2012 Macbook Pro with 16GB ram and 2TB SSD. The eGPU is an Aorus Gaming Box 1080. I am using it as a native GPU for my laptop, full internal screen acceleration, able to run Steam Proton games, Blender rendering and CUDA. Without any major hassles or setup steps.

What I did -

  1. Installed Ubuntu 18.04.
  2. Installed Nvidia 396 proprietary drivers.
  3. Ensured I had nvidia-prime installed. 
  4. In the terminal ran prime-select nvidia.
  5. Rebooted
  6. For first time boot added boot parameter "nvidia-drm.modeselect=1". Didn't have to do this for any later logins.
  7. GTX 1080 was recognised and used by system as native GPU. Internal screen is automatically accelerated. All apps use the eGPU by default.
  8. Connected eGPU to my UHD (4K?) TV via HDMI. TV screen was recognised instantly by the system and set to its max resolution.

Have since upgraded to Nvidia 410, without any issues.

Caveats -
No hotplugging. Since it is used as native GPU needs to be connected at login. If you want you can disconnect eGPU at login and system simply uses the iGPU.

Performance -
What you would expect from a eGPU on a TB1 connection. Thankfully since the screen resolution is 1280x720, there are no performance bottlenecks. I have attached screenshots for Heaven benchmark using internal screen and UHD TV. 
https://imgur.com/HzgY0Lf
https://imgur.com/St9aTKr

Bottomline - 
My experience with Ubuntu 18.04 has been so good that I no longer login to MacOS. Its only purpose is to serve as a means for my iphone/ipad backups. I don't see any need to use macos anymore. Apple makes us jump through two many hoops for simple things, OR pay tonnes of money. 
I am planning to see if I can get Unreal Editor running in Proton on my setup. Will update if that works.
My laptop is due an upgrade. I am need to decide between the XPS 13 or 15 or Alienware 13r3. With Linux now an absolute viable replacement to windows and macos for my needs and my ability to run MacOS in Virtualbox, I don't think I will be getting a new macbook for some years now.

This topic was modified 3 months ago

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


jeemaline, theitsage, mac_editor and 1 people liked
ReplyQuote
mac_editor
(@mac_editor)
Noble Member Moderator
Joined: 2 years ago
Posts: 1702
October 20, 2018 5:14 pm  

This is good stuff! Perhaps a link/guide to installing Ubuntu natively on Mac may round up this guide really well.

purge-wrangler.shpurge-nvda.shset-eGPU.shautomate-eGPU EFI Installer
----
Troubleshooting eGPUs on macOS
Command Line Swiss Knife
eGPU Hardware Chart
----
Multiple Build Guides


theitsage liked
ReplyQuote
nu_ninja
(@nu_ninja)
Trusted Member
Joined: 10 months ago
Posts: 98
October 20, 2018 7:36 pm  

@gt0242

So if I read this correctly, you're able to boot with or without your eGPU plugged in? My setup with an AMD card wasn't quite as nice and this is something I'm still figuring out.

Mid-2012 13" Macbook Pro (MacBookPro9,2) TB1 -> RX 460 (AKiTiO Node)
+ macOS 10.14.1+Win10
+ Linux Mint 19


ReplyQuote
gt0242
(@gt0242)
Active Member
Joined: 12 months ago
Posts: 7
October 21, 2018 8:21 am  

@mac_editor : For installing Ubuntu 18.04 I did the following,

  1. Download latest live CD from Ubuntu site
  2. Use Unetbootin to write the cd onto a USB drive
  3. I use refind on my macbook pro. They have an excellent guide for installing refind in macos. Refind automatically lists all bootable drives - internal and external.
  4. So connect usb, reboot and select the Ubuntu boot option in refind menu.
  5. To install Ubuntu without installing grub, since I have refind, I started the installer from the terminal using this command - "ubiquity --no-bootloader"
  6. Then follow the prompts of the installer and ensure to select to install proprietary drivers.
  7. Once the installer is done, reboot, remove USB drive and select the Ubuntu option from refind menu.
  8. In Ubuntu, open terminal use "sudo apt install nvidia-driver-xxx" to install latest nvidia drivers.
  9. After the install is done run the command "prime-select nvidia".
  10. Once this is done Reboot.
  11. On refind menu select "Ubuntu" option and press <tab>. Enter this at the end of the boot options "nvidia-drm.modeselect=1". This is one time. I have not had to use it again.
  12. Press enter after setting the boot option, boot into Ubuntu and enjoy!

This will work best in a Macbook or laptop with only iGPU and eGPU with Nvidia card. For other systems it could require more steps to configure the drivers.

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


mac_editor and theitsage liked
ReplyQuote
gt0242
(@gt0242)
Active Member
Joined: 12 months ago
Posts: 7
October 21, 2018 8:25 am  

@nu_ninjaI haven't looked into this carefully but I can see prime-select makes a custom boot image with the nvidia drivers as the main/sole drivers at boot. I believe this allows the "nvidia-settings" software to kick in and set everything up. For systems with a dGPU or AMD eGPU, this would mean figuring out how to generate custom boot image(s) that work similarly.

Btw, prime-select is a python script. If you are so inclined, you can check them out and see if they can be modified to help out with your configuration.

Also, if I don't connect the eGPU at boot and hot plug it after booting, it is still recognised and it works for CUDA and rendering. I only have issues getting Steam to use it and run games. I've found that in linux with the latest kernels installed, eGPU over thunderbolt is pretty much plug and play for using it for non-gaming tasks.

 

This post was modified 3 months ago

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


ReplyQuote
nu_ninja
(@nu_ninja)
Trusted Member
Joined: 10 months ago
Posts: 98
October 21, 2018 8:54 pm  

Thanks for the tip. I think I've got it working pretty well now. I pretty much copied the config file from the Arch wiki on prime and added a second server layout block with the iGPU as primary. Here's my full configuration file:

Section "ServerLayout"
Identifier "layout"
Screen 0 "intel"
Inactive "amdgpu"
EndSection

Section "ServerLayout"
Identifier "egpu"
Screen 0 "amdgpu"
Inactive "intel"
EndSection

Section "Device"
Identifier "amdgpu"
Driver "amdgpu"
BusID "PCI:10:0:0"
#BusID in decimal, convert from hex
# Option "AllowEmptyInitialConfiguration"
# Option "AllowExternalGpus"
EndSection

Section "Screen"
Identifier "amdgpu"
Device "amdgpu"
EndSection

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

Section "Screen"
Identifier "intel"
Device "intel"
EndSection

so logging in normally starts with the iGPU, but logging in through the console (Ctrl-Alt-F1) and running

 startx -- -layout egpu 

starts a session with the eGPU as primary. This fixed my problem of starting up with or without the eGPU connected.
I'd definitely like to see more eGPU on linux, it seems pretty plug and play with nvidia and not too bad with amd either once you figure it out, but more complex setups could prove otherwise.

This post was modified 3 months ago

Mid-2012 13" Macbook Pro (MacBookPro9,2) TB1 -> RX 460 (AKiTiO Node)
+ macOS 10.14.1+Win10
+ Linux Mint 19


theitsage liked
ReplyQuote
theitsage
(@itsage)
Famed Member Admin
Joined: 2 years ago
Posts: 3401
October 22, 2018 5:09 pm  

Nice to see eGPU on Linux is getting easier to implement. We'd love to see a build guide when you have time.

Best ultrabooks for eGPU use

eGPU enclosure buying guide

94 external GPU build guides


ReplyQuote
mzo
 mzo
(@mzo)
Active Member
Joined: 2 years ago
Posts: 13
November 22, 2018 5:08 am  

@nu_ninja

Hi,  my late 2016 MacBook pro 13,3 (15 inch w Touch Bar) is setup as tri-boot with macOS HS, win 10 and Ubuntu 18.10 with kernel 4.19. I have an eGPU Nvidia 1080ti with Akitio thunder 3 mod’ed. eGPU all setup to work under MacOS and win.

I’m now trying to set this up under Linux. I got the system recognize the box and egpu and next step will be to install CUDA to use it for GPU rendering, etc with 3D apps. However, I would like to also try to use the egpu as primary gpu under Linux and deactivate intel iGPU and Radeon 460 dGPU (also because amdgpu driver is not very stable as the card gets too hot and some times it shuts down producing kernel panic). 

Would you mind elaborate a little more the steps in regard to drivers to use (open source vs proprietary) and how to configure Xorg and exactly what kernel parameters to add to /etc/default/grub in order to achieve what you achieved but with a dGPU in the mix? Thanks!

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


ReplyQuote
nu_ninja
(@nu_ninja)
Trusted Member
Joined: 10 months ago
Posts: 98
November 22, 2018 2:29 pm  

I'd use the nvidia proprietary drivers as that's what most people seem to have used so far on this forum. You can try an x config like the one from the sticky which should just use the egpu as the primary and only graphics device.

Edit:
I see sebulon has given you similar advice in the other sticky thread. That'll do a similar thing but fully automated so I'd try that method first

Mid-2012 13" Macbook Pro (MacBookPro9,2) TB1 -> RX 460 (AKiTiO Node)
+ macOS 10.14.1+Win10
+ Linux Mint 19


ReplyQuote
mzo
 mzo
(@mzo)
Active Member
Joined: 2 years ago
Posts: 13
November 22, 2018 7:03 pm  

@nu_ninja 

Sounds good, thanks.

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


ReplyQuote