eGPU in Ubuntu 18.04 works flawlessly  

  RSS

gt0242
(@gt0242)
Active Member
Joined: 10 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.


jeemaline, theitsage, mac_editor and 1 people liked
ReplyQuote
mac_editor
(@mac_editor)
Noble Member Moderator
Joined: 2 years  ago
Posts: 1485
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.sh
----
Troubleshooting eGPUs on macOS
Command Line Swiss Knife
----
Multiple Build Guides


theitsage liked
ReplyQuote
nu_ninja
(@nu_ninja)
Trusted Member
Joined: 7 months  ago
Posts: 53
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+Win10+Linux Mint 19
https://egpu.io/forums/builds/mid-2012-13-macbook-pro-macbookpro92-tb1-rx-460-akitio-node-macos-10-13-6win10/#post-43638
https://egpu.io/forums/builds/mid-2012-13-macbook-pro-rx46010gbps-tb1-3-linux-mint-19-build-guide-benchmarks-nu_ninja/#post-47083


ReplyQuote
gt0242
(@gt0242)
Active Member
Joined: 10 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.


mac_editor and theitsage liked
ReplyQuote
gt0242
(@gt0242)
Active Member
Joined: 10 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.

 


ReplyQuote
nu_ninja
(@nu_ninja)
Trusted Member
Joined: 7 months  ago
Posts: 53
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.

Mid-2012 13" Macbook Pro (MacBookPro9,2) TB1 -> RX 460 (AKiTiO Node) macOS 10.14+Win10+Linux Mint 19
https://egpu.io/forums/builds/mid-2012-13-macbook-pro-macbookpro92-tb1-rx-460-akitio-node-macos-10-13-6win10/#post-43638
https://egpu.io/forums/builds/mid-2012-13-macbook-pro-rx46010gbps-tb1-3-linux-mint-19-build-guide-benchmarks-nu_ninja/#post-47083


theitsage liked
ReplyQuote
theitsage
(@itsage)
Famed Member Admin
Joined: 2 years  ago
Posts: 3081
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

82 external GPU build guides


ReplyQuote